智慧水务管理系统 - 精河县供水工程综合管理平台

index.js 4.4MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008
  1. /**
  2. * @license
  3. * Cesium - https://github.com/CesiumGS/cesium
  4. * Version 1.142.0
  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 wOe=Object.create;var I9=Object.defineProperty;var IOe=Object.getOwnPropertyDescriptor;var DOe=Object.getOwnPropertyNames;var POe=Object.getPrototypeOf,ROe=Object.prototype.hasOwnProperty;var OOe=(e,t,n)=>t in e?I9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var DO=(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 $d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var MOe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of DOe(t))!ROe.call(e,o)&&o!==n&&I9(e,o,{get:()=>t[o],enumerable:!(i=IOe(t,o))||i.enumerable});return e};var Na=(e,t,n)=>(n=e!=null?wOe(POe(e)):{},MOe(t||!e||!e.__esModule?I9(n,"default",{value:e,enumerable:!0}):n,e));var lt=(e,t,n)=>OOe(e,typeof t!="symbol"?t+"":t,n);var PO=$d((dkt,Oie)=>{var i0=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)};i0.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}};i0.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};i0.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};i0.prototype.random_int31=function(){return this.random_int()>>>1};i0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};i0.prototype.random=function(){return this.random_int()*(1/4294967296)};i0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};i0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Oie.exports=i0});var soe=$d((IT,DT)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof IT=="object"&&IT&&!IT.nodeType&&IT,n=typeof DT=="object"&&DT&&!DT.nodeType&&DT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,a=36,s=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,A=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=a-s,T=Math.floor,E=String.fromCharCode,S;function w(k){throw new RangeError(x[k])}function P(k,V){for(var F=k.length,W=[];F--;)W[F]=V(k[F]);return W}function O(k,V){var F=k.split("@"),W="";F.length>1&&(W=F[0]+"@",k=F[1]),k=k.replace(y,".");var q=k.split("."),J=P(q,V).join(".");return W+J}function B(k){for(var V=[],F=0,W=k.length,q,J;F<W;)q=k.charCodeAt(F++),q>=55296&&q<=56319&&F<W?(J=k.charCodeAt(F++),(J&64512)==56320?V.push(((q&1023)<<10)+(J&1023)+65536):(V.push(q),F--)):V.push(q);return V}function L(k){return P(k,function(V){var F="";return V>65535&&(V-=65536,F+=E(V>>>10&1023|55296),V=56320|V&1023),F+=E(V),F}).join("")}function _(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:a}function C(k,V){return k+22+75*(k<26)-((V!=0)<<5)}function v(k,V,F){var W=0;for(k=F?T(k/f):k>>1,k+=T(k/V);k>b*c>>1;W+=a)k=T(k/b);return T(W+(b+1)*k/(k+u))}function I(k){var V=[],F=k.length,W,q=0,J=p,H=d,Z,K,le,me,ae,be,ge,we,Ee;for(Z=k.lastIndexOf(g),Z<0&&(Z=0),K=0;K<Z;++K)k.charCodeAt(K)>=128&&w("not-basic"),V.push(k.charCodeAt(K));for(le=Z>0?Z+1:0;le<F;){for(me=q,ae=1,be=a;le>=F&&w("invalid-input"),ge=_(k.charCodeAt(le++)),(ge>=a||ge>T((r-q)/ae))&&w("overflow"),q+=ge*ae,we=be<=H?s:be>=H+c?c:be-H,!(ge<we);be+=a)Ee=a-we,ae>T(r/Ee)&&w("overflow"),ae*=Ee;W=V.length+1,H=v(q-me,W,me==0),T(q/W)>r-J&&w("overflow"),J+=T(q/W),q%=W,V.splice(q++,0,J)}return L(V)}function M(k){var V,F,W,q,J,H,Z,K,le,me,ae,be=[],ge,we,Ee,Be;for(k=B(k),ge=k.length,V=p,F=0,J=d,H=0;H<ge;++H)ae=k[H],ae<128&&be.push(E(ae));for(W=q=be.length,q&&be.push(g);W<ge;){for(Z=r,H=0;H<ge;++H)ae=k[H],ae>=V&&ae<Z&&(Z=ae);for(we=W+1,Z-V>T((r-F)/we)&&w("overflow"),F+=(Z-V)*we,V=Z,H=0;H<ge;++H)if(ae=k[H],ae<V&&++F>r&&w("overflow"),ae==V){for(K=F,le=a;me=le<=J?s:le>=J+c?c:le-J,!(K<me);le+=a)Be=K-me,Ee=a-me,be.push(E(C(me+Be%Ee,0))),K=T(Be/Ee);be.push(E(C(K,0))),J=v(F,we,W==q),F=0,++W}++F,++V}return be.join("")}function N(k){return O(k,function(V){return m.test(V)?I(V.slice(4).toLowerCase()):V})}function j(k){return O(k,function(V){return A.test(V)?"xn--"+M(V):V})}if(o={version:"1.3.2",ucs2:{decode:B,encode:L},decode:I,encode:M,toASCII:j,toUnicode:N},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(DT.exports==t)n.exports=o;else for(S in o)o.hasOwnProperty(S)&&(t[S]=o[S]);else e.punycode=o})(IT)});var loe=$d((coe,XO)=>{/*!
  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 XO=="object"&&XO.exports?XO.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(coe,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),a=r.split(":"),s=a.length,c=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[s-1]===""&&a[s-2]===""&&a.pop(),s=a.length,a[s-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<s&&a[u]!=="";u++);if(u<c)for(a.splice(u,1,"0000");a.length<c;)a.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=a[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);a[d]=f.join("")}var g=-1,m=0,A=0,y=-1,x=!1;for(d=0;d<c;d++)x?a[d]==="0"?A+=1:(x=!1,A>m&&(g=y,m=A)):a[d]==="0"&&(x=!0,y=d,A=1);A>m&&(g=y,m=A),m>1&&a.splice(g,m,""),s=a.length;var b="";for(a[0]===""&&(b=":"),d=0;d<s&&(b+=a[d],d!==s-1);d++)b+=":";return a[s-1]===""&&(b+=":"),b}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var foe=$d((uoe,KO)=>{/*!
  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 KO=="object"&&KO.exports?KO.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(uoe,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 a=n.list[i.slice(o+1)];return a?a.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 a=n.list[i.slice(o+1)];return a?a.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 a=n.list[i.slice(o+1)];return!a||a.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 ju=$d((doe,QO)=>{/*!
  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 QO=="object"&&QO.exports?QO.exports=t(soe(),loe(),foe()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(doe,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(C,v){var I=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof r))return I?M?new r(C,v):new r(C):new r;if(C===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?C=location.href+"":C=""}if(C===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(C),v!==void 0?this.absoluteTo(v):this}function a(C){return/^[0-9]+$/.test(C)}r.version="1.19.11";var s=r.prototype,c=Object.prototype.hasOwnProperty;function u(C){return C.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(C){return C===void 0?"Undefined":String(Object.prototype.toString.call(C)).slice(8,-1)}function d(C){return f(C)==="Array"}function p(C,v){var I={},M,N;if(f(v)==="RegExp")I=null;else if(d(v))for(M=0,N=v.length;M<N;M++)I[v[M]]=!0;else I[v]=!0;for(M=0,N=C.length;M<N;M++){var j=I&&I[C[M]]!==void 0||!I&&v.test(C[M]);j&&(C.splice(M,1),N--,M--)}return C}function g(C,v){var I,M;if(d(v)){for(I=0,M=v.length;I<M;I++)if(!g(C,v[I]))return!1;return!0}var N=f(v);for(I=0,M=C.length;I<M;I++)if(N==="RegExp"){if(typeof C[I]=="string"&&C[I].match(v))return!0}else if(C[I]===v)return!0;return!1}function m(C,v){if(!d(C)||!d(v)||C.length!==v.length)return!1;C.sort(),v.sort();for(var I=0,M=C.length;I<M;I++)if(C[I]!==v[I])return!1;return!0}function A(C){var v=/^\/+|\/+$/g;return C.replace(v,"")}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(C){if(!(!C||!C.nodeName)){var v=C.nodeName.toLowerCase();if(!(v==="input"&&C.type!=="image"))return r.domAttributes[v]}};function y(C){return escape(C)}function x(C){return encodeURIComponent(C).replace(/[!'()*]/g,y).replace(/\*/g,"%2A")}r.encode=x,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=x,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(C,v){var I=r.encode(C+"");return v===void 0&&(v=r.escapeQuerySpace),v?I.replace(/%20/g,"+"):I},r.decodeQuery=function(C,v){C+="",v===void 0&&(v=r.escapeQuerySpace);try{return r.decode(v?C.replace(/\+/g,"%20"):C)}catch{return C}};var b={encode:"encode",decode:"decode"},T,E=function(C,v){return function(I){try{return r[v](I+"").replace(r.characters[C][v].expression,function(M){return r.characters[C][v].map[M]})}catch{return I}}};for(T in b)r[T+"PathSegment"]=E("pathname",b[T]),r[T+"UrnPathSegment"]=E("urnpath",b[T]);var S=function(C,v,I){return function(M){var N;I?N=function(F){return r[v](r[I](F))}:N=r[v];for(var j=(M+"").split(C),k=0,V=j.length;k<V;k++)j[k]=N(j[k]);return j.join(C)}};r.decodePath=S("/","decodePathSegment"),r.decodeUrnPath=S(":","decodeUrnPathSegment"),r.recodePath=S("/","encodePathSegment","decode"),r.recodeUrnPath=S(":","encodeUrnPathSegment","decode"),r.encodeReserved=E("reserved","encode"),r.parse=function(C,v){var I;return v||(v={preventInvalidHostname:r.preventInvalidHostname}),C=C.replace(r.leading_whitespace_expression,""),C=C.replace(r.ascii_tab_whitespace,""),I=C.indexOf("#"),I>-1&&(v.fragment=C.substring(I+1)||null,C=C.substring(0,I)),I=C.indexOf("?"),I>-1&&(v.query=C.substring(I+1)||null,C=C.substring(0,I)),C=C.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),C=C.replace(/^[/\\]{2,}/i,"//"),C.substring(0,2)==="//"?(v.protocol=null,C=C.substring(2),C=r.parseAuthority(C,v)):(I=C.indexOf(":"),I>-1&&(v.protocol=C.substring(0,I)||null,v.protocol&&!v.protocol.match(r.protocol_expression)?v.protocol=void 0:C.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(C=C.substring(I+3),C=r.parseAuthority(C,v)):(C=C.substring(I+1),v.urn=!0))),v.path=C,v},r.parseHost=function(C,v){C||(C=""),C=C.replace(/\\/g,"/");var I=C.indexOf("/"),M,N;if(I===-1&&(I=C.length),C.charAt(0)==="[")M=C.indexOf("]"),v.hostname=C.substring(1,M)||null,v.port=C.substring(M+2,I)||null,v.port==="/"&&(v.port=null);else{var j=C.indexOf(":"),k=C.indexOf("/"),V=C.indexOf(":",j+1);V!==-1&&(k===-1||V<k)?(v.hostname=C.substring(0,I)||null,v.port=null):(N=C.substring(0,I).split(":"),v.hostname=N[0]||null,v.port=N[1]||null)}return v.hostname&&C.substring(I).charAt(0)!=="/"&&(I++,C="/"+C),v.preventInvalidHostname&&r.ensureValidHostname(v.hostname,v.protocol),v.port&&r.ensureValidPort(v.port),C.substring(I)||"/"},r.parseAuthority=function(C,v){return C=r.parseUserinfo(C,v),r.parseHost(C,v)},r.parseUserinfo=function(C,v){var I=C,M=C.indexOf("\\");M!==-1&&(C=C.replace(/\\/g,"/"));var N=C.indexOf("/"),j=C.lastIndexOf("@",N>-1?N:C.length-1),k;return j>-1&&(N===-1||j<N)?(k=C.substring(0,j).split(":"),v.username=k[0]?r.decode(k[0]):null,k.shift(),v.password=k[0]?r.decode(k.join(":")):null,C=I.substring(j+1)):(v.username=null,v.password=null),C},r.parseQuery=function(C,v){if(!C)return{};if(C=C.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!C)return{};for(var I={},M=C.split("&"),N=M.length,j,k,V,F=0;F<N;F++)j=M[F].split("="),k=r.decodeQuery(j.shift(),v),V=j.length?r.decodeQuery(j.join("="),v):null,k!=="__proto__"&&(c.call(I,k)?((typeof I[k]=="string"||I[k]===null)&&(I[k]=[I[k]]),I[k].push(V)):I[k]=V);return I},r.build=function(C){var v="",I=!1;return C.protocol&&(v+=C.protocol+":"),!C.urn&&(v||C.hostname)&&(v+="//",I=!0),v+=r.buildAuthority(C)||"",typeof C.path=="string"&&(C.path.charAt(0)!=="/"&&I&&(v+="/"),v+=C.path),typeof C.query=="string"&&C.query&&(v+="?"+C.query),typeof C.fragment=="string"&&C.fragment&&(v+="#"+C.fragment),v},r.buildHost=function(C){var v="";if(C.hostname)r.ip6_expression.test(C.hostname)?v+="["+C.hostname+"]":v+=C.hostname;else return"";return C.port&&(v+=":"+C.port),v},r.buildAuthority=function(C){return r.buildUserinfo(C)+r.buildHost(C)},r.buildUserinfo=function(C){var v="";return C.username&&(v+=r.encode(C.username)),C.password&&(v+=":"+r.encode(C.password)),v&&(v+="@"),v},r.buildQuery=function(C,v,I){var M="",N,j,k,V;for(j in C)if(j!=="__proto__"&&c.call(C,j))if(d(C[j]))for(N={},k=0,V=C[j].length;k<V;k++)C[j][k]!==void 0&&N[C[j][k]+""]===void 0&&(M+="&"+r.buildQueryParameter(j,C[j][k],I),v!==!0&&(N[C[j][k]+""]=!0));else C[j]!==void 0&&(M+="&"+r.buildQueryParameter(j,C[j],I));return M.substring(1)},r.buildQueryParameter=function(C,v,I){return r.encodeQuery(C,I)+(v!==null?"="+r.encodeQuery(v,I):"")},r.addQuery=function(C,v,I){if(typeof v=="object")for(var M in v)c.call(v,M)&&r.addQuery(C,M,v[M]);else if(typeof v=="string"){if(C[v]===void 0){C[v]=I;return}else typeof C[v]=="string"&&(C[v]=[C[v]]);d(I)||(I=[I]),C[v]=(C[v]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(C,v,I){if(typeof v=="object")for(var M in v)c.call(v,M)&&r.setQuery(C,M,v[M]);else if(typeof v=="string")C[v]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(C,v,I){var M,N,j;if(d(v))for(M=0,N=v.length;M<N;M++)C[v[M]]=void 0;else if(f(v)==="RegExp")for(j in C)v.test(j)&&(C[j]=void 0);else if(typeof v=="object")for(j in v)c.call(v,j)&&r.removeQuery(C,j,v[j]);else if(typeof v=="string")I!==void 0?f(I)==="RegExp"?!d(C[v])&&I.test(C[v])?C[v]=void 0:C[v]=p(C[v],I):C[v]===String(I)&&(!d(I)||I.length===1)?C[v]=void 0:d(C[v])&&(C[v]=p(C[v],I)):C[v]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(C,v,I,M){switch(f(v)){case"String":break;case"RegExp":for(var N in C)if(c.call(C,N)&&v.test(N)&&(I===void 0||r.hasQuery(C,N,I)))return!0;return!1;case"Object":for(var j in v)if(c.call(v,j)&&!r.hasQuery(C,j,v[j]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return v in C;case"Boolean":var k=!!(d(C[v])?C[v].length:C[v]);return I===k;case"Function":return!!I(C[v],v,C);case"Array":if(!d(C[v]))return!1;var V=M?g:m;return V(C[v],I);case"RegExp":return d(C[v])?M?g(C[v],I):!1:!!(C[v]&&C[v].match(I));case"Number":I=String(I);case"String":return d(C[v])?M?g(C[v],I):!1:C[v]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var C=[],v=[],I=0,M=0;M<arguments.length;M++){var N=new r(arguments[M]);C.push(N);for(var j=N.segment(),k=0;k<j.length;k++)typeof j[k]=="string"&&v.push(j[k]),j[k]&&I++}if(!v.length||!I)return new r("");var V=new r("").segment(v);return(C[0].path()===""||C[0].path().slice(0,1)==="/")&&V.path("/"+V.path()),V.normalize()},r.commonPath=function(C,v){var I=Math.min(C.length,v.length),M;for(M=0;M<I;M++)if(C.charAt(M)!==v.charAt(M)){M--;break}return M<1?C.charAt(0)===v.charAt(0)&&C.charAt(0)==="/"?"/":"":((C.charAt(M)!=="/"||v.charAt(M)!=="/")&&(M=C.substring(0,M).lastIndexOf("/")),C.substring(0,M+1))},r.withinString=function(C,v,I){I||(I={});var M=I.start||r.findUri.start,N=I.end||r.findUri.end,j=I.trim||r.findUri.trim,k=I.parens||r.findUri.parens,V=/[a-z0-9-]=["']?$/i;for(M.lastIndex=0;;){var F=M.exec(C);if(!F)break;var W=F.index;if(I.ignoreHtml){var q=C.slice(Math.max(W-3,0),W);if(q&&V.test(q))continue}for(var J=W+C.slice(W).search(N),H=C.slice(W,J),Z=-1;;){var K=k.exec(H);if(!K)break;var le=K.index+K[0].length;Z=Math.max(Z,le)}if(Z>-1?H=H.slice(0,Z)+H.slice(Z).replace(j,""):H=H.replace(j,""),!(H.length<=F[0].length)&&!(I.ignore&&I.ignore.test(H))){J=W+H.length;var me=v(H,W,J,C);if(me===void 0){M.lastIndex=J;continue}me=String(me),C=C.slice(0,W)+me+C.slice(J),M.lastIndex=W+me.length}}return M.lastIndex=0,C},r.ensureValidHostname=function(C,v){var I=!!C,M=!!v,N=!1;if(M&&(N=g(r.hostProtocols,v)),N&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+v);if(C&&C.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(C).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(C){if(C){var v=Number(C);if(!(a(v)&&v>0&&v<65536))throw new TypeError('Port "'+C+'" is not a valid port')}},r.noConflict=function(C){if(C){var v={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(v.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(v.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(v.SecondLevelDomains=i.SecondLevelDomains.noConflict()),v}else i.URI===this&&(i.URI=o);return this},s.build=function(C){return C===!0?this._deferred_build=!0:(C===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new r(this)},s.valueOf=s.toString=function(){return this.build(!1)._string};function w(C){return function(v,I){return v===void 0?this._parts[C]||"":(this._parts[C]=v||null,this.build(!I),this)}}function P(C,v){return function(I,M){return I===void 0?this._parts[C]||"":(I!==null&&(I=I+"",I.charAt(0)===v&&(I=I.substring(1))),this._parts[C]=I,this.build(!M),this)}}s.protocol=w("protocol"),s.username=w("username"),s.password=w("password"),s.hostname=w("hostname"),s.port=w("port"),s.query=P("query","?"),s.fragment=P("fragment","#"),s.search=function(C,v){var I=this.query(C,v);return typeof I=="string"&&I.length?"?"+I:I},s.hash=function(C,v){var I=this.fragment(C,v);return typeof I=="string"&&I.length?"#"+I:I},s.pathname=function(C,v){if(C===void 0||C===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return C?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=C?r.recodeUrnPath(C):"":this._parts.path=C?r.recodePath(C):"/",this.build(!v),this},s.path=s.pathname,s.href=function(C,v){var I;if(C===void 0)return this.toString();this._string="",this._parts=r._parts();var M=C instanceof r,N=typeof C=="object"&&(C.hostname||C.path||C.pathname);if(C.nodeName){var j=r.getDomAttribute(C);C=C[j]||"",N=!1}if(!M&&N&&C.pathname!==void 0&&(C=C.toString()),typeof C=="string"||C instanceof String)this._parts=r.parse(String(C),this._parts);else if(M||N){var k=M?C._parts:C;for(I in k)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=k[I]);k.query&&this.query(k.query,!1)}else throw new TypeError("invalid input");return this.build(!v),this},s.is=function(C){var v=!1,I=!1,M=!1,N=!1,j=!1,k=!1,V=!1,F=!this._parts.urn;switch(this._parts.hostname&&(F=!1,I=r.ip4_expression.test(this._parts.hostname),M=r.ip6_expression.test(this._parts.hostname),v=I||M,N=!v,j=N&&n&&n.has(this._parts.hostname),k=N&&r.idn_expression.test(this._parts.hostname),V=N&&r.punycode_expression.test(this._parts.hostname)),C.toLowerCase()){case"relative":return F;case"absolute":return!F;case"domain":case"name":return N;case"sld":return j;case"ip":return v;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return M;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return V}return null};var O=s.protocol,B=s.port,L=s.hostname;s.protocol=function(C,v){if(C&&(C=C.replace(/:(\/\/)?$/,""),!C.match(r.protocol_expression)))throw new TypeError('Protocol "'+C+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return O.call(this,C,v)},s.scheme=s.protocol,s.port=function(C,v){return this._parts.urn?C===void 0?"":this:(C!==void 0&&(C===0&&(C=null),C&&(C+="",C.charAt(0)===":"&&(C=C.substring(1)),r.ensureValidPort(C))),B.call(this,C,v))},s.hostname=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(C!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},M=r.parseHost(C,I);if(M!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');C=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(C,this._parts.protocol)}return L.call(this,C,v)},s.origin=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var I=this.protocol(),M=this.authority();return M?(I?I+"://":"")+this.authority():""}else{var N=r(C);return this.protocol(N.protocol()).authority(N.authority()).build(!v),this}},s.host=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(C,this._parts);if(I!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},s.authority=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(C,this._parts);if(I!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},s.userinfo=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return C[C.length-1]!=="@"&&(C+="@"),r.parseUserinfo(C,this._parts),this.build(!v),this},s.resource=function(C,v){var I;return C===void 0?this.path()+this.search()+this.hash():(I=r.parse(C),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!v),this)},s.subdomain=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var M=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,M),j=new RegExp("^"+u(N));if(C&&C.charAt(C.length-1)!=="."&&(C+="."),C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return C&&r.ensureValidHostname(C,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(j,C),this.build(!v),this}},s.domain=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(v=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(v).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!C)throw new TypeError("cannot set domain empty");if(C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(C,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=C;else{var N=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,C)}return this.build(!v),this}},s.tld=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(v=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(I+1);return v!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var N;if(C)if(C.match(/[^a-zA-Z0-9-]/))if(n&&n.is(C))N=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,C);else throw new TypeError('TLD "'+C+'" 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(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,C)}else throw new TypeError("cannot set TLD empty");return this.build(!v),this}},s.directory=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return C?r.decodePath(M):M}else{var N=this._parts.path.length-this.filename().length,j=this._parts.path.substring(0,N),k=new RegExp("^"+u(j));return this.is("relative")||(C||(C="/"),C.charAt(0)!=="/"&&(C="/"+C)),C&&C.charAt(C.length-1)!=="/"&&(C+="/"),C=r.recodePath(C),this._parts.path=this._parts.path.replace(k,C),this.build(!v),this}},s.filename=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(typeof C!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(I+1);return C?r.decodePathSegment(M):M}else{var N=!1;C.charAt(0)==="/"&&(C=C.substring(1)),C.match(/\.?\//)&&(N=!0);var j=new RegExp(u(this.filename())+"$");return C=r.recodePath(C),this._parts.path=this._parts.path.replace(j,C),N?this.normalizePath(v):this.build(!v),this}},s.suffix=function(C,v){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),M=I.lastIndexOf("."),N,j;return M===-1?"":(N=I.substring(M+1),j=/^[a-z0-9%]+$/i.test(N)?N:"",C?r.decodePathSegment(j):j)}else{C.charAt(0)==="."&&(C=C.substring(1));var k=this.suffix(),V;if(k)C?V=new RegExp(u(k)+"$"):V=new RegExp(u("."+k)+"$");else{if(!C)return this;this._parts.path+="."+r.recodePath(C)}return V&&(C=r.recodePath(C),this._parts.path=this._parts.path.replace(V,C)),this.build(!v),this}},s.segment=function(C,v,I){var M=this._parts.urn?":":"/",N=this.path(),j=N.substring(0,1)==="/",k=N.split(M);if(C!==void 0&&typeof C!="number"&&(I=v,v=C,C=void 0),C!==void 0&&typeof C!="number")throw new Error('Bad segment "'+C+'", must be 0-based integer');if(j&&k.shift(),C<0&&(C=Math.max(k.length+C,0)),v===void 0)return C===void 0?k:k[C];if(C===null||k[C]===void 0)if(d(v)){k=[];for(var V=0,F=v.length;V<F;V++)!v[V].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(A(v[V])))}else(v||typeof v=="string")&&(v=A(v),k[k.length-1]===""?k[k.length-1]=v:k.push(v));else v?k[C]=A(v):k.splice(C,1);return j&&k.unshift(""),this.path(k.join(M),I)},s.segmentCoded=function(C,v,I){var M,N,j;if(typeof C!="number"&&(I=v,v=C,C=void 0),v===void 0){if(M=this.segment(C,v,I),!d(M))M=M!==void 0?r.decode(M):void 0;else for(N=0,j=M.length;N<j;N++)M[N]=r.decode(M[N]);return M}if(!d(v))v=typeof v=="string"||v instanceof String?r.encode(v):v;else for(N=0,j=v.length;N<j;N++)v[N]=r.encode(v[N]);return this.segment(C,v,I)};var _=s.query;return s.query=function(C,v){if(C===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),M=C.call(this,I);return this._parts.query=r.buildQuery(M||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this}else return C!==void 0&&typeof C!="string"?(this._parts.query=r.buildQuery(C,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this):_.call(this,C,v)},s.setQuery=function(C,v,I){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="string"||C instanceof String)M[C]=v!==void 0?v:null;else if(typeof C=="object")for(var N in C)c.call(C,N)&&(M[N]=C[N]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(I=v),this.build(!I),this},s.addQuery=function(C,v,I){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(M,C,v===void 0?null:v),this._parts.query=r.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(I=v),this.build(!I),this},s.removeQuery=function(C,v,I){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(M,C,v),this._parts.query=r.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(I=v),this.build(!I),this},s.hasQuery=function(C,v,I){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(M,C,v,I)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.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()},s.normalizeProtocol=function(C){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!C)),this},s.normalizeHostname=function(C){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(!C)),this},s.normalizePort=function(C){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!C)),this},s.normalizePath=function(C){var v=this._parts.path;if(!v)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!C),this;if(this._parts.path==="/")return this;v=r.recodePath(v);var I,M="",N,j;for(v.charAt(0)!=="/"&&(I=!0,v="/"+v),(v.slice(-3)==="/.."||v.slice(-2)==="/.")&&(v+="/"),v=v.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(M=v.substring(1).match(/^(\.\.\/)+/)||"",M&&(M=M[0]));N=v.search(/\/\.\.(\/|$)/),N!==-1;){if(N===0){v=v.substring(3);continue}j=v.substring(0,N).lastIndexOf("/"),j===-1&&(j=N),v=v.substring(0,j)+v.substring(N+3)}return I&&this.is("relative")&&(v=M+v.substring(1)),this._parts.path=v,this.build(!C),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(C){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(!C)),this},s.normalizeFragment=function(C){return this._parts.fragment||(this._parts.fragment=null,this.build(!C)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var C=r.encode,v=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=C,r.decode=v}return this},s.unicode=function(){var C=r.encode,v=r.decode;r.encode=x,r.decode=unescape;try{this.normalize()}finally{r.encode=C,r.decode=v}return this},s.readable=function(){var C=this.clone();C.username("").password("").normalize();var v="";if(C._parts.protocol&&(v+=C._parts.protocol+"://"),C._parts.hostname&&(C.is("punycode")&&e?(v+=e.toUnicode(C._parts.hostname),C._parts.port&&(v+=":"+C._parts.port)):v+=C.host()),C._parts.hostname&&C._parts.path&&C._parts.path.charAt(0)!=="/"&&(v+="/"),v+=C.path(!0),C._parts.query){for(var I="",M=0,N=C._parts.query.split("&"),j=N.length;M<j;M++){var k=(N[M]||"").split("=");I+="&"+r.decodeQuery(k[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),k[1]!==void 0&&(I+="="+r.decodeQuery(k[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}v+="?"+I.substring(1)}return v+=r.decodeQuery(C.hash(),!0),v},s.absoluteTo=function(C){var v=this.clone(),I=["protocol","username","password","hostname","port"],M,N,j;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C instanceof r||(C=new r(C)),v._parts.protocol||(v._parts.protocol=C._parts.protocol,this._parts.hostname))return v;for(N=0;j=I[N];N++)v._parts[j]=C._parts[j];return v._parts.path?(v._parts.path.substring(-2)===".."&&(v._parts.path+="/"),v.path().charAt(0)!=="/"&&(M=C.directory(),M=M||(C.path().indexOf("/")===0?"/":""),v._parts.path=(M?M+"/":"")+v._parts.path,v.normalizePath())):(v._parts.path=C._parts.path,v._parts.query||(v._parts.query=C._parts.query)),v.build(),v},s.relativeTo=function(C){var v=this.clone().normalize(),I,M,N,j,k;if(v._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C=new r(C).normalize(),I=v._parts,M=C._parts,j=v.path(),k=C.path(),j.charAt(0)!=="/")throw new Error("URI is already relative");if(k.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===M.protocol&&(I.protocol=null),I.username!==M.username||I.password!==M.password||I.protocol!==null||I.username!==null||I.password!==null)return v.build();if(I.hostname===M.hostname&&I.port===M.port)I.hostname=null,I.port=null;else return v.build();if(j===k)return I.path="",v.build();if(N=r.commonPath(j,k),!N)return v.build();var V=M.path.substring(N.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=V+I.path.substring(N.length)||"./",v.build()},s.equals=function(C){var v=this.clone(),I=new r(C),M={},N={},j={},k,V,F;if(v.normalize(),I.normalize(),v.toString()===I.toString())return!0;if(k=v.query(),V=I.query(),v.query(""),I.query(""),v.toString()!==I.toString()||k.length!==V.length)return!1;M=r.parseQuery(k,this._parts.escapeQuerySpace),N=r.parseQuery(V,this._parts.escapeQuerySpace);for(F in M)if(c.call(M,F)){if(d(M[F])){if(!m(M[F],N[F]))return!1}else if(M[F]!==N[F])return!1;j[F]=!0}for(F in N)if(c.call(N,F)&&!j[F])return!1;return!0},s.preventInvalidHostname=function(C){return this._parts.preventInvalidHostname=!!C,this},s.duplicateQueryParameters=function(C){return this._parts.duplicateQueryParameters=!!C,this},s.escapeQuerySpace=function(C){return this._parts.escapeQuerySpace=!!C,this},r})});var Dpe=$d((zjn,Ipe)=>{"use strict";Ipe.exports=Stt;var UD=1e20;function Stt(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,a,s,c,u,f,d,p,g,m,A;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,a=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/a)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),r=p.width,a=p.height,g=d.getImageData(0,0,r,a),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,r=p.width,a=p.height,g=d.getImageData(0,0,r,a),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,a=e.height,c=g.data,f=4);if(s=Math.max(r,a),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*a),m=0,A=Math.floor(u.length/f);m<A;m++)c[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var y=Array(r*a),x=Array(r*a),b=Array(s),T=Array(s),E=Array(s+1),S=Array(s);for(m=0,A=r*a;m<A;m++){var w=c[m];y[m]=w===1?0:w===0?UD:Math.pow(Math.max(0,.5-w),2),x[m]=w===1?UD:w===0?0:Math.pow(Math.max(0,w-.5),2)}Spe(y,r,a,b,T,S,E),Spe(x,r,a,b,T,S,E);var P=window.Float32Array?new Float32Array(r*a):new Array(r*a);for(m=0,A=r*a;m<A;m++)P[m]=Math.min(Math.max(1-((y[m]-x[m])/i+n),0),1);return P}function Spe(e,t,n,i,o,r,a){for(var s=0;s<t;s++){for(var c=0;c<n;c++)i[c]=e[c*t+s];for(wpe(i,o,r,a,n),c=0;c<n;c++)e[c*t+s]=o[c]}for(c=0;c<n;c++){for(s=0;s<t;s++)i[s]=e[c*t+s];for(wpe(i,o,r,a,t),s=0;s<t;s++)e[c*t+s]=Math.sqrt(o[s])}}function wpe(e,t,n,i,o){n[0]=0,i[0]=-UD,i[1]=+UD;for(var r=1,a=0;r<o;r++){for(var s=(e[r]+r*r-(e[n[a]]+n[a]*n[a]))/(2*r-2*n[a]);s<=i[a];)a--,s=(e[r]+r*r-(e[n[a]]+n[a]*n[a]))/(2*r-2*n[a]);a++,n[a]=r,i[a]=s,i[a+1]=+UD}for(r=0,a=0;r<o;r++){for(;i[a+1]<r;)a++;t[r]=(r-n[a])*(r-n[a])+e[n[a]]}}});var Lpe=$d((nGn,Lz)=>{function Ntt(){var e=0,t=1,n=2,i=3,o=4,r=5,a=6,s=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,A=15,y=16,x=17,b=0,T=1,E=2,S=3,w=4;function P(_,C){return 55296<=_.charCodeAt(C)&&_.charCodeAt(C)<=56319&&56320<=_.charCodeAt(C+1)&&_.charCodeAt(C+1)<=57343}function O(_,C){C===void 0&&(C=0);var v=_.charCodeAt(C);if(55296<=v&&v<=56319&&C<_.length-1){var I=v,M=_.charCodeAt(C+1);return 56320<=M&&M<=57343?(I-55296)*1024+(M-56320)+65536:I}if(56320<=v&&v<=57343&&C>=1){var I=_.charCodeAt(C-1),M=v;return 55296<=I&&I<=56319?(I-55296)*1024+(M-56320)+65536:M}return v}function B(_,C,v){var I=[_].concat(C).concat([v]),M=I[I.length-2],N=v,j=I.lastIndexOf(m);if(j>1&&I.slice(1,j).every(function(F){return F==i})&&[i,g,x].indexOf(_)==-1)return E;var k=I.lastIndexOf(o);if(k>0&&I.slice(1,k).every(function(F){return F==o})&&[p,o].indexOf(M)==-1)return I.filter(function(F){return F==o}).length%2==1?S:w;if(M==e&&N==t)return b;if(M==n||M==e||M==t)return N==m&&C.every(function(F){return F==i})?E:T;if(N==n||N==e||N==t)return T;if(M==a&&(N==a||N==s||N==u||N==f))return b;if((M==u||M==s)&&(N==s||N==c))return b;if((M==f||M==c)&&N==c)return b;if(N==i||N==A)return b;if(N==r)return b;if(M==p)return b;var V=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,x].indexOf(I[V])!=-1&&I.slice(V+1,-1).every(function(F){return F==i})&&N==m||M==A&&[y,x].indexOf(N)!=-1?b:C.indexOf(o)!=-1?E:M==o&&N==o?b:T}this.nextBreak=function(_,C){if(C===void 0&&(C=0),C<0)return 0;if(C>=_.length-1)return _.length;for(var v=L(O(_,C)),I=[],M=C+1;M<_.length;M++)if(!P(_,M-1)){var N=L(O(_,M));if(B(v,I,N))return M;I.push(N)}return _.length},this.splitGraphemes=function(_){for(var C=[],v=0,I;(I=this.nextBreak(_,v))<_.length;)C.push(_.slice(v,I)),v=I;return v<_.length&&C.push(_.slice(v)),C},this.iterateGraphemes=function(_){var C=0,v={next:(function(){var I,M;return(M=this.nextBreak(_,C))<_.length?(I=_.slice(C,M),C=M,{value:I,done:!1}):C<_.length?(I=_.slice(C),C=_.length,{value:I,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(v[Symbol.iterator]=function(){return v}),v},this.countGraphemes=function(_){for(var C=0,v=0,I;(I=this.nextBreak(_,v))<_.length;)v=I,C++;return v<_.length&&C++,C};function L(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?o:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?r:4352<=_&&_<=4447||43360<=_&&_<=43388?a:4448<=_&&_<=4519||55216<=_&&_<=55238?s:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?A:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?y:128102<=_&&_<=128105?x:d}return this}typeof Lz<"u"&&Lz.exports&&(Lz.exports=Ntt)});var Cne=$d((s$i,eO)=>{/*!
  61. * protobuf.js v8.5.0 (c) 2016, daniel wirtz
  62. * compiled fri, 29 may 2026 22:57:25 utc
  63. * licensed under the bsd-3-clause license
  64. * see: https://github.com/dcodeio/protobuf.js for details
  65. */(function(e){"use strict";(function(n,i,o){function r(s){var c=i[s];return c||n[s][0].call(c=i[s]={exports:{}},r,c,c.exports),c.exports}var a=r(o[0]);a.util.global.protobuf=a,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(a.util.Long=s,a.configure()),a}),typeof eO=="object"&&eO&&eO.exports&&(eO.exports=a)})({1:[function(t,n,i){"use strict";var o=i;o.build="minimal",o.Writer=t(16),o.BufferWriter=t(17),o.Reader=t(2),o.BufferReader=t(3),o.util=t(13),o.rpc=t(5),o.roots=t(4),o.configure=r;function r(){o.util._configure(),o.Writer._configure(o.BufferWriter),o.Reader._configure(o.BufferReader)}r()},{13:13,16:16,17:17,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=u;var o=t(13),r,a=o.LongBits,s=o.utf8;function c(A,y){return RangeError("index out of range: "+A.pos+" + "+(y||1)+" > "+A.len)}function u(A){this.buf=A,this.pos=0,this.len=A.length,this.discardUnknown=u.discardUnknown}var f=typeof Uint8Array<"u"?function(y){if(y instanceof Uint8Array||Array.isArray(y))return new u(y);throw Error("illegal buffer")}:function(y){if(Array.isArray(y))return new u(y);throw Error("illegal buffer")},d=function(){return o.Buffer?function(x){return(u.create=function(T){return o.Buffer.isBuffer(T)?new r(T):f(T)})(x)}:f};u.create=d(),u.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,u.prototype.raw=function(y,x){return Array.isArray(this.buf)?this.buf.slice(y,x):y===x?new this.buf.constructor(0):this._slice.call(this.buf,y,x)},u.prototype.uint32=function(){var y=this.buf,x=this.pos,b=(y[x]&127)>>>0;if(y[x++]<128)return this.pos=x,b;if(b=(b|(y[x]&127)<<7)>>>0,y[x++]<128)return this.pos=x,b;if(b=(b|(y[x]&127)<<14)>>>0,y[x++]<128)return this.pos=x,b;if(b=(b|(y[x]&127)<<21)>>>0,y[x++]<128)return this.pos=x,b;if(b=(b|(y[x]&15)<<28)>>>0,y[x++]<128)return this.pos=x,b;for(var T=0;T<5;++T){if(x>=this.len)throw this.pos=x,c(this);if(y[x++]<128)return this.pos=x,b}throw this.pos=x,Error("invalid varint encoding")},u.prototype.tag=function(){var y=this.buf,x=this.pos,b=(y[x]&127)>>>0;if(y[x++]<128)return this.pos=x,b;if(b=(b|(y[x]&127)<<7)>>>0,y[x++]<128)return this.pos=x,b;if(b=(b|(y[x]&127)<<14)>>>0,y[x++]<128)return this.pos=x,b;if(b=(b|(y[x]&127)<<21)>>>0,y[x++]<128)return this.pos=x,b;if(b=(b|(y[x]&15)<<28)>>>0,y[x]<128&&(y[x]&112)===0)return this.pos=x+1,b;throw this.pos=x+1,Error("invalid tag encoding")},u.prototype.int32=function(){return this.uint32()|0},u.prototype.sint32=function(){var y=this.uint32();return y>>>1^-(y&1)|0};function p(){var A=new a(0,0),y=0;if(this.len-this.pos>4){for(;y<4;++y)if(A.lo=(A.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return A;if(A.lo=(A.lo|(this.buf[this.pos]&127)<<28)>>>0,A.hi=(A.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return A;y=0}else{for(;y<3;++y){if(this.pos>=this.len)throw c(this);if(A.lo=(A.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return A}return A.lo=(A.lo|(this.buf[this.pos++]&127)<<y*7)>>>0,A}if(this.len-this.pos>4){for(;y<5;++y)if(A.hi=(A.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return A}else for(;y<5;++y){if(this.pos>=this.len)throw c(this);if(A.hi=(A.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return A}throw Error("invalid varint encoding")}u.prototype.bool=function(){for(var y=!1,x,b=0;b<10;++b){if(this.pos>=this.len)throw c(this);if(x=this.buf[this.pos++],x&127&&(y=!0),x<128)return y}throw Error("invalid varint encoding")};function g(A,y){return(A[y-4]|A[y-3]<<8|A[y-2]<<16|A[y-1]<<24)>>>0}u.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return g(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return g(this.buf,this.pos+=4)|0};function m(){if(this.pos+8>this.len)throw c(this,8);return new a(g(this.buf,this.pos+=4),g(this.buf,this.pos+=4))}u.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var y=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,y},u.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var y=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,y},u.prototype.bytes=function(){var y=this.uint32(),x=this.pos,b=this.pos+y;if(b>this.len)throw c(this,y);return this.pos=b,this.raw(x,b)},u.prototype.string=function(){var y=this.uint32(),x=this.pos,b=this.pos+y;if(b>this.len)throw c(this,y);return this.pos=b,s.read(this.buf,x,b)},u.prototype.skip=function(y){if(typeof y=="number"){if(this.pos+y>this.len)throw c(this,y);this.pos+=y}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},u.recursionLimit=o.recursionLimit,u.discardUnknown=!1,u.prototype.skipType=function(A,y,x){if(y===e&&(y=0),y>u.recursionLimit)throw Error("max depth exceeded");if(x===0)throw Error("illegal tag: field number 0");switch(A){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var b=this.tag(),T=b>>>3;if(A=b&7,!T)throw Error("illegal tag: field number 0");if(A===4){if(x!==e&&T!==x)throw Error("invalid end group tag");break}this.skipType(A,y+1,T)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+A+" at offset "+this.pos)}return this},u._configure=function(A){r=A,u.create=d(),r._configure();var y=o.Long?"toLong":"toNumber";o.merge(u.prototype,{int64:function(){return p.call(this)[y](!1)},uint64:function(){return p.call(this)[y](!0)},sint64:function(){return p.call(this).zzDecode()[y](!1)},fixed64:function(){return m.call(this)[y](!0)},sfixed64:function(){return m.call(this)[y](!1)}})}},{13:13}],3:[function(t,n,i){"use strict";n.exports=a;var o=t(2);(a.prototype=Object.create(o.prototype)).constructor=a;var r=t(13);function a(s){o.call(this,s)}a._configure=function(){r.Buffer&&(a.prototype._slice=r.Buffer.prototype.slice)},a.prototype.raw=function(c,u){return c===u?r.Buffer.alloc(0):this._slice.call(this.buf,c,u)},a.prototype.string=function(){var c=this.uint32(),u=this.pos,f=this.pos+c;if(f>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=f,this.buf.utf8Slice?this.buf.utf8Slice(u,f):this.buf.toString("utf-8",u,f)},a._configure()},{13:13,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var o=i;o.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=r;var o=t(13);(r.prototype=Object.create(o.EventEmitter.prototype)).constructor=r;function r(a,s,c){if(typeof a!="function")throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=a,this.requestDelimited=!!s,this.responseDelimited=!!c}r.prototype.rpcCall=function a(s,c,u,f,d){if(!f)throw TypeError("request must be specified");var p=this;if(!d)return o.asPromise(a,p,s,c,u,f);if(!p.rpcImpl)return setTimeout(function(){d(Error("already ended"))},0),e;try{return p.rpcImpl(s,c[p.requestDelimited?"encodeDelimited":"encode"](f).finish(),function(m,A){if(m)return p.emit("error",m,s),d(m);if(A===null)return p.end(!0),e;if(!(A instanceof u))try{A=u[p.responseDelimited?"decodeDelimited":"decode"](A)}catch(y){return p.emit("error",y,s),d(y)}return p.emit("data",A,s),d(null,A)})}catch(g){return p.emit("error",g,s),setTimeout(function(){d(g)},0),e}},r.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{13:13}],7:[function(t,n,i){"use strict";n.exports=o;function o(r,a){for(var s=new Array(arguments.length-1),c=0,u=2,f=!0;u<arguments.length;)s[c++]=arguments[u++];return new Promise(function(p,g){s[c]=function(A){if(f)if(f=!1,A)g(A);else{for(var y=new Array(arguments.length-1),x=0;x<y.length;)y[x++]=arguments[x];p.apply(null,y)}};try{r.apply(a||null,s)}catch(m){f&&(f=!1,g(m))}})}},{}],8:[function(t,n,i){"use strict";var o=i;o.length=function(g){var m=g.length;if(!m)return 0;for(;m>0&&g.charAt(m-1)==="=";)--m;return Math.floor(m*3/4)};for(var r=new Array(64),a=new Array(123),s=0;s<64;)a[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;a[45]=62,a[95]=63,o.encode=function(g,m,A){for(var y=null,x=[],b=0,T=0,E;m<A;){var S=g[m++];switch(T){case 0:x[b++]=r[S>>2],E=(S&3)<<4,T=1;break;case 1:x[b++]=r[E|S>>4],E=(S&15)<<2,T=2;break;case 2:x[b++]=r[E|S>>6],x[b++]=r[S&63],T=0;break}b>8191&&((y||(y=[])).push(String.fromCharCode.apply(String,x)),b=0)}return T&&(x[b++]=r[E],x[b++]=61,T===1&&(x[b++]=61)),y?(b&&y.push(String.fromCharCode.apply(String,x.slice(0,b))),y.join("")):String.fromCharCode.apply(String,x.slice(0,b))};var c="invalid encoding";o.decode=function(g,m,A){for(var y=A,x=0,b,T=0;T<g.length;){var E=g.charCodeAt(T++);if(E===61&&x>1)break;if((E=a[E])===e)throw Error(c);switch(x){case 0:b=E,x=1;break;case 1:m[A++]=b<<2|(E&48)>>4,b=E,x=2;break;case 2:m[A++]=(b&15)<<4|(E&60)>>2,b=E,x=3;break;case 3:m[A++]=(b&3)<<6|E,x=0;break}}if(x===1)throw Error(c);return A-y};var u=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,f=/[-_]/,d=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;o.test=function(g){return u.test(g)||f.test(g)&&d.test(g)}},{}],9:[function(t,n,i){"use strict";n.exports=o;function o(){this._listeners=Object.create(null)}o.prototype.on=function(a,s,c){return(this._listeners[a]||(this._listeners[a]=[])).push({fn:s,ctx:c||this}),this},o.prototype.off=function(a,s){if(a===e)this._listeners=Object.create(null);else if(s===e)this._listeners[a]=[];else{var c=this._listeners[a];if(!c)return this;for(var u=0;u<c.length;)c[u].fn===s?c.splice(u,1):++u}return this},o.prototype.emit=function(a){var s=this._listeners[a];if(s){for(var c=[],u=1;u<arguments.length;)c.push(arguments[u++]);for(u=0;u<s.length;)s[u].fn.apply(s[u++].ctx,c)}return this}},{}],10:[function(t,n,i){"use strict";n.exports=o(o);function o(u){return typeof Float32Array<"u"?(function(){var f=new Float32Array([-0]),d=new Uint8Array(f.buffer),p=d[3]===128;function g(x,b,T){f[0]=x,b[T]=d[0],b[T+1]=d[1],b[T+2]=d[2],b[T+3]=d[3]}function m(x,b,T){f[0]=x,b[T]=d[3],b[T+1]=d[2],b[T+2]=d[1],b[T+3]=d[0]}u.writeFloatLE=p?g:m,u.writeFloatBE=p?m:g;function A(x,b){return d[0]=x[b],d[1]=x[b+1],d[2]=x[b+2],d[3]=x[b+3],f[0]}function y(x,b){return d[3]=x[b],d[2]=x[b+1],d[1]=x[b+2],d[0]=x[b+3],f[0]}u.readFloatLE=p?A:y,u.readFloatBE=p?y:A})():(function(){function f(p,g,m,A){var y=g<0?1:0;if(y&&(g=-g),g===0)p(1/g>0?0:2147483648,m,A);else if(isNaN(g))p(2143289344,m,A);else if(g>34028234663852886e22)p((y<<31|2139095040)>>>0,m,A);else if(g<11754943508222875e-54)p((y<<31|Math.round(g/1401298464324817e-60))>>>0,m,A);else{var x=Math.floor(Math.log(g)/Math.LN2),b=Math.round(g*Math.pow(2,-x)*8388608)&8388607;p((y<<31|x+127<<23|b)>>>0,m,A)}}u.writeFloatLE=f.bind(null,r),u.writeFloatBE=f.bind(null,a);function d(p,g,m){var A=p(g,m),y=(A>>31)*2+1,x=A>>>23&255,b=A&8388607;return x===255?b?NaN:y*(1/0):x===0?y*1401298464324817e-60*b:y*Math.pow(2,x-150)*(b+8388608)}u.readFloatLE=d.bind(null,s),u.readFloatBE=d.bind(null,c)})(),typeof Float64Array<"u"?(function(){var f=new Float64Array([-0]),d=new Uint8Array(f.buffer),p=d[7]===128;function g(x,b,T){f[0]=x,b[T]=d[0],b[T+1]=d[1],b[T+2]=d[2],b[T+3]=d[3],b[T+4]=d[4],b[T+5]=d[5],b[T+6]=d[6],b[T+7]=d[7]}function m(x,b,T){f[0]=x,b[T]=d[7],b[T+1]=d[6],b[T+2]=d[5],b[T+3]=d[4],b[T+4]=d[3],b[T+5]=d[2],b[T+6]=d[1],b[T+7]=d[0]}u.writeDoubleLE=p?g:m,u.writeDoubleBE=p?m:g;function A(x,b){return d[0]=x[b],d[1]=x[b+1],d[2]=x[b+2],d[3]=x[b+3],d[4]=x[b+4],d[5]=x[b+5],d[6]=x[b+6],d[7]=x[b+7],f[0]}function y(x,b){return d[7]=x[b],d[6]=x[b+1],d[5]=x[b+2],d[4]=x[b+3],d[3]=x[b+4],d[2]=x[b+5],d[1]=x[b+6],d[0]=x[b+7],f[0]}u.readDoubleLE=p?A:y,u.readDoubleBE=p?y:A})():(function(){function f(p,g,m,A,y,x){var b=A<0?1:0;if(b&&(A=-A),A===0)p(0,y,x+g),p(1/A>0?0:2147483648,y,x+m);else if(isNaN(A))p(0,y,x+g),p(2146959360,y,x+m);else if(A>17976931348623157e292)p(0,y,x+g),p((b<<31|2146435072)>>>0,y,x+m);else{var T;if(A<22250738585072014e-324)T=A/5e-324,p(T>>>0,y,x+g),p((b<<31|T/4294967296)>>>0,y,x+m);else{var E=Math.floor(Math.log(A)/Math.LN2);E===1024&&(E=1023),T=A*Math.pow(2,-E),p(T*4503599627370496>>>0,y,x+g),p((b<<31|E+1023<<20|T*1048576&1048575)>>>0,y,x+m)}}}u.writeDoubleLE=f.bind(null,r,0,4),u.writeDoubleBE=f.bind(null,a,4,0);function d(p,g,m,A,y){var x=p(A,y+g),b=p(A,y+m),T=(b>>31)*2+1,E=b>>>20&2047,S=4294967296*(b&1048575)+x;return E===2047?S?NaN:T*(1/0):E===0?T*5e-324*S:T*Math.pow(2,E-1075)*(S+4503599627370496)}u.readDoubleLE=d.bind(null,s,0,4),u.readDoubleBE=d.bind(null,c,4,0)})(),u}function r(u,f,d){f[d]=u&255,f[d+1]=u>>>8&255,f[d+2]=u>>>16&255,f[d+3]=u>>>24}function a(u,f,d){f[d]=u>>>24,f[d+1]=u>>>16&255,f[d+2]=u>>>8&255,f[d+3]=u&255}function s(u,f){return(u[f]|u[f+1]<<8|u[f+2]<<16|u[f+3]<<24)>>>0}function c(u,f){return(u[f]<<24|u[f+1]<<16|u[f+2]<<8|u[f+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=o;function o(r){try{if(typeof t!="function")return null;var a=t(r);return a&&(a.length||Object.keys(a).length)?a:null}catch{return null}}},{}],12:[function(t,n,i){"use strict";n.exports=r;var o=t(13);function r(u,f){this.lo=u>>>0,this.hi=f>>>0}var a=r.zero=new r(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var s=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(f){if(f===0)return a;var d=f<0;d&&(f=-f);var p=f>>>0,g=(f-p)/4294967296>>>0;return d&&(g=~g>>>0,p=~p>>>0,++p>4294967295&&(p=0,++g>4294967295&&(g=0))),new r(p,g)},r.from=function(f){if(typeof f=="number")return r.fromNumber(f);if(o.isString(f))if(o.Long)f=o.Long.fromString(f);else return r.fromNumber(parseInt(f,10));return f.low||f.high?new r(f.low>>>0,f.high>>>0):a},r.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var d=~this.lo+1>>>0,p=~this.hi>>>0;return d||(p=p+1>>>0),-(d+p*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(f){return o.Long?new o.Long(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;r.fromHash=function(f){return f===s?a:new r((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,7)<<24)>>>0)},r.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)},r.prototype.zzEncode=function(){var f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},r.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},r.prototype.length=function(){var f=this.lo,d=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?d===0?f<16384?f<128?1:2:f<2097152?3:4:d<16384?d<128?5:6:d<2097152?7:8:p<128?9:10}},{13:13}],13:[function(t,n,i){"use strict";var o=i;o.asPromise=t(7),o.base64=t(8),o.EventEmitter=t(9),o.float=t(10),o.inquire=t(11),o.utf8=t(15),o.pool=t(14),o.LongBits=t(12);function r(c){return c==="__proto__"||c==="prototype"||c==="constructor"}o.isUnsafeProperty=r,o.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),o.global=o.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},o.isString=function(u){return typeof u=="string"||u instanceof String},o.isObject=function(u){return u&&typeof u=="object"},o.isset=o.isSet=function(u,f){var d=u[f];return d!=null&&u.hasOwnProperty(f)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},o.Buffer=(function(){try{var c=o.global.Buffer;return c.prototype.utf8Write?c:null}catch{return null}})(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(u){return typeof u=="number"?o.Buffer?o._Buffer_allocUnsafe(u):new o.Array(u):o.Buffer?o._Buffer_from(u):typeof Uint8Array>"u"?u:new Uint8Array(u)},o.Array=typeof Uint8Array<"u"?Uint8Array:Array,o.Long=o.global.dcodeIO&&o.global.dcodeIO.Long||o.global.Long||(function(){try{var c=t("long");return c&&c.isLong?c:null}catch{return null}})(),o.key2Re=/^(?:true|false|0|1)$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(u){return u?o.LongBits.from(u).toHash():o.LongBits.zeroHash},o.longFromHash=function(u,f){var d=o.LongBits.fromHash(u);return o.Long?o.Long.fromBits(d.lo,d.hi,f):d.toNumber(!!f)},o.longFromKey=function(u,f){return o.key64Re.test(u)&&!o.key32Re.test(u)?o.longFromHash(u,f):u},o.boolFromKey=function(u){return u==="true"||u==="1"};function a(c){var u=typeof arguments[arguments.length-1]=="boolean",f=u?arguments.length-1:arguments.length;u=u&&arguments[arguments.length-1];for(var d=1;d<f;++d){var p=arguments[d];if(p)for(var g=Object.keys(p),m=0;m<g.length;++m)!r(g[m])&&(c[g[m]]===e||!u)&&(c[g[m]]=p[g[m]])}return c}o.merge=a,o.nestingLimit=32,o.recursionLimit=100,o.makeProp=function(u,f,d){Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{enumerable:d===e?!0:d,configurable:!0,writable:!0})},o.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function s(c){function u(f,d){if(!(this instanceof u))return new u(f,d);Object.defineProperty(this,"message",{get:function(){return f}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&a(this,d)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return c},set:e,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}o.newError=s,o.ProtocolError=s("ProtocolError"),o.oneOfGetter=function(u){for(var f={},d=0;d<u.length;++d)f[u[d]]=1;return function(){for(var p=Object.keys(this),g=p.length-1;g>-1;--g)if(f[p[g]]===1&&this[p[g]]!==e&&this[p[g]]!==null)return p[g]}},o.oneOfSetter=function(u){return function(f){for(var d=0;d<u.length;++d)u[d]!==f&&delete this[u[d]]}},o.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},o._configure=function(){var c=o.Buffer;if(!c){o._Buffer_from=o._Buffer_allocUnsafe=null;return}o._Buffer_from=c.from!==Uint8Array.from&&c.from||function(f,d){return new c(f,d)},o._Buffer_allocUnsafe=c.allocUnsafe||function(f){return new c(f)}}},{10:10,11:11,12:12,14:14,15:15,7:7,8:8,9:9,long:"long"}],14:[function(t,n,i){"use strict";n.exports=o;function o(r,a,s){var c=s||8192,u=c>>>1,f=null,d=c;return function(g){if(g<1||g>u)return r(g);d+g>c&&(f=r(c),d=0);var m=a.call(f,d,d+=g);return d&7&&(d=(d|7)+1),m}}},{}],15:[function(t,n,i){"use strict";var o=i,r="\uFFFD";o.length=function(c){for(var u=0,f=0,d=0;d<c.length;++d)f=c.charCodeAt(d),f<128?u+=1:f<2048?u+=2:(f&64512)===55296&&(c.charCodeAt(d+1)&64512)===56320?(++d,u+=4):u+=3;return u};function a(s,c,u,f){for(var d=c;d<u;){var p=s[d++];if(p<=127)f+=String.fromCharCode(p);else if(p>=192&&p<224){var g=(p&31)<<6|s[d++]&63;f+=g>=128?String.fromCharCode(g):r}else if(p>=224&&p<240){var m=(p&15)<<12|(s[d++]&63)<<6|s[d++]&63;f+=m>=2048?String.fromCharCode(m):r}else if(p>=240){var A=(p&7)<<18|(s[d++]&63)<<12|(s[d++]&63)<<6|s[d++]&63;A<65536||A>1114111?f+=r:(A-=65536,f+=String.fromCharCode(55296+(A>>10)),f+=String.fromCharCode(56320+(A&1023)))}}return f}o.read=function(c,u,f){if(f-u<1)return"";for(var d="",p=u,g,m,A,y,x,b,T,E;p+7<f;p+=8){if(g=c[p],m=c[p+1],A=c[p+2],y=c[p+3],x=c[p+4],b=c[p+5],T=c[p+6],E=c[p+7],(g|m|A|y|x|b|T|E)&128)return a(c,p,f,d);d+=String.fromCharCode(g,m,A,y,x,b,T,E)}for(;p<f;++p){if(g=c[p],g&128)return a(c,p,f,d);d+=String.fromCharCode(g)}return d},o.write=function(c,u,f){for(var d=f,p,g,m=0;m<c.length;++m)p=c.charCodeAt(m),p<128?u[f++]=p:p<2048?(u[f++]=p>>6|192,u[f++]=p&63|128):(p&64512)===55296&&((g=c.charCodeAt(m+1))&64512)===56320?(p=65536+((p&1023)<<10)+(g&1023),++m,u[f++]=p>>18|240,u[f++]=p>>12&63|128,u[f++]=p>>6&63|128,u[f++]=p&63|128):(u[f++]=p>>12|224,u[f++]=p>>6&63|128,u[f++]=p&63|128);return f-d}},{}],16:[function(t,n,i){"use strict";n.exports=p;var o=t(13),r,a=o.LongBits,s=o.base64,c=o.utf8;function u(S,w,P){this.fn=S,this.len=w,this.next=e,this.val=P}function f(){}function d(S){this.head=S.head,this.tail=S.tail,this.len=S.len,this.next=S.states}function p(){this.len=0,this.head=new u(f,0,0),this.tail=this.head,this.states=null}var g=function(){return o.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};p.create=g(),p.alloc=function(w){return new o.Array(w)},o.Array!==Array&&(p.alloc=o.pool(p.alloc,o.Array.prototype.subarray)),p.prototype._push=function(w,P,O){return this.tail=this.tail.next=new u(w,P,O),this.len+=P,this};function m(S,w,P){w[P]=S&255}function A(S,w,P){for(var O=0;O<S.length;)w[P++]=S.charCodeAt(O++)}function y(S,w,P){for(;S>127;)w[P++]=S&127|128,S>>>=7;w[P]=S}function x(S,w){this.len=S,this.next=e,this.val=w}x.prototype=Object.create(u.prototype),x.prototype.fn=y,p.prototype.uint32=function(w){return this.len+=(this.tail=this.tail.next=new x((w=w>>>0)<128?1:w<16384?2:w<2097152?3:w<268435456?4:5,w)).len,this},p.prototype.int32=function(w){return(w|=0)<0?this._push(b,10,a.fromNumber(w)):this.uint32(w)},p.prototype.sint32=function(w){return this.uint32((w<<1^w>>31)>>>0)};function b(S,w,P){for(var O=S.lo,B=S.hi;B;)w[P++]=O&127|128,O=(O>>>7|B<<25)>>>0,B>>>=7;for(;O>127;)w[P++]=O&127|128,O=O>>>7;w[P++]=O}p.prototype.uint64=function(w){var P=a.from(w);return this._push(b,P.length(),P)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(w){var P=a.from(w).zzEncode();return this._push(b,P.length(),P)},p.prototype.bool=function(w){return this._push(m,1,w?1:0)};function T(S,w,P){w[P]=S&255,w[P+1]=S>>>8&255,w[P+2]=S>>>16&255,w[P+3]=S>>>24}p.prototype.fixed32=function(w){return this._push(T,4,w>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(w){var P=a.from(w);return this._push(T,4,P.lo)._push(T,4,P.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(w){return this._push(o.float.writeFloatLE,4,w)},p.prototype.double=function(w){return this._push(o.float.writeDoubleLE,8,w)};var E=o.Array.prototype.set?function(w,P,O){P.set(w,O)}:function(w,P,O){for(var B=0;B<w.length;++B)P[O+B]=w[B]};p.prototype.bytes=function(w){var P=w.length>>>0;if(!P)return this._push(m,1,0);if(o.isString(w)){var O=p.alloc(P=s.length(w));s.decode(w,O,0),w=O}return this.uint32(P)._push(E,P,w)},p.prototype.raw=function(w){var P=w.length>>>0;return P?this._push(E,P,w):this},p.prototype.string=function(w){var P=c.length(w);return P?this.uint32(P)._push(P===w.length?A:c.write,P,w):this._push(m,1,0)},p.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new u(f,0,0),this.len=0,this},p.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 u(f,0,0),this.len=0),this},p.prototype.ldelim=function(){var w=this.head,P=this.tail,O=this.len;return this.reset().uint32(O),O&&(this.tail.next=w.next,this.tail=P,this.len+=O),this},p.prototype.finish=function(){return this.finishInto(this.constructor.alloc(this.len),0)},p.prototype.finishInto=function(w,P){P===e&&(P=0);for(var O=this.head.next,B=P;O;)O.fn(O.val,w,B),B+=O.len,O=O.next;return w},p._configure=function(S){r=S,p.create=g(),r._configure()}},{13:13}],17:[function(t,n,i){"use strict";n.exports=a;var o=t(16);(a.prototype=Object.create(o.prototype)).constructor=a;var r=t(13);function a(){o.call(this)}a._configure=function(){a.alloc=r._Buffer_allocUnsafe,a.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name==="set"?function(f,d,p){d.set(f,p)}:function(f,d,p){if(f.copy)f.copy(d,p,0,f.length);else for(var g=0;g<f.length;)d[p++]=f[g++]}},a.prototype.bytes=function(f){r.isString(f)&&(f=r._Buffer_from(f,"base64"));var d=f.length>>>0;return this.uint32(d),d&&this._push(a.writeBytesBuffer,d,f),this},a.prototype.raw=function(f){var d=f.length>>>0;return d?this._push(a.writeBytesBuffer,d,f):this};function s(u,f,d){for(var p=0;p<u.length;)f[d++]=u.charCodeAt(p++)}function c(u,f,d){u.length<40?r.utf8.write(u,f,d):f.utf8Write?f.utf8Write(u,d):f.write(u,d)}a.prototype.string=function(f){var d=r.Buffer.byteLength(f);return this.uint32(d),d&&this._push(d===f.length&&d<40?s:c,d,f),this},a._configure()},{13:13,16:16}]},{},[1])})()});var vPe=$d((fZi,LH)=>{/* 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(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:o.defaultNoDataValue,A=r(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),y={width:g.width,height:g.height,pixelData:A.resultPixels,minValue:A.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return A.resultMask&&(y.maskData=A.resultMask),d.returnEncodedMask&&g.mask&&(y.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(y.fileInfo=a(g),d.computeUsedBitDepths&&(y.fileInfo.bitDepths=s(g))),y};var r=function(f,d,p,g,m){var A=0,y=f.pixels.numBlocksX,x=f.pixels.numBlocksY,b=Math.floor(f.width/y),T=Math.floor(f.height/x),E=2*f.maxZError,S=Number.MAX_VALUE,w;p=p||(f.mask?f.mask.bitset:null);var P,O;P=new d(f.width*f.height),m&&p&&(O=new Uint8Array(f.width*f.height));for(var B=new Float32Array(b*T),L,_,C=0;C<=x;C++){var v=C!==x?T:f.height%x;if(v!==0)for(var I=0;I<=y;I++){var M=I!==y?b:f.width%y;if(M!==0){var N=C*f.width*T+I*b,j=f.width-M,k=f.pixels.blocks[A],V,F,W;k.encoding<2?(k.encoding===0?V=k.rawData:(u(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,E,B,f.pixels.maxValue),V=B),F=0):k.encoding===2?W=0:W=k.offset;var q;if(p)for(_=0;_<v;_++){for(N&7&&(q=p[N>>3],q<<=N&7),L=0;L<M;L++)N&7||(q=p[N>>3]),q&128?(O&&(O[N]=1),w=k.encoding<2?V[F++]:W,S=S>w?w:S,P[N++]=w):(O&&(O[N]=0),P[N++]=g),q<<=1;N+=j}else if(k.encoding<2)for(_=0;_<v;_++){for(L=0;L<M;L++)w=V[F++],S=S>w?w:S,P[N++]=w;N+=j}else for(S=S>W?W:S,_=0;_<v;_++){for(L=0;L<M;L++)P[N++]=W;N+=j}if(k.encoding===1&&F!==k.numValidPixels)throw"Block and Mask do not match";A++}}}return{resultPixels:P,resultMask:O,minValue:S}},a=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},s=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var A=new DataView(f,d,24);if(g.fileVersion=A.getInt32(0,!0),g.imageType=A.getInt32(4,!0),g.height=A.getUint32(8,!0),g.width=A.getUint32(12,!0),g.maxZError=A.getFloat64(16,!0),d+=24,!p)if(A=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=A.getUint32(0,!0),g.mask.numBlocksX=A.getUint32(4,!0),g.mask.numBytes=A.getUint32(8,!0),g.mask.maxValue=A.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var y=new Uint8Array(Math.ceil(g.width*g.height/8));A=new DataView(f,d,g.mask.numBytes);var x=A.getInt16(0,!0),b=2,T=0;do{if(x>0)for(;x--;)y[T++]=A.getUint8(b++);else{var E=A.getUint8(b++);for(x=-x;x--;)y[T++]=E}x=A.getInt16(b,!0),b+=2}while(b<g.mask.numBytes);if(x!==-32768||T<y.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=y,d+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));A=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=A.getUint32(0,!0),g.pixels.numBlocksX=A.getUint32(4,!0),g.pixels.numBytes=A.getUint32(8,!0),g.pixels.maxValue=A.getFloat32(12,!0),d+=16;var S=g.pixels.numBlocksX,w=g.pixels.numBlocksY,P=S+(g.width%S>0?1:0),O=w+(g.height%w>0?1:0);g.pixels.blocks=new Array(P*O);for(var B=0,L=0;L<O;L++)for(var _=0;_<P;_++){var C=0,v=f.byteLength-d;A=new DataView(f,d,Math.min(10,v));var I={};g.pixels.blocks[B++]=I;var M=A.getUint8(0);if(C++,I.encoding=M&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,I.offsetType=M,M===2)I.offset=A.getInt8(1),C++;else if(M===1)I.offset=A.getInt16(1,!0),C+=2;else if(M===0)I.offset=A.getFloat32(1,!0),C+=4;else throw"Invalid block offset type";if(I.encoding===1)if(M=A.getUint8(C),C++,I.bitsPerPixel=M&63,M>>=6,I.numValidPixelsType=M,M===2)I.numValidPixels=A.getUint8(C),C++;else if(M===1)I.numValidPixels=A.getUint16(C,!0),C+=2;else if(M===0)I.numValidPixels=A.getUint32(C,!0),C+=4;else throw"Invalid valid pixel count type"}if(d+=C,I.encoding!==3){var N,j;if(I.encoding===0){var k=(g.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";N=new ArrayBuffer(k*4),j=new Uint8Array(N),j.set(new Uint8Array(f,d,k*4));var V=new Float32Array(N);I.rawData=V,d+=k*4}else if(I.encoding===1){var F=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),W=Math.ceil(F/4);N=new ArrayBuffer(W*4),j=new Uint8Array(N),j.set(new Uint8Array(f,d,F)),I.stuffedData=new Uint32Array(N),d+=F}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,A,y){var x=(1<<d)-1,b=0,T,E=0,S,w,P=Math.ceil((y-g)/m),O=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*O,T=0;T<p;T++){if(E===0&&(w=f[b++],E=32),E>=d)S=w>>>E-d&x,E-=d;else{var B=d-E;S=(w&x)<<B&x,w=f[b++],E=32-B,S+=w>>>E}A[T]=S<P?g+S*m:y}return A};return o})(),t=(function(){"use strict";var o={unstuff:function(c,u,f,d,p,g,m,A){var y=(1<<f)-1,x=0,b,T=0,E,S,w,P,O=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*O,p)for(b=0;b<d;b++)T===0&&(S=c[x++],T=32),T>=f?(E=S>>>T-f&y,T-=f):(w=f-T,E=(S&y)<<w&y,S=c[x++],T=32-w,E+=S>>>T),u[b]=p[E];else for(P=Math.ceil((A-g)/m),b=0;b<d;b++)T===0&&(S=c[x++],T=32),T>=f?(E=S>>>T-f&y,T-=f):(w=f-T,E=(S&y)<<w&y,S=c[x++],T=32-w,E+=S>>>T),u[b]=E<P?g+E*m:A},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,A=0,y=0,x=0,b=0,T=0,E,S=[],w=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*w;var P=Math.ceil((g-d)/p);for(y=0;y<f;y++)b===0&&(E=c[A++],b=32),b>=u?(T=E>>>b-u&m,b-=u):(x=u-b,T=(E&m)<<x&m,E=c[A++],b=32-x,T+=E>>>b),S[y]=T<P?d+T*p:g;return S.unshift(d),S},unstuff2:function(c,u,f,d,p,g,m,A){var y=(1<<f)-1,x=0,b,T=0,E=0,S,w,P;if(p)for(b=0;b<d;b++)T===0&&(w=c[x++],T=32,E=0),T>=f?(S=w>>>E&y,T-=f,E+=f):(P=f-T,S=w>>>E&y,w=c[x++],T=32-P,S|=(w&(1<<P)-1)<<f-P,E=P),u[b]=p[S];else{var O=Math.ceil((A-g)/m);for(b=0;b<d;b++)T===0&&(w=c[x++],T=32,E=0),T>=f?(S=w>>>E&y,T-=f,E+=f):(P=f-T,S=w>>>E&y,w=c[x++],T=32-P,S|=(w&(1<<P)-1)<<f-P,E=P),u[b]=S<O?g+S*m:A}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,A=0,y=0,x=0,b=0,T=0,E=0,S,w=[],P=Math.ceil((g-d)/p);for(y=0;y<f;y++)b===0&&(S=c[A++],b=32,E=0),b>=u?(T=S>>>E&m,b-=u,E+=u):(x=u-b,T=S>>>E&m,S=c[A++],b=32-x,T|=(S&(1<<x)-1)<<u-x,E=x),w[y]=T<P?d+T*p:g;return w.unshift(d),w},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,A=0,y,x,b,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,m=0;m<d;m++)A===0&&(x=c[g++],A=32),A>=f?(y=x>>>A-f&p,A-=f):(b=f-A,y=(x&p)<<b&p,x=c[g++],A=32-b,y+=x>>>A),u[m]=y;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,A=0,y=0,x,b,T;for(m=0;m<d;m++)A===0&&(b=c[g++],A=32,y=0),A>=f?(x=b>>>y&p,A-=f,y+=f):(T=f-A,x=b>>>y&p,b=c[g++],A=32-T,x|=(b&(1<<T)-1)<<f-T,y=T),u[m]=x;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,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),f+=40,u.headerInfo=p,u.ptr=f;var A,y;if(m>=3&&(y=m>=4?52:48,A=this.computeChecksumFletcher32(new Uint8Array(c,f-y,p.blobSize-14)),A!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var A,y=!0;for(A=0;A<f.numDims;A++)if(g[A]!==m[A]){y=!1;break}return f.minValues=g,f.maxValues=m,y},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),A={};if(A.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&A.numBytes!==0)throw"invalid mask";var y,x;if(g===0)y=new Uint8Array(Math.ceil(p/8)),A.bitset=y,x=new Uint8Array(p),u.pixels.resultMask=x,f+=A.numBytes;else if(A.numBytes>0){y=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,A.numBytes);var b=m.getInt16(0,!0),T=2,E=0,S=0;do{if(b>0)for(;b--;)y[E++]=m.getUint8(T++);else for(S=m.getUint8(T++),b=-b;b--;)y[E++]=S;b=m.getInt16(T,!0),T+=2}while(T<A.numBytes);if(b!==-32768||E<y.length)throw"Unexpected end of mask RLE encoding";x=new Uint8Array(p);var w=0,P=0;for(P=0;P<p;P++)P&7?(w=y[P>>3],w<<=P&7):w=y[P>>3],w&128&&(x[P]=1);u.pixels.resultMask=x,A.bitset=y,f+=A.numBytes}return u.ptr=f,u.mask=A,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,A=p.imageType,y=p.numValidPixel*r.getDataTypeSize(A)*g,x,b=u.pixels.resultMask;if(f===Uint8Array)x=new Uint8Array(c,d,y);else{var T=new ArrayBuffer(y),E=new Uint8Array(T);E.set(new Uint8Array(c,d,y)),x=new f(T)}if(x.length===m*g)u.pixels.resultPixels=x;else{u.pixels.resultPixels=new f(m*g);var S=0,w=0,P=0,O=0;if(g>1)for(P=0;P<g;P++)for(O=P*m,w=0;w<m;w++)b[w]&&(u.pixels.resultPixels[O+w]=x[S++]);else for(w=0;w<m;w++)b[w]&&(u.pixels.resultPixels[w]=x[S++])}return d+=y,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),A=d.getInt32(12,!0);if(m>=A)return!1;var y=new Uint32Array(A-m);r.decodeBits(c,u,y);var x=[],b,T,E,S;for(b=m;b<A;b++)T=b-(b<g?0:g),x[T]={first:y[b-m],second:null};var w=c.byteLength-u.ptr,P=Math.ceil(w/4),O=new ArrayBuffer(P*4),B=new Uint8Array(O);B.set(new Uint8Array(c,u.ptr,w));var L=new Uint32Array(O),_=0,C,v=0;for(C=L[0],b=m;b<A;b++)T=b-(b<g?0:g),S=x[T].first,S>0&&(x[T].second=C<<_>>>32-S,32-_>=S?(_+=S,_===32&&(_=0,v++,C=L[v])):(_+=S-32,v++,C=L[v],x[T].second|=C>>>32-_));var I=0,M=0,N=new a;for(b=0;b<x.length;b++)x[b]!==void 0&&(I=Math.max(I,x[b].first));I>=f?M=f:M=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var j=[],k,V,F,W,q,J;for(b=m;b<A;b++)if(T=b-(b<g?0:g),S=x[T].first,S>0)if(k=[S,T],S<=M)for(V=x[T].second<<M-S,F=1<<M-S,E=0;E<F;E++)j[V|E]=k;else for(V=x[T].second,J=N,W=S-1;W>=0;W--)q=V>>>W&1,q?(J.right||(J.right=new a),J=J.right):(J.left||(J.left=new a),J=J.left),W===0&&!J.val&&(J.val=k[1]);return{decodeLut:j,numBitsLUTQick:M,numBitsLUT:I,tree:N,stuffedData:L,srcPtr:v,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,A=m*g,y=this.readHuffmanTree(c,u),x=y.decodeLut,b=y.tree,T=y.stuffedData,E=y.srcPtr,S=y.bitPos,w=y.numBitsLUTQick,P=y.numBitsLUT,O=u.headerInfo.imageType===0?128:0,B,L,_,C=u.pixels.resultMask,v,I,M,N,j,k,V,F=0;S>0&&(E++,S=0);var W=T[E],q=u.encodeMode===1,J=new f(A*p),H=J,Z;for(Z=0;Z<d.numDims;Z++){if(p>1&&(H=new f(J.buffer,A*Z,A),F=0),u.headerInfo.numValidPixel===m*g)for(k=0,N=0;N<g;N++)for(j=0;j<m;j++,k++){if(L=0,v=W<<S>>>32-w,I=v,32-S<w&&(v|=T[E+1]>>>64-S-w,I=v),x[I])L=x[I][1],S+=x[I][0];else for(v=W<<S>>>32-P,I=v,32-S<P&&(v|=T[E+1]>>>64-S-P,I=v),B=b,V=0;V<P;V++)if(M=v>>>P-V-1&1,B=M?B.right:B.left,!(B.left||B.right)){L=B.val,S=S+V+1;break}S>=32&&(S-=32,E++,W=T[E]),_=L-O,q?(j>0?_+=F:N>0?_+=H[k-m]:_+=F,_&=255,H[k]=_,F=_):H[k]=_}else for(k=0,N=0;N<g;N++)for(j=0;j<m;j++,k++)if(C[k]){if(L=0,v=W<<S>>>32-w,I=v,32-S<w&&(v|=T[E+1]>>>64-S-w,I=v),x[I])L=x[I][1],S+=x[I][0];else for(v=W<<S>>>32-P,I=v,32-S<P&&(v|=T[E+1]>>>64-S-P,I=v),B=b,V=0;V<P;V++)if(M=v>>>P-V-1&1,B=M?B.right:B.left,!(B.left||B.right)){L=B.val,S=S+V+1;break}S>=32&&(S-=32,E++,W=T[E]),_=L-O,q?(j>0&&C[k-1]?_+=F:N>0&&C[k-m]?_+=H[k-m]:_+=F,_&=255,H[k]=_,F=_):H[k]=_}u.ptr=u.ptr+(E+1)*4+(S>0?4:0)}u.pixels.resultPixels=J},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,A=0,y=new DataView(c,u.ptr,5),x=y.getUint8(0);A++;var b=x>>6,T=b===0?4:3-b,E=(x&32)>0,S=x&31,w=0;if(T===1)w=y.getUint8(A),A++;else if(T===2)w=y.getUint16(A,!0),A+=2;else if(T===4)w=y.getUint32(A,!0),A+=4;else throw"Invalid valid pixel count type";var P=2*g.maxZError,O,B,L,_,C,v,I,M,N,j,k=g.numDims>1?g.maxValues[p]:g.zMax;if(E){for(u.counter.lut++,M=y.getUint8(A),N=S,A++,_=Math.ceil((M-1)*S/8),C=Math.ceil(_/4),B=new ArrayBuffer(C*4),L=new Uint8Array(B),u.ptr+=A,L.set(new Uint8Array(c,u.ptr,_)),I=new Uint32Array(B),u.ptr+=_,j=0;M-1>>>j;)j++;_=Math.ceil(w*j/8),C=Math.ceil(_/4),B=new ArrayBuffer(C*4),L=new Uint8Array(B),L.set(new Uint8Array(c,u.ptr,_)),O=new Uint32Array(B),u.ptr+=_,m>=3?v=o.unstuffLUT2(I,S,M-1,d,P,k):v=o.unstuffLUT(I,S,M-1,d,P,k),m>=3?o.unstuff2(O,f,j,w,v):o.unstuff(O,f,j,w,v)}else u.counter.bitstuffer++,j=S,u.ptr+=A,j>0&&(_=Math.ceil(w*j/8),C=Math.ceil(_/4),B=new ArrayBuffer(C*4),L=new Uint8Array(B),L.set(new Uint8Array(c,u.ptr,_)),O=new Uint32Array(B),u.ptr+=_,m>=3?d==null?o.originalUnstuff2(O,f,j,w):o.unstuff2(O,f,j,w,!1,d,P,k):d==null?o.originalUnstuff(O,f,j,w):o.unstuff(O,f,j,w,!1,d,P,k))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,A=d.imageType,y=r.getDataTypeSize(A),x=Math.ceil(p/m),b=Math.ceil(g/m);u.pixels.numBlocksY=b,u.pixels.numBlocksX=x,u.pixels.ptr=0;var T=0,E=0,S=0,w=0,P=0,O=0,B=0,L=0,_=0,C=0,v=0,I=0,M=0,N=0,j=0,k=0,V,F,W,q,J,H,Z=new f(m*m),K=g%m||m,le=p%m||m,me,ae,be=d.numDims,ge,we=u.pixels.resultMask,Ee=u.pixels.resultPixels;for(S=0;S<b;S++)for(P=S!==b-1?m:K,w=0;w<x;w++)for(O=w!==x-1?m:le,v=S*p*m+w*m,I=p-O,ge=0;ge<be;ge++){if(be>1&&(Ee=new f(u.pixels.resultPixels.buffer,p*g*ge*y,p*g)),B=c.byteLength-u.ptr,V=new DataView(c,u.ptr,Math.min(10,B)),F={},k=0,L=V.getUint8(0),k++,_=L>>6&255,C=L>>2&15,C!==(w*m>>3&15))throw"integrity issue";if(H=L&3,H>3)throw u.ptr+=k,"Invalid block encoding ("+H+")";if(H===2){u.counter.constant++,u.ptr+=k;continue}else if(H===0){if(u.counter.uncompressed++,u.ptr+=k,M=P*O*y,N=c.byteLength-u.ptr,M=M<N?M:N,W=new ArrayBuffer(M%y===0?M:M+y-M%y),q=new Uint8Array(W),q.set(new Uint8Array(c,u.ptr,M)),J=new f(W),j=0,we)for(T=0;T<P;T++){for(E=0;E<O;E++)we[v]&&(Ee[v]=J[j++]),v++;v+=I}else for(T=0;T<P;T++){for(E=0;E<O;E++)Ee[v++]=J[j++];v+=I}u.ptr+=j*y}else if(me=r.getDataTypeUsed(A,_),ae=r.getOnePixel(F,k,me,V),k+=r.getDataTypeSize(me),H===3)if(u.ptr+=k,u.counter.constantoffset++,we)for(T=0;T<P;T++){for(E=0;E<O;E++)we[v]&&(Ee[v]=ae),v++;v+=I}else for(T=0;T<P;T++){for(E=0;E<O;E++)Ee[v++]=ae;v+=I}else if(u.ptr+=k,r.decodeBits(c,u,Z,ae,ge),k=0,we)for(T=0;T<P;T++){for(E=0;E<O;E++)we[v]&&(Ee[v]=Z[k++]),v++;v+=I}else for(T=0;T<P;T++){for(E=0;E<O;E++)Ee[v++]=Z[k++];v+=I}}},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 u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,A=0,y=c.pixels.resultMask;if(y)if(f>1)for(g=0;g<f;g++)for(A=g*d,m=0;m<d;m++)y[m]&&(c.pixels.resultPixels[A+m]=u);else for(m=0;m<d;m++)y[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},a=function(c,u,f){this.val=c,this.left=u,this.right=f},s={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,A=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var y=g.width*g.height;if(p.pixels.resultPixels=new A(y*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(m>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var x=new DataView(c,p.ptr,2),b=x.getUint8(0);if(p.ptr++,b)r.readDataOneSweep(c,p,A);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=x.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||m<4&&T>1)throw"Invalid Huffman flag "+T;T?r.readHuffman(c,p,A):r.readTiles(c,p,A)}else r.readTiles(c,p,A)}p.eofOffset=p.ptr;var E;u.inputOffset?(E=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(E)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(E=p.headerInfo.blobSize-p.ptr,Math.abs(E)>=1&&(p.eofOffset=p.headerInfo.blobSize));var S={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,f)){var w=p.pixels.resultMask;for(d=0;d<y;d++)w[d]||(S.pixelData[d]=f);S.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(S.fileInfo=r.formatFileInfo(p)),S}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return s})(),n=(function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),a=new Uint32Array(o);return a[0]=1,r[0]===1})(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var a=r.inputOffset||0,s=new Uint8Array(o,a,10),c=String.fromCharCode.apply(null,s),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=o.byteLength-10,g,m=[],A,y,x={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};a<p;){var b=u.decode(o,{inputOffset:a,encodedMaskData:g,maskData:y,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});a=b.fileInfo.eofOffset,d===0&&(g=b.encodedMaskData,y=b.maskData,x.width=b.width,x.height=b.height,x.dimCount=b.dimCount||1,x.pixelType=b.pixelType||b.fileInfo.pixelType,x.mask=b.maskData),f>1&&b.fileInfo.mask&&b.fileInfo.mask.numBytes>0&&m.push(b.maskData),d++,x.pixels.push(b.pixelData),x.statistics.push({minValue:b.minValue,maxValue:b.maxValue,noDataValue:b.noDataValue,dimStats:b.dimStats})}var T,E,S;if(f>1&&m.length>1){for(S=x.width*x.height,x.bandMasks=m,y=new Uint8Array(S),y.set(m[0]),T=1;T<m.length;T++)for(A=m[T],E=0;E<S;E++)y[E]=y[E]&A[E];x.maskData=y}return x}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof LH<"u"&&LH.exports?LH.exports=i:this.Lerc=i})()});var uOe=$d((xMo,lOe)=>{lOe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var dOe=$d((bMo,fOe)=>{var{webm:M2t,mp4:B2t}=uOe(),vie=()=>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,Sie=()=>"wakeLock"in navigator,wie=class{constructor(){if(this.enabled=!1,Sie()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else vie()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",M2t),this._addSourceToVideo(this.noSleepVideo,"mp4",B2t),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 Sie()?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}):vie()?(this.disable(),console.warn(`
  66. NoSleep enabled for older iOS devices. This can interrupt
  67. active or long-running network requests from completing successfully.
  68. See https://github.com/richtr/NoSleep.js/issues/15 for more details.
  69. `),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(){Sie()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):vie()?this.noSleepTimer&&(console.warn(`
  70. NoSleep now disabled for older iOS devices.
  71. `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};fOe.exports=wie});function BOe(e){return e!=null}var l=BOe;function Sy(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Sy.prototype=Object.create(Error.prototype),Sy.prototype.constructor=Sy);Sy.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
  72. ${this.stack.toString()}`),e};Sy.throwInstantiationError=function(){throw new Sy("This function defines an interface and should not be called directly.")};var _e=Sy;var Za={};Za.typeOf={};function LOe(e){return`${e} is required, actual value was undefined`}function bT(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Za.defined=function(e,t){if(!l(t))throw new _e(LOe(e))};Za.typeOf.func=function(e,t){if(typeof t!="function")throw new _e(bT(typeof t,"function",e))};Za.typeOf.string=function(e,t){if(typeof t!="string")throw new _e(bT(typeof t,"string",e))};Za.typeOf.number=function(e,t){if(typeof t!="number")throw new _e(bT(typeof t,"number",e))};Za.typeOf.number.lessThan=function(e,t,n){if(Za.typeOf.number(e,t),t>=n)throw new _e(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Za.typeOf.number.lessThanOrEquals=function(e,t,n){if(Za.typeOf.number(e,t),t>n)throw new _e(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Za.typeOf.number.greaterThan=function(e,t,n){if(Za.typeOf.number(e,t),t<=n)throw new _e(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Za.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Za.typeOf.number(e,t),t<n)throw new _e(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};Za.typeOf.object=function(e,t){if(typeof t!="object")throw new _e(bT(typeof t,"object",e))};Za.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new _e(bT(typeof t,"boolean",e))};Za.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new _e(bT(typeof t,"bigint",e))};Za.typeOf.number.equals=function(e,t,n,i){if(Za.typeOf.number(e,n),Za.typeOf.number(t,i),n!==i)throw new _e(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var No=Za;var D9=Na(PO(),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=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=t??255,Math.round((dt.clamp(e,-1,1)*.5+.5)*t)};dt.fromSNorm=function(e,t){return t=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=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};dt.cosh=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=n??0,i=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 RO=[1];dt.factorial=function(e){let t=RO.length;if(e>=t){let n=RO[t-1];for(let i=t;i<=e;i++){let o=n*i;RO.push(o),n=o}}return RO[e]};dt.incrementWrap=function(e,t,n){return n=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 Mie=new D9.default;dt.setRandomNumberSeed=function(e){Mie=new D9.default(e)};dt.nextRandomNumber=function(){return Mie.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=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};dt.log2=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 D=dt;var Jo=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,o=t.cone,r=t.magnitude??1,a=r*Math.sin(o);return n.x=a*Math.cos(i),n.y=a*Math.sin(i),n.z=r*Math.cos(o),n}static fromElements(t,n,i,o){return l(o)?(o.x=t,o.y=n,o.z=i,o):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,o=i*3;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=o/3;n[r]=e.unpack(t,o,n[r])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,o){let r=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y),s=D.clamp(t.z,n.z,i.z);return o.x=r,o.y=a,o.z=s,o}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,OO),e.magnitude(OO)}static distanceSquared(t,n){return e.subtract(t,n,OO),e.magnitudeSquared(OO)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,o){return e.multiplyByScalar(n,i,Bie),o=e.multiplyByScalar(t,1-i,o),e.add(Bie,o,o)}static angleBetween(t,n){e.normalize(t,MO),e.normalize(n,P9);let i=e.dot(MO,P9),o=e.magnitude(e.cross(MO,P9,MO));return Math.atan2(o,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,NOe);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let o=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,o,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,o){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,o)&&D.equalsEpsilon(t.y,n.y,i,o)&&D.equalsEpsilon(t.z,n.z,i,o)}static cross(t,n,i){let o=t.x,r=t.y,a=t.z,s=n.x,c=n.y,u=n.z,f=r*u-a*c,d=a*s-o*u,p=o*c-r*s;return i.x=f,i.y=d,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,o,r){return t=D.toRadians(t),n=D.toRadians(n),e.fromRadians(t,n,i,o,r)}static fromRadians(t,n,i,o,r){i=i??0;let a=l(o)?o.radiiSquared:e._ellipsoidRadiiSquared,s=Math.cos(n);Ff.x=s*Math.cos(t),Ff.y=s*Math.sin(t),Ff.z=Math.sin(n),Ff=e.normalize(Ff,Ff),e.multiplyComponents(a,Ff,TT);let c=Math.sqrt(e.dot(Ff,TT));return TT=e.divideByScalar(TT,c,TT),Ff=e.multiplyByScalar(Ff,i,Ff),l(r)||(r=new e),e.add(TT,Ff,r)}static fromDegreesArray(t,n,i){let o=t.length;l(i)?i.length=o/2:i=new Array(o/2);for(let r=0;r<o;r+=2){let a=t[r],s=t[r+1],c=r/2;i[c]=e.fromDegrees(a,s,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let o=t.length;l(i)?i.length=o/2:i=new Array(o/2);for(let r=0;r<o;r+=2){let a=t[r],s=t[r+1],c=r/2;i[c]=e.fromRadians(a,s,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let o=t.length;l(i)?i.length=o/3:i=new Array(o/3);for(let r=0;r<o;r+=3){let a=t[r],s=t[r+1],c=t[r+2],u=r/3;i[u]=e.fromDegrees(a,s,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let o=t.length;l(i)?i.length=o/3:i=new Array(o/3);for(let r=0;r<o;r+=3){let a=t[r],s=t[r+1],c=t[r+2],u=r/3;i[u]=e.fromRadians(a,s,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};Jo.fromCartesian4=Jo.clone;Jo.packedLength=3;Jo.fromArray=Jo.unpack;var OO=new Jo,Bie=new Jo,MO=new Jo,P9=new Jo,NOe=new Jo,Ff=new Jo,TT=new Jo;Jo._ellipsoidRadiiSquared=new Jo(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Jo.ZERO=Object.freeze(new Jo(0,0,0));Jo.ONE=Object.freeze(new Jo(1,1,1));Jo.UNIT_X=Object.freeze(new Jo(1,0,0));Jo.UNIT_Y=Object.freeze(new Jo(0,1,0));Jo.UNIT_Z=Object.freeze(new Jo(0,0,1));var h=Jo;var Fa=class e{constructor(t,n,i,o){this.x=t??0,this.y=n??0,this.z=i??0,this.w=o??0}static fromElements(t,n,i,o,r){return l(r)?(r.x=t,r.y=n,r.z=i,r.w=o,r):new e(t,n,i,o)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,o=i*4;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let o=0;o<i;o+=4){let r=o/4;n[r]=e.unpack(t,o,n[r])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,o){let r=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y),s=D.clamp(t.z,n.z,i.z),c=D.clamp(t.w,n.w,i.w);return o.x=r,o.y=a,o.z=s,o.w=c,o}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,BO),e.magnitude(BO)}static distanceSquared(t,n){return e.subtract(t,n,BO),e.magnitudeSquared(BO)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,o){return e.multiplyByScalar(n,i,Lie),o=e.multiplyByScalar(t,1-i,o),e.add(Lie,o,o)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,FOe);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,o){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,o)&&D.equalsEpsilon(t.y,n.y,i,o)&&D.equalsEpsilon(t.z,n.z,i,o)&&D.equalsEpsilon(t.w,n.w,i,o)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),R9[0]=t,Nie?(n.x=Bc[0],n.y=Bc[1],n.z=Bc[2],n.w=Bc[3]):(n.x=Bc[3],n.y=Bc[2],n.z=Bc[1],n.w=Bc[0]),n}static unpackFloat(t){return Nie?(Bc[0]=t.x,Bc[1]=t.y,Bc[2]=t.z,Bc[3]=t.w):(Bc[0]=t.w,Bc[1]=t.z,Bc[2]=t.y,Bc[3]=t.x),R9[0]}};Fa.packedLength=4;Fa.fromArray=Fa.unpack;var BO=new Fa,Lie=new Fa,FOe=new Fa;Fa.ZERO=Object.freeze(new Fa(0,0,0,0));Fa.ONE=Object.freeze(new Fa(1,1,1,1));Fa.UNIT_X=Object.freeze(new Fa(1,0,0,0));Fa.UNIT_Y=Object.freeze(new Fa(0,1,0,0));Fa.UNIT_Z=Object.freeze(new Fa(0,0,1,0));Fa.UNIT_W=Object.freeze(new Fa(0,0,0,1));var R9=new Float32Array(1),Bc=new Uint8Array(R9.buffer),kOe=new Uint32Array([287454020]),zOe=new Uint8Array(kOe.buffer),Nie=zOe[0]===68,se=Fa;var O9={};O9.EMPTY_OBJECT=Object.freeze({});O9.EMPTY_ARRAY=Object.freeze([]);var G=O9;var lo=class e{constructor(t,n,i,o,r,a,s,c,u){this[0]=t??0,this[1]=o??0,this[2]=s??0,this[3]=n??0,this[4]=r??0,this[5]=c??0,this[6]=i??0,this[7]=a??0,this[8]=u??0}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i}static packArray(t,n){let i=t.length,o=i*9;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*9);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/9:n=new Array(i/9);for(let o=0;o<i;o+=9){let r=o/9;n[r]=e.unpack(t,o,n[r])}return n}static clone(t,n){if(l(t))return l(n)?(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):new e(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}static fromQuaternion(t,n){let i=t.x*t.x,o=t.x*t.y,r=t.x*t.z,a=t.x*t.w,s=t.y*t.y,c=t.y*t.z,u=t.y*t.w,f=t.z*t.z,d=t.z*t.w,p=t.w*t.w,g=i-s-f+p,m=2*(o-d),A=2*(r+u),y=2*(o+d),x=-i+s-f+p,b=2*(c-a),T=2*(r-u),E=2*(c+a),S=-i-s+f+p;return l(n)?(n[0]=g,n[1]=y,n[2]=T,n[3]=m,n[4]=x,n[5]=E,n[6]=A,n[7]=b,n[8]=S,n):new e(g,m,A,y,x,b,T,E,S)}static fromHeadingPitchRoll(t,n){let i=Math.cos(-t.pitch),o=Math.cos(-t.heading),r=Math.cos(t.roll),a=Math.sin(-t.pitch),s=Math.sin(-t.heading),c=Math.sin(t.roll),u=i*o,f=-r*s+c*a*o,d=c*s+r*a*o,p=i*s,g=r*o+c*a*s,m=-c*o+r*a*s,A=-a,y=c*i,x=r*i;return l(n)?(n[0]=u,n[1]=p,n[2]=A,n[3]=f,n[4]=g,n[5]=y,n[6]=d,n[7]=m,n[8]=x,n):new e(u,f,d,p,g,m,A,y,x)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new e(t.x,0,0,0,t.y,0,0,0,t.z)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new e(t,0,0,0,t,0,0,0,t)}static fromCrossProduct(t,n){return l(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new e(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)}static fromRotationX(t,n){let i=Math.cos(t),o=Math.sin(t);return l(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=o,n[6]=0,n[7]=-o,n[8]=i,n):new e(1,0,0,0,i,-o,0,o,i)}static fromRotationY(t,n){let i=Math.cos(t),o=Math.sin(t);return l(n)?(n[0]=i,n[1]=0,n[2]=-o,n[3]=0,n[4]=1,n[5]=0,n[6]=o,n[7]=0,n[8]=i,n):new e(i,0,o,0,1,0,-o,0,i)}static fromRotationZ(t,n){let i=Math.cos(t),o=Math.sin(t);return l(n)?(n[0]=i,n[1]=o,n[2]=0,n[3]=-o,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new e(i,-o,0,o,i,0,0,0,1)}static toArray(t,n){return l(n)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}static getElementIndex(t,n){return t*3+n}static getColumn(t,n,i){let o=n*3,r=t[o],a=t[o+1],s=t[o+2];return i.x=r,i.y=a,i.z=s,i}static setColumn(t,n,i,o){o=e.clone(t,o);let r=n*3;return o[r]=i.x,o[r+1]=i.y,o[r+2]=i.z,o}static getRow(t,n,i){let o=t[n],r=t[n+3],a=t[n+6];return i.x=o,i.y=r,i.z=a,i}static setRow(t,n,i,o){return o=e.clone(t,o),o[n]=i.x,o[n+3]=i.y,o[n+6]=i.z,o}static setScale(t,n,i){let o=e.getScale(t,UOe),r=n.x/o.x,a=n.y/o.y,s=n.z/o.z;return i[0]=t[0]*r,i[1]=t[1]*r,i[2]=t[2]*r,i[3]=t[3]*a,i[4]=t[4]*a,i[5]=t[5]*a,i[6]=t[6]*s,i[7]=t[7]*s,i[8]=t[8]*s,i}static setUniformScale(t,n,i){let o=e.getScale(t,VOe),r=n/o.x,a=n/o.y,s=n/o.z;return i[0]=t[0]*r,i[1]=t[1]*r,i[2]=t[2]*r,i[3]=t[3]*a,i[4]=t[4]*a,i[5]=t[5]*a,i[6]=t[6]*s,i[7]=t[7]*s,i[8]=t[8]*s,i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],M9)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],M9)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],M9)),n}static getMaximumScale(t){return e.getScale(t,Fie),h.maximumComponent(Fie)}static setRotation(t,n,i){let o=e.getScale(t,jOe);return i[0]=n[0]*o.x,i[1]=n[1]*o.x,i[2]=n[2]*o.x,i[3]=n[3]*o.y,i[4]=n[4]*o.y,i[5]=n[5]*o.y,i[6]=n[6]*o.z,i[7]=n[7]*o.z,i[8]=n[8]*o.z,i}static getRotation(t,n){let i=e.getScale(t,GOe);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}static multiply(t,n,i){let o=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],r=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],a=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],s=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],c=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],f=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],d=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],p=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return i[0]=o,i[1]=r,i[2]=a,i[3]=s,i[4]=c,i[5]=u,i[6]=f,i[7]=d,i[8]=p,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i}static multiplyByVector(t,n,i){let o=n.x,r=n.y,a=n.z,s=t[0]*o+t[3]*r+t[6]*a,c=t[1]*o+t[4]*r+t[7]*a,u=t[2]*o+t[5]*r+t[8]*a;return i.x=s,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=t[3]*n.y,i[4]=t[4]*n.y,i[5]=t[5]*n.y,i[6]=t[6]*n.z,i[7]=t[7]*n.z,i[8]=t[8]*n.z,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static negate(t,n){return 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}static transpose(t,n){let i=t[0],o=t[3],r=t[6],a=t[1],s=t[4],c=t[7],u=t[2],f=t[5],d=t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=a,n[4]=s,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n}static computeEigenDecomposition(t,n){let i=D.EPSILON20,o=10,r=0,a=0;l(n)||(n={});let s=n.unitary=e.clone(e.IDENTITY,n.unitary),c=n.diagonal=e.clone(t,n.diagonal),u=i*WOe(c);for(;a<o&&qOe(c)>u;)YOe(c,LO),e.transpose(LO,kie),e.multiply(c,LO,c),e.multiply(kie,c,c),e.multiply(s,LO,s),++r>2&&(++a,r=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],o=t[6],r=t[1],a=t[4],s=t[7],c=t[2],u=t[5],f=t[8];return n*(a*f-u*s)+r*(u*o-i*f)+c*(i*s-a*o)}static inverse(t,n){let i=t[0],o=t[1],r=t[2],a=t[3],s=t[4],c=t[5],u=t[6],f=t[7],d=t[8],p=e.determinant(t);n[0]=s*d-f*c,n[1]=f*r-o*d,n[2]=o*c-s*r,n[3]=u*c-a*d,n[4]=i*d-u*r,n[5]=a*r-i*c,n[6]=a*f-u*s,n[7]=u*o-i*f,n[8]=i*s-a*o;let g=1/p;return e.multiplyByScalar(n,g,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,HOe),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]})
  73. (${this[1]}, ${this[4]}, ${this[7]})
  74. (${this[2]}, ${this[5]}, ${this[8]})`}};lo.packedLength=9;lo.fromArray=lo.unpack;lo.IDENTITY=Object.freeze(new lo(1,0,0,0,1,0,0,0,1));lo.ZERO=Object.freeze(new lo(0,0,0,0,0,0,0,0,0));lo.COLUMN0ROW0=0;lo.COLUMN0ROW1=1;lo.COLUMN0ROW2=2;lo.COLUMN1ROW0=3;lo.COLUMN1ROW1=4;lo.COLUMN1ROW2=5;lo.COLUMN2ROW0=6;lo.COLUMN2ROW1=7;lo.COLUMN2ROW2=8;var UOe=new h,VOe=new h,M9=new h,Fie=new h,jOe=new h,GOe=new h,LO=new lo,kie=new lo,HOe=new lo;function WOe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var B9=[1,0,0],L9=[2,2,1];function qOe(e){let t=0;for(let n=0;n<3;++n){let i=e[lo.getElementIndex(L9[n],B9[n])];t+=2*i*i}return Math.sqrt(t)}function YOe(e,t){let n=D.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[lo.getElementIndex(L9[u],B9[u])]);f>i&&(o=u,i=f)}let r=1,a=0,s=B9[o],c=L9[o];if(Math.abs(e[lo.getElementIndex(c,s)])>n){let u=e[lo.getElementIndex(c,c)],f=e[lo.getElementIndex(s,s)],d=e[lo.getElementIndex(c,s)],p=(u-f)/2/d,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),a=g*r}return t=lo.clone(lo.IDENTITY,t),t[lo.getElementIndex(s,s)]=t[lo.getElementIndex(c,c)]=r,t[lo.getElementIndex(c,s)]=a,t[lo.getElementIndex(s,c)]=-a,t}var $=lo;function vw(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(vw.prototype=Object.create(Error.prototype),vw.prototype.constructor=vw);vw.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
  75. ${this.stack.toString()}`),e};var re=vw;var Zo=class e{constructor(t,n,i,o,r,a,s,c,u,f,d,p,g,m,A,y){this[0]=t??0,this[1]=r??0,this[2]=u??0,this[3]=g??0,this[4]=n??0,this[5]=a??0,this[6]=f??0,this[7]=m??0,this[8]=i??0,this[9]=s??0,this[10]=d??0,this[11]=A??0,this[12]=o??0,this[13]=c??0,this[14]=p??0,this[15]=y??0}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,o=i*16;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*16);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/16:n=new Array(i/16);for(let o=0;o<i;o+=16){let r=o/16;n[r]=e.unpack(t,o,n[r])}return n}static clone(t,n){if(l(t))return l(n)?(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]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new e(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}static fromRotationTranslation(t,n,i){return n=n??h.ZERO,l(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new e(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)}static fromTranslationQuaternionRotationScale(t,n,i,o){l(o)||(o=new e);let r=i.x,a=i.y,s=i.z,c=n.x*n.x,u=n.x*n.y,f=n.x*n.z,d=n.x*n.w,p=n.y*n.y,g=n.y*n.z,m=n.y*n.w,A=n.z*n.z,y=n.z*n.w,x=n.w*n.w,b=c-p-A+x,T=2*(u-y),E=2*(f+m),S=2*(u+y),w=-c+p-A+x,P=2*(g-d),O=2*(f-m),B=2*(g+d),L=-c-p+A+x;return o[0]=b*r,o[1]=S*r,o[2]=O*r,o[3]=0,o[4]=T*a,o[5]=w*a,o[6]=B*a,o[7]=0,o[8]=E*s,o[9]=P*s,o[10]=L*s,o[11]=0,o[12]=t.x,o[13]=t.y,o[14]=t.z,o[15]=1,o}static fromTranslationRotationScale(t,n){return e.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)}static fromTranslation(t,n){return e.fromRotationTranslation($.IDENTITY,t,n)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)}static fromRotation(t,n){return l(n)||(n=new e),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}static fromCamera(t,n){let i=t.position,o=t.direction,r=t.up;h.normalize(o,CT),h.normalize(h.cross(CT,r,ET),ET),h.normalize(h.cross(ET,CT,Sw),Sw);let a=ET.x,s=ET.y,c=ET.z,u=CT.x,f=CT.y,d=CT.z,p=Sw.x,g=Sw.y,m=Sw.z,A=i.x,y=i.y,x=i.z,b=a*-A+s*-y+c*-x,T=p*-A+g*-y+m*-x,E=u*A+f*y+d*x;return l(n)?(n[0]=a,n[1]=p,n[2]=-u,n[3]=0,n[4]=s,n[5]=g,n[6]=-f,n[7]=0,n[8]=c,n[9]=m,n[10]=-d,n[11]=0,n[12]=b,n[13]=T,n[14]=E,n[15]=1,n):new e(a,s,c,b,p,g,m,T,-u,-f,-d,E,0,0,0,1)}static computePerspectiveFieldOfView(t,n,i,o,r){let s=1/Math.tan(t*.5),c=s/n,u=(o+i)/(i-o),f=2*o*i/(i-o);return r[0]=c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=u,r[11]=-1,r[12]=0,r[13]=0,r[14]=f,r[15]=0,r}static computeOrthographicOffCenter(t,n,i,o,r,a,s){let c=1/(n-t),u=1/(o-i),f=1/(a-r),d=-(n+t)*c,p=-(o+i)*u,g=-(a+r)*f;return c*=2,u*=2,f*=-2,s[0]=c,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=u,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=f,s[11]=0,s[12]=d,s[13]=p,s[14]=g,s[15]=1,s}static computePerspectiveOffCenter(t,n,i,o,r,a,s){let c=2*r/(n-t),u=2*r/(o-i),f=(n+t)/(n-t),d=(o+i)/(o-i),p=-(a+r)/(a-r),g=-1,m=-2*a*r/(a-r);return s[0]=c,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=u,s[6]=0,s[7]=0,s[8]=f,s[9]=d,s[10]=p,s[11]=g,s[12]=0,s[13]=0,s[14]=m,s[15]=0,s}static computeInfinitePerspectiveOffCenter(t,n,i,o,r,a){let s=2*r/(n-t),c=2*r/(o-i),u=(n+t)/(n-t),f=(o+i)/(o-i),d=-1,p=-1,g=-2*r;return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=u,a[9]=f,a[10]=d,a[11]=p,a[12]=0,a[13]=0,a[14]=g,a[15]=0,a}static computeViewportTransformation(t,n,i,o){l(o)||(o=new e),t=t??G.EMPTY_OBJECT;let r=t.x??0,a=t.y??0,s=t.width??0,c=t.height??0;n=n??0,i=i??1;let u=s*.5,f=c*.5,d=(i-n)*.5,p=u,g=f,m=d,A=r+u,y=a+f,x=n+d,b=1;return o[0]=p,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=g,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=m,o[11]=0,o[12]=A,o[13]=y,o[14]=x,o[15]=b,o}static computeView(t,n,i,o,r){return r[0]=o.x,r[1]=i.x,r[2]=-n.x,r[3]=0,r[4]=o.y,r[5]=i.y,r[6]=-n.y,r[7]=0,r[8]=o.z,r[9]=i.z,r[10]=-n.z,r[11]=0,r[12]=-h.dot(o,t),r[13]=-h.dot(i,t),r[14]=h.dot(n,t),r[15]=1,r}static toArray(t,n){return l(n)?(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]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}static getElementIndex(t,n){return t*4+n}static getColumn(t,n,i){let o=n*4,r=t[o],a=t[o+1],s=t[o+2],c=t[o+3];return i.x=r,i.y=a,i.z=s,i.w=c,i}static setColumn(t,n,i,o){o=e.clone(t,o);let r=n*4;return o[r]=i.x,o[r+1]=i.y,o[r+2]=i.z,o[r+3]=i.w,o}static getRow(t,n,i){let o=t[n],r=t[n+4],a=t[n+8],s=t[n+12];return i.x=o,i.y=r,i.z=a,i.w=s,i}static setRow(t,n,i,o){return o=e.clone(t,o),o[n]=i.x,o[n+4]=i.y,o[n+8]=i.z,o[n+12]=i.w,o}static setTranslation(t,n,i){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=t[15],i}static setScale(t,n,i){let o=e.getScale(t,XOe),r=n.x/o.x,a=n.y/o.y,s=n.z/o.z;return i[0]=t[0]*r,i[1]=t[1]*r,i[2]=t[2]*r,i[3]=t[3],i[4]=t[4]*a,i[5]=t[5]*a,i[6]=t[6]*a,i[7]=t[7],i[8]=t[8]*s,i[9]=t[9]*s,i[10]=t[10]*s,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static setUniformScale(t,n,i){let o=e.getScale(t,KOe),r=n/o.x,a=n/o.y,s=n/o.z;return i[0]=t[0]*r,i[1]=t[1]*r,i[2]=t[2]*r,i[3]=t[3],i[4]=t[4]*a,i[5]=t[5]*a,i[6]=t[6]*a,i[7]=t[7],i[8]=t[8]*s,i[9]=t[9]*s,i[10]=t[10]*s,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],N9)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],N9)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],N9)),n}static getMaximumScale(t){return e.getScale(t,zie),h.maximumComponent(zie)}static setRotation(t,n,i){let o=e.getScale(t,QOe);return i[0]=n[0]*o.x,i[1]=n[1]*o.x,i[2]=n[2]*o.x,i[3]=t[3],i[4]=n[3]*o.y,i[5]=n[4]*o.y,i[6]=n[5]*o.y,i[7]=t[7],i[8]=n[6]*o.z,i[9]=n[7]*o.z,i[10]=n[8]*o.z,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getRotation(t,n){let i=e.getScale(t,$Oe);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[4]/i.y,n[4]=t[5]/i.y,n[5]=t[6]/i.y,n[6]=t[8]/i.z,n[7]=t[9]/i.z,n[8]=t[10]/i.z,n}static multiply(t,n,i){let o=t[0],r=t[1],a=t[2],s=t[3],c=t[4],u=t[5],f=t[6],d=t[7],p=t[8],g=t[9],m=t[10],A=t[11],y=t[12],x=t[13],b=t[14],T=t[15],E=n[0],S=n[1],w=n[2],P=n[3],O=n[4],B=n[5],L=n[6],_=n[7],C=n[8],v=n[9],I=n[10],M=n[11],N=n[12],j=n[13],k=n[14],V=n[15],F=o*E+c*S+p*w+y*P,W=r*E+u*S+g*w+x*P,q=a*E+f*S+m*w+b*P,J=s*E+d*S+A*w+T*P,H=o*O+c*B+p*L+y*_,Z=r*O+u*B+g*L+x*_,K=a*O+f*B+m*L+b*_,le=s*O+d*B+A*L+T*_,me=o*C+c*v+p*I+y*M,ae=r*C+u*v+g*I+x*M,be=a*C+f*v+m*I+b*M,ge=s*C+d*v+A*I+T*M,we=o*N+c*j+p*k+y*V,Ee=r*N+u*j+g*k+x*V,Be=a*N+f*j+m*k+b*V,ke=s*N+d*j+A*k+T*V;return i[0]=F,i[1]=W,i[2]=q,i[3]=J,i[4]=H,i[5]=Z,i[6]=K,i[7]=le,i[8]=me,i[9]=ae,i[10]=be,i[11]=ge,i[12]=we,i[13]=Ee,i[14]=Be,i[15]=ke,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i[9]=t[9]+n[9],i[10]=t[10]+n[10],i[11]=t[11]+n[11],i[12]=t[12]+n[12],i[13]=t[13]+n[13],i[14]=t[14]+n[14],i[15]=t[15]+n[15],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i[9]=t[9]-n[9],i[10]=t[10]-n[10],i[11]=t[11]-n[11],i[12]=t[12]-n[12],i[13]=t[13]-n[13],i[14]=t[14]-n[14],i[15]=t[15]-n[15],i}static multiplyTransformation(t,n,i){let o=t[0],r=t[1],a=t[2],s=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=t[12],m=t[13],A=t[14],y=n[0],x=n[1],b=n[2],T=n[4],E=n[5],S=n[6],w=n[8],P=n[9],O=n[10],B=n[12],L=n[13],_=n[14],C=o*y+s*x+f*b,v=r*y+c*x+d*b,I=a*y+u*x+p*b,M=o*T+s*E+f*S,N=r*T+c*E+d*S,j=a*T+u*E+p*S,k=o*w+s*P+f*O,V=r*w+c*P+d*O,F=a*w+u*P+p*O,W=o*B+s*L+f*_+g,q=r*B+c*L+d*_+m,J=a*B+u*L+p*_+A;return i[0]=C,i[1]=v,i[2]=I,i[3]=0,i[4]=M,i[5]=N,i[6]=j,i[7]=0,i[8]=k,i[9]=V,i[10]=F,i[11]=0,i[12]=W,i[13]=q,i[14]=J,i[15]=1,i}static multiplyByMatrix3(t,n,i){let o=t[0],r=t[1],a=t[2],s=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=n[0],m=n[1],A=n[2],y=n[3],x=n[4],b=n[5],T=n[6],E=n[7],S=n[8],w=o*g+s*m+f*A,P=r*g+c*m+d*A,O=a*g+u*m+p*A,B=o*y+s*x+f*b,L=r*y+c*x+d*b,_=a*y+u*x+p*b,C=o*T+s*E+f*S,v=r*T+c*E+d*S,I=a*T+u*E+p*S;return i[0]=w,i[1]=P,i[2]=O,i[3]=0,i[4]=B,i[5]=L,i[6]=_,i[7]=0,i[8]=C,i[9]=v,i[10]=I,i[11]=0,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByTranslation(t,n,i){let o=n.x,r=n.y,a=n.z,s=o*t[0]+r*t[4]+a*t[8]+t[12],c=o*t[1]+r*t[5]+a*t[9]+t[13],u=o*t[2]+r*t[6]+a*t[10]+t[14];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=s,i[13]=c,i[14]=u,i[15]=t[15],i}static multiplyByScale(t,n,i){let o=n.x,r=n.y,a=n.z;return o===1&&r===1&&a===1?e.clone(t,i):(i[0]=o*t[0],i[1]=o*t[1],i[2]=o*t[2],i[3]=t[3],i[4]=r*t[4],i[5]=r*t[5],i[6]=r*t[6],i[7]=t[7],i[8]=a*t[8],i[9]=a*t[9],i[10]=a*t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i)}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3],i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7],i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByVector(t,n,i){let o=n.x,r=n.y,a=n.z,s=n.w,c=t[0]*o+t[4]*r+t[8]*a+t[12]*s,u=t[1]*o+t[5]*r+t[9]*a+t[13]*s,f=t[2]*o+t[6]*r+t[10]*a+t[14]*s,d=t[3]*o+t[7]*r+t[11]*a+t[15]*s;return i.x=c,i.y=u,i.z=f,i.w=d,i}static multiplyByPointAsVector(t,n,i){let o=n.x,r=n.y,a=n.z,s=t[0]*o+t[4]*r+t[8]*a,c=t[1]*o+t[5]*r+t[9]*a,u=t[2]*o+t[6]*r+t[10]*a;return i.x=s,i.y=c,i.z=u,i}static multiplyByPoint(t,n,i){let o=n.x,r=n.y,a=n.z,s=t[0]*o+t[4]*r+t[8]*a+t[12],c=t[1]*o+t[5]*r+t[9]*a+t[13],u=t[2]*o+t[6]*r+t[10]*a+t[14];return i.x=s,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11]*n,i[12]=t[12]*n,i[13]=t[13]*n,i[14]=t[14]*n,i[15]=t[15]*n,i}static negate(t,n){return 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]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n}static transpose(t,n){let i=t[1],o=t[2],r=t[3],a=t[6],s=t[7],c=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=i,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=o,n[9]=a,n[10]=t[10],n[11]=t[14],n[12]=r,n[13]=s,n[14]=c,n[15]=t[15],n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i&&Math.abs(t[9]-n[9])<=i&&Math.abs(t[10]-n[10])<=i&&Math.abs(t[11]-n[11])<=i&&Math.abs(t[12]-n[12])<=i&&Math.abs(t[13]-n[13])<=i&&Math.abs(t[14]-n[14])<=i&&Math.abs(t[15]-n[15])<=i}static getTranslation(t,n){return n.x=t[12],n.y=t[13],n.z=t[14],n}static getMatrix3(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}static inverse(t,n){let i=t[0],o=t[4],r=t[8],a=t[12],s=t[1],c=t[5],u=t[9],f=t[13],d=t[2],p=t[6],g=t[10],m=t[14],A=t[3],y=t[7],x=t[11],b=t[15],T=g*b,E=m*x,S=p*b,w=m*y,P=p*x,O=g*y,B=d*b,L=m*A,_=d*x,C=g*A,v=d*y,I=p*A,M=T*c+w*u+P*f-(E*c+S*u+O*f),N=E*s+B*u+C*f-(T*s+L*u+_*f),j=S*s+L*c+v*f-(w*s+B*c+I*f),k=O*s+_*c+I*u-(P*s+C*c+v*u),V=E*o+S*r+O*a-(T*o+w*r+P*a),F=T*i+L*r+_*a-(E*i+B*r+C*a),W=w*i+B*o+I*a-(S*i+L*o+v*a),q=P*i+C*o+v*r-(O*i+_*o+I*r);T=r*f,E=a*u,S=o*f,w=a*c,P=o*u,O=r*c,B=i*f,L=a*s,_=i*u,C=r*s,v=i*c,I=o*s;let J=T*y+w*x+P*b-(E*y+S*x+O*b),H=E*A+B*x+C*b-(T*A+L*x+_*b),Z=S*A+L*y+v*b-(w*A+B*y+I*b),K=O*A+_*y+I*x-(P*A+C*y+v*x),le=S*g+O*m+E*p-(P*m+T*p+w*g),me=_*m+T*d+L*g-(B*g+C*m+E*d),ae=B*p+I*m+w*d-(v*m+S*d+L*p),be=v*g+P*d+C*p-(_*p+I*g+O*d),ge=i*M+o*N+r*j+a*k;if(Math.abs(ge)<D.EPSILON21){if($.equalsEpsilon(e.getMatrix3(t,JOe),ZOe,D.EPSILON7)&&se.equals(e.getRow(t,3,eMe),tMe))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new re("matrix is not invertible because its determinate is zero.")}return ge=1/ge,n[0]=M*ge,n[1]=N*ge,n[2]=j*ge,n[3]=k*ge,n[4]=V*ge,n[5]=F*ge,n[6]=W*ge,n[7]=q*ge,n[8]=J*ge,n[9]=H*ge,n[10]=Z*ge,n[11]=K*ge,n[12]=le*ge,n[13]=me*ge,n[14]=ae*ge,n[15]=be*ge,n}static inverseTransformation(t,n){let i=t[0],o=t[1],r=t[2],a=t[4],s=t[5],c=t[6],u=t[8],f=t[9],d=t[10],p=t[12],g=t[13],m=t[14],A=-i*p-o*g-r*m,y=-a*p-s*g-c*m,x=-u*p-f*g-d*m;return n[0]=i,n[1]=a,n[2]=u,n[3]=0,n[4]=o,n[5]=s,n[6]=f,n[7]=0,n[8]=r,n[9]=c,n[10]=d,n[11]=0,n[12]=A,n[13]=y,n[14]=x,n[15]=1,n}static inverseTranspose(t,n){return e.inverse(e.transpose(t,nMe),n)}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]&&t[9]===n[i+9]&&t[10]===n[i+10]&&t[11]===n[i+11]&&t[12]===n[i+12]&&t[13]===n[i+13]&&t[14]===n[i+14]&&t[15]===n[i+15]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
  76. (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
  77. (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
  78. (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};Zo.packedLength=16;Zo.fromArray=Zo.unpack;Zo.IDENTITY=Object.freeze(new Zo(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));Zo.ZERO=Object.freeze(new Zo(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));Zo.COLUMN0ROW0=0;Zo.COLUMN0ROW1=1;Zo.COLUMN0ROW2=2;Zo.COLUMN0ROW3=3;Zo.COLUMN1ROW0=4;Zo.COLUMN1ROW1=5;Zo.COLUMN1ROW2=6;Zo.COLUMN1ROW3=7;Zo.COLUMN2ROW0=8;Zo.COLUMN2ROW1=9;Zo.COLUMN2ROW2=10;Zo.COLUMN2ROW3=11;Zo.COLUMN3ROW0=12;Zo.COLUMN3ROW1=13;Zo.COLUMN3ROW2=14;Zo.COLUMN3ROW3=15;var CT=new h,ET=new h,Sw=new h,XOe=new h,KOe=new h,N9=new h,zie=new h,QOe=new h,$Oe=new h,JOe=new $,ZOe=new $,eMe=new se,tMe=new se(0,0,0,1),nMe=new Zo,R=Zo;var Uie={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};Object.freeze(Uie);var ee=Uie;var iMe=new h;function Ot(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var zs={};zs[ee.FLOAT]="float";zs[ee.FLOAT_VEC2]="vec2";zs[ee.FLOAT_VEC3]="vec3";zs[ee.FLOAT_VEC4]="vec4";zs[ee.INT]="int";zs[ee.INT_VEC2]="ivec2";zs[ee.INT_VEC3]="ivec3";zs[ee.INT_VEC4]="ivec4";zs[ee.BOOL]="bool";zs[ee.BOOL_VEC2]="bvec2";zs[ee.BOOL_VEC3]="bvec3";zs[ee.BOOL_VEC4]="bvec4";zs[ee.FLOAT_MAT2]="mat2";zs[ee.FLOAT_MAT3]="mat3";zs[ee.FLOAT_MAT4]="mat4";zs[ee.SAMPLER_2D]="sampler2D";zs[ee.SAMPLER_CUBE]="samplerCube";Ot.prototype.getDeclaration=function(e){let t=`uniform ${zs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var oMe={czm_viewport:new Ot({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Ot({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Ot({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Ot({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Ot({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_model:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Ot({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Ot({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Ot({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Ot({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Ot({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Ot({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Ot({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Ot({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Ot({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Ot({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Ot({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Ot({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Ot({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Ot({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return R.getTranslation(e.inverseView,iMe)}}),czm_frameNumber:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Ot({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Ot({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Ot({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Ot({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Ot({size:9,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Ot({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Ot({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Ot({size:1,datatype:ee.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Ot({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Gg=oMe;function rMe(){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 Hn=rMe;function aMe(){return!0}function sMe(e,t){t=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=aMe}var fe=sMe;var es={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT};es.getSizeInBytes=function(e){switch(e){case es.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case es.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case es.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};es.fromSizeInBytes=function(e){switch(e){case 2:return es.UNSIGNED_SHORT;case 4:return es.UNSIGNED_INT;case 1:return es.UNSIGNED_BYTE}};es.validate=function(e){return l(e)&&(e===es.UNSIGNED_BYTE||e===es.UNSIGNED_SHORT||e===es.UNSIGNED_INT)};es.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};es.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};es.fromTypedArray=function(e){if(e instanceof Uint8Array)return es.UNSIGNED_BYTE;if(e instanceof Uint16Array)return es.UNSIGNED_SHORT;if(e instanceof Uint32Array)return es.UNSIGNED_INT};Object.freeze(es);var Ue=es;var wy={STREAM_DRAW:ee.STREAM_DRAW,STATIC_DRAW:ee.STATIC_DRAW,DYNAMIC_DRAW:ee.DYNAMIC_DRAW,DYNAMIC_READ:ee.DYNAMIC_READ};wy.validate=function(e){return e===wy.STREAM_DRAW||e===wy.STATIC_DRAW||e===wy.DYNAMIC_DRAW||e===wy.DYNAMIC_READ};Object.freeze(wy);var Oe=wy;function Lc(e){e=e??G.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,a=l(i);a&&(o=i.byteLength);let s=t.createBuffer();t.bindBuffer(n,s),t.bufferData(n,a?i:o,r),t.bindBuffer(n,null),this._id=Hn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=s,this.vertexArrayDestroyable=!0}Lc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new _e("A WebGL 2 context is required to create PixelBuffers.");return new Lc({context:e.context,bufferTarget:ee.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Lc.createVertexBuffer=function(e){return new Lc({context:e.context,bufferTarget:ee.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Lc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ue.getSizeInBytes(n),o=new Lc({context:t,bufferTarget:ee.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(Lc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Lc.prototype._getBuffer=function(){return this._buffer};Lc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Lc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Lc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Lc.prototype.copyFromBuffer=function(e,t,n,i){let o=ee.COPY_READ_BUFFER,r=ee.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(r,this._buffer),a.bindBuffer(o,e._buffer),a.copyBufferSubData(o,r,t,n,i),a.bindBuffer(r,null),a.bindBuffer(o,null)};Lc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=ee.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Lc.prototype.isDestroyed=function(){return!1};Lc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),fe(this)};var Ke=Lc;var Hg,Zr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Xl={};Object.defineProperties(Xl,{element:{get:function(){if(Xl.supportsFullscreen())return document[Zr.fullscreenElement]}},changeEventName:{get:function(){if(Xl.supportsFullscreen())return Zr.fullscreenchange}},errorEventName:{get:function(){if(Xl.supportsFullscreen())return Zr.fullscreenerror}},enabled:{get:function(){if(Xl.supportsFullscreen())return document[Zr.fullscreenEnabled]}},fullscreen:{get:function(){if(Xl.supportsFullscreen())return Xl.element!==null}}});Xl.supportsFullscreen=function(){if(l(Hg))return Hg;Hg=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Zr.requestFullscreen="requestFullscreen",Zr.exitFullscreen="exitFullscreen",Zr.fullscreenEnabled="fullscreenEnabled",Zr.fullscreenElement="fullscreenElement",Zr.fullscreenchange="fullscreenchange",Zr.fullscreenerror="fullscreenerror",Hg=!0,Hg;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"?(Zr.requestFullscreen=n,Hg=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Zr.requestFullscreen=n,Hg=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Zr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Zr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Zr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Zr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Zr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Zr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Zr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Zr.fullscreenerror=n)}return Hg};Xl.requestFullscreen=function(e,t){Xl.supportsFullscreen()&&e[Zr.requestFullscreen]({vrDisplay:t})};Xl.exitFullscreen=function(){Xl.supportsFullscreen()&&document[Zr.exitFullscreen]()};Xl._names=Zr;var ea=Xl;var kf;typeof navigator<"u"?kf=navigator:kf={};function ww(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var NO,Vie;function V9(){if(!l(NO)&&(NO=!1,!jO())){let e=/ Chrome\/([\.0-9]+)/.exec(kf.userAgent);e!==null&&(NO=!0,Vie=ww(e[1]))}return NO}function cMe(){return V9()&&Vie}var FO,jie;function Gie(){if(!l(FO)&&(FO=!1,!V9()&&!jO()&&/ Safari\/[\.0-9]+/.test(kf.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(kf.userAgent);e!==null&&(FO=!0,jie=ww(e[1]))}return FO}function lMe(){return Gie()&&jie}var kO,U9;function Hie(){if(!l(kO)){kO=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(kf.userAgent);e!==null&&(kO=!0,U9=ww(e[1]),U9.isNightly=!!e[2])}return kO}function uMe(){return Hie()&&U9}var zO,Wie;function jO(){if(!l(zO)){zO=!1;let e=/ Edg\/([\.0-9]+)/.exec(kf.userAgent);e!==null&&(zO=!0,Wie=ww(e[1]))}return zO}function fMe(){return jO()&&Wie}var UO,j9;function GO(){if(!l(UO)){UO=!1;let e=/Firefox\/([\.0-9]+)/.exec(kf.userAgent);e!==null&&(UO=!0,j9=ww(e[1]))}return UO}var F9;function dMe(){return l(F9)||(F9=/Windows/i.test(kf.appVersion)),F9}var k9;function hMe(){return l(k9)||(k9=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),k9}function mMe(){return GO()&&j9}var z9;function pMe(){return l(z9)||(z9=!GO()&&typeof PointerEvent<"u"&&(!l(kf.pointerEnabled)||kf.pointerEnabled)),z9}var qie,VO;function Yie(){if(!l(VO)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;VO=l(t)&&t!=="",VO&&(qie=t)}return VO}function gMe(){return Yie()?qie:void 0}function dl(){return dl._result}dl._promise=void 0;dl._result=void 0;dl.initialize=function(){return l(dl._promise)||(dl._promise=new Promise(e=>{let t=new Image;t.onload=function(){dl._result=t.width>0&&t.height>0,e(dl._result)},t.onerror=function(){dl._result=!1,e(dl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),dl._promise};Object.defineProperties(dl,{initialized:{get:function(){return l(dl._result)}}});var vT=[];typeof ArrayBuffer<"u"&&(vT.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&vT.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&vT.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&vT.push(BigInt64Array),typeof BigUint64Array<"u"&&vT.push(BigUint64Array));var zf={isChrome:V9,chromeVersion:cMe,isSafari:Gie,safariVersion:lMe,isWebkit:Hie,webkitVersion:uMe,isEdge:jO,edgeVersion:fMe,isFirefox:GO,firefoxVersion:mMe,isWindows:dMe,isIPadOrIOS:hMe,hardwareConcurrency:kf.hardwareConcurrency??3,supportsPointerEvents:pMe,supportsImageRenderingPixelated:Yie,supportsWebP:dl,imageRenderingValue:gMe,typedArrayTypes:vT};zf.supportsBasis=function(e){return zf.supportsWebAssembly()&&e.context.supportsBasis};zf.supportsFullscreen=function(){return ea.supportsFullscreen()};zf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};zf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};zf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};zf.supportsBigInt=function(){return typeof BigInt<"u"};zf.supportsWebWorkers=function(){return typeof Worker<"u"};zf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};zf.supportsWebgl2=function(e){return e.context.webgl2};zf.supportsEsmWebWorkers=function(){return!GO()||parseInt(j9)>=114};var cn=zf;function G9(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}var Ae=class e{constructor(t,n,i,o){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=o??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,o,r){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),o=e.byteToFloat(o??255),l(r)?(r.red=t,r.green=n,r.blue=i,r.alpha=o,r):new e(t,n,i,o)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return W9[0]=t,e.fromBytes(o0[0],o0[1],o0[2],o0[3],n)}static fromHsl(t,n,i,o,r){t=(t??0)%1,n=n??0,i=i??0,o=o??1;let a=i,s=i,c=i;if(n!==0){let u;i<.5?u=i*(1+n):u=i+n-i*n;let f=2*i-u;a=G9(f,u,t+1/3),s=G9(f,u,t),c=G9(f,u,t-1/3)}return l(r)?(r.red=a,r.green=s,r.blue=c,r.alpha=o,r):new e(a,s,c,o)}static fromRandom(t,n){t=t??G.EMPTY_OBJECT;let i=t.red;if(!l(i)){let s=t.minimumRed??0,c=t.maximumRed??1;i=s+D.nextRandomNumber()*(c-s)}let o=t.green;if(!l(o)){let s=t.minimumGreen??0,c=t.maximumGreen??1;o=s+D.nextRandomNumber()*(c-s)}let r=t.blue;if(!l(r)){let s=t.minimumBlue??0,c=t.maximumBlue??1;r=s+D.nextRandomNumber()*(c-s)}let a=t.alpha;if(!l(a)){let s=t.minimumAlpha??0,c=t.maximumAlpha??1;a=s+D.nextRandomNumber()*(c-s)}return l(n)?(n.red=i,n.green=o,n.blue=r,n.alpha=a,n):new e(i,o,r,a)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let o=_Me.exec(t);return o!==null?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=parseInt(o[4]??"f",16)/15,n):(o=AMe.exec(t),o!==null?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=parseInt(o[4]??"ff",16)/255,n):(o=yMe.exec(t),o!==null?(n.red=parseFloat(o[1])/(o[1].substr(-1)==="%"?100:255),n.green=parseFloat(o[2])/(o[2].substr(-1)==="%"?100:255),n.blue=parseFloat(o[3])/(o[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(o[4]??"1.0"),n):(o=xMe.exec(t),o!==null?e.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(o[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let o=e.floatToByte(this.alpha).toString(16);return o.length<2&&(o=`0${o}`),`#${t}${n}${i}${o}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),o=e.floatToByte(this.blue),r=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=o,t[3]=r,t):[n,i,o,r]}static bytesToRgba(t,n,i,o){return o0[0]=t,o0[1]=n,o0[2]=i,o0[3]=o,W9[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,o){return o.red=D.lerp(t.red,n.red,i),o.green=D.lerp(t.green,n.green,i),o.blue=D.lerp(t.blue,n.blue,i),o.alpha=D.lerp(t.alpha,n.alpha,i),o}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},H9,W9,o0;cn.supportsTypedArrays()&&(H9=new ArrayBuffer(4),W9=new Uint32Array(H9),o0=new Uint8Array(H9));var _Me=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,AMe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,yMe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,xMe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;Ae.packedLength=4;Ae.ALICEBLUE=Object.freeze(Ae.fromCssColorString("#F0F8FF"));Ae.ANTIQUEWHITE=Object.freeze(Ae.fromCssColorString("#FAEBD7"));Ae.AQUA=Object.freeze(Ae.fromCssColorString("#00FFFF"));Ae.AQUAMARINE=Object.freeze(Ae.fromCssColorString("#7FFFD4"));Ae.AZURE=Object.freeze(Ae.fromCssColorString("#F0FFFF"));Ae.BEIGE=Object.freeze(Ae.fromCssColorString("#F5F5DC"));Ae.BISQUE=Object.freeze(Ae.fromCssColorString("#FFE4C4"));Ae.BLACK=Object.freeze(Ae.fromCssColorString("#000000"));Ae.BLANCHEDALMOND=Object.freeze(Ae.fromCssColorString("#FFEBCD"));Ae.BLUE=Object.freeze(Ae.fromCssColorString("#0000FF"));Ae.BLUEVIOLET=Object.freeze(Ae.fromCssColorString("#8A2BE2"));Ae.BROWN=Object.freeze(Ae.fromCssColorString("#A52A2A"));Ae.BURLYWOOD=Object.freeze(Ae.fromCssColorString("#DEB887"));Ae.CADETBLUE=Object.freeze(Ae.fromCssColorString("#5F9EA0"));Ae.CHARTREUSE=Object.freeze(Ae.fromCssColorString("#7FFF00"));Ae.CHOCOLATE=Object.freeze(Ae.fromCssColorString("#D2691E"));Ae.CORAL=Object.freeze(Ae.fromCssColorString("#FF7F50"));Ae.CORNFLOWERBLUE=Object.freeze(Ae.fromCssColorString("#6495ED"));Ae.CORNSILK=Object.freeze(Ae.fromCssColorString("#FFF8DC"));Ae.CRIMSON=Object.freeze(Ae.fromCssColorString("#DC143C"));Ae.CYAN=Object.freeze(Ae.fromCssColorString("#00FFFF"));Ae.DARKBLUE=Object.freeze(Ae.fromCssColorString("#00008B"));Ae.DARKCYAN=Object.freeze(Ae.fromCssColorString("#008B8B"));Ae.DARKGOLDENROD=Object.freeze(Ae.fromCssColorString("#B8860B"));Ae.DARKGRAY=Object.freeze(Ae.fromCssColorString("#A9A9A9"));Ae.DARKGREEN=Object.freeze(Ae.fromCssColorString("#006400"));Ae.DARKGREY=Ae.DARKGRAY;Ae.DARKKHAKI=Object.freeze(Ae.fromCssColorString("#BDB76B"));Ae.DARKMAGENTA=Object.freeze(Ae.fromCssColorString("#8B008B"));Ae.DARKOLIVEGREEN=Object.freeze(Ae.fromCssColorString("#556B2F"));Ae.DARKORANGE=Object.freeze(Ae.fromCssColorString("#FF8C00"));Ae.DARKORCHID=Object.freeze(Ae.fromCssColorString("#9932CC"));Ae.DARKRED=Object.freeze(Ae.fromCssColorString("#8B0000"));Ae.DARKSALMON=Object.freeze(Ae.fromCssColorString("#E9967A"));Ae.DARKSEAGREEN=Object.freeze(Ae.fromCssColorString("#8FBC8F"));Ae.DARKSLATEBLUE=Object.freeze(Ae.fromCssColorString("#483D8B"));Ae.DARKSLATEGRAY=Object.freeze(Ae.fromCssColorString("#2F4F4F"));Ae.DARKSLATEGREY=Ae.DARKSLATEGRAY;Ae.DARKTURQUOISE=Object.freeze(Ae.fromCssColorString("#00CED1"));Ae.DARKVIOLET=Object.freeze(Ae.fromCssColorString("#9400D3"));Ae.DEEPPINK=Object.freeze(Ae.fromCssColorString("#FF1493"));Ae.DEEPSKYBLUE=Object.freeze(Ae.fromCssColorString("#00BFFF"));Ae.DIMGRAY=Object.freeze(Ae.fromCssColorString("#696969"));Ae.DIMGREY=Ae.DIMGRAY;Ae.DODGERBLUE=Object.freeze(Ae.fromCssColorString("#1E90FF"));Ae.FIREBRICK=Object.freeze(Ae.fromCssColorString("#B22222"));Ae.FLORALWHITE=Object.freeze(Ae.fromCssColorString("#FFFAF0"));Ae.FORESTGREEN=Object.freeze(Ae.fromCssColorString("#228B22"));Ae.FUCHSIA=Object.freeze(Ae.fromCssColorString("#FF00FF"));Ae.GAINSBORO=Object.freeze(Ae.fromCssColorString("#DCDCDC"));Ae.GHOSTWHITE=Object.freeze(Ae.fromCssColorString("#F8F8FF"));Ae.GOLD=Object.freeze(Ae.fromCssColorString("#FFD700"));Ae.GOLDENROD=Object.freeze(Ae.fromCssColorString("#DAA520"));Ae.GRAY=Object.freeze(Ae.fromCssColorString("#808080"));Ae.GREEN=Object.freeze(Ae.fromCssColorString("#008000"));Ae.GREENYELLOW=Object.freeze(Ae.fromCssColorString("#ADFF2F"));Ae.GREY=Ae.GRAY;Ae.HONEYDEW=Object.freeze(Ae.fromCssColorString("#F0FFF0"));Ae.HOTPINK=Object.freeze(Ae.fromCssColorString("#FF69B4"));Ae.INDIANRED=Object.freeze(Ae.fromCssColorString("#CD5C5C"));Ae.INDIGO=Object.freeze(Ae.fromCssColorString("#4B0082"));Ae.IVORY=Object.freeze(Ae.fromCssColorString("#FFFFF0"));Ae.KHAKI=Object.freeze(Ae.fromCssColorString("#F0E68C"));Ae.LAVENDER=Object.freeze(Ae.fromCssColorString("#E6E6FA"));Ae.LAVENDAR_BLUSH=Object.freeze(Ae.fromCssColorString("#FFF0F5"));Ae.LAWNGREEN=Object.freeze(Ae.fromCssColorString("#7CFC00"));Ae.LEMONCHIFFON=Object.freeze(Ae.fromCssColorString("#FFFACD"));Ae.LIGHTBLUE=Object.freeze(Ae.fromCssColorString("#ADD8E6"));Ae.LIGHTCORAL=Object.freeze(Ae.fromCssColorString("#F08080"));Ae.LIGHTCYAN=Object.freeze(Ae.fromCssColorString("#E0FFFF"));Ae.LIGHTGOLDENRODYELLOW=Object.freeze(Ae.fromCssColorString("#FAFAD2"));Ae.LIGHTGRAY=Object.freeze(Ae.fromCssColorString("#D3D3D3"));Ae.LIGHTGREEN=Object.freeze(Ae.fromCssColorString("#90EE90"));Ae.LIGHTGREY=Ae.LIGHTGRAY;Ae.LIGHTPINK=Object.freeze(Ae.fromCssColorString("#FFB6C1"));Ae.LIGHTSEAGREEN=Object.freeze(Ae.fromCssColorString("#20B2AA"));Ae.LIGHTSKYBLUE=Object.freeze(Ae.fromCssColorString("#87CEFA"));Ae.LIGHTSLATEGRAY=Object.freeze(Ae.fromCssColorString("#778899"));Ae.LIGHTSLATEGREY=Ae.LIGHTSLATEGRAY;Ae.LIGHTSTEELBLUE=Object.freeze(Ae.fromCssColorString("#B0C4DE"));Ae.LIGHTYELLOW=Object.freeze(Ae.fromCssColorString("#FFFFE0"));Ae.LIME=Object.freeze(Ae.fromCssColorString("#00FF00"));Ae.LIMEGREEN=Object.freeze(Ae.fromCssColorString("#32CD32"));Ae.LINEN=Object.freeze(Ae.fromCssColorString("#FAF0E6"));Ae.MAGENTA=Object.freeze(Ae.fromCssColorString("#FF00FF"));Ae.MAROON=Object.freeze(Ae.fromCssColorString("#800000"));Ae.MEDIUMAQUAMARINE=Object.freeze(Ae.fromCssColorString("#66CDAA"));Ae.MEDIUMBLUE=Object.freeze(Ae.fromCssColorString("#0000CD"));Ae.MEDIUMORCHID=Object.freeze(Ae.fromCssColorString("#BA55D3"));Ae.MEDIUMPURPLE=Object.freeze(Ae.fromCssColorString("#9370DB"));Ae.MEDIUMSEAGREEN=Object.freeze(Ae.fromCssColorString("#3CB371"));Ae.MEDIUMSLATEBLUE=Object.freeze(Ae.fromCssColorString("#7B68EE"));Ae.MEDIUMSPRINGGREEN=Object.freeze(Ae.fromCssColorString("#00FA9A"));Ae.MEDIUMTURQUOISE=Object.freeze(Ae.fromCssColorString("#48D1CC"));Ae.MEDIUMVIOLETRED=Object.freeze(Ae.fromCssColorString("#C71585"));Ae.MIDNIGHTBLUE=Object.freeze(Ae.fromCssColorString("#191970"));Ae.MINTCREAM=Object.freeze(Ae.fromCssColorString("#F5FFFA"));Ae.MISTYROSE=Object.freeze(Ae.fromCssColorString("#FFE4E1"));Ae.MOCCASIN=Object.freeze(Ae.fromCssColorString("#FFE4B5"));Ae.NAVAJOWHITE=Object.freeze(Ae.fromCssColorString("#FFDEAD"));Ae.NAVY=Object.freeze(Ae.fromCssColorString("#000080"));Ae.OLDLACE=Object.freeze(Ae.fromCssColorString("#FDF5E6"));Ae.OLIVE=Object.freeze(Ae.fromCssColorString("#808000"));Ae.OLIVEDRAB=Object.freeze(Ae.fromCssColorString("#6B8E23"));Ae.ORANGE=Object.freeze(Ae.fromCssColorString("#FFA500"));Ae.ORANGERED=Object.freeze(Ae.fromCssColorString("#FF4500"));Ae.ORCHID=Object.freeze(Ae.fromCssColorString("#DA70D6"));Ae.PALEGOLDENROD=Object.freeze(Ae.fromCssColorString("#EEE8AA"));Ae.PALEGREEN=Object.freeze(Ae.fromCssColorString("#98FB98"));Ae.PALETURQUOISE=Object.freeze(Ae.fromCssColorString("#AFEEEE"));Ae.PALEVIOLETRED=Object.freeze(Ae.fromCssColorString("#DB7093"));Ae.PAPAYAWHIP=Object.freeze(Ae.fromCssColorString("#FFEFD5"));Ae.PEACHPUFF=Object.freeze(Ae.fromCssColorString("#FFDAB9"));Ae.PERU=Object.freeze(Ae.fromCssColorString("#CD853F"));Ae.PINK=Object.freeze(Ae.fromCssColorString("#FFC0CB"));Ae.PLUM=Object.freeze(Ae.fromCssColorString("#DDA0DD"));Ae.POWDERBLUE=Object.freeze(Ae.fromCssColorString("#B0E0E6"));Ae.PURPLE=Object.freeze(Ae.fromCssColorString("#800080"));Ae.RED=Object.freeze(Ae.fromCssColorString("#FF0000"));Ae.ROSYBROWN=Object.freeze(Ae.fromCssColorString("#BC8F8F"));Ae.ROYALBLUE=Object.freeze(Ae.fromCssColorString("#4169E1"));Ae.SADDLEBROWN=Object.freeze(Ae.fromCssColorString("#8B4513"));Ae.SALMON=Object.freeze(Ae.fromCssColorString("#FA8072"));Ae.SANDYBROWN=Object.freeze(Ae.fromCssColorString("#F4A460"));Ae.SEAGREEN=Object.freeze(Ae.fromCssColorString("#2E8B57"));Ae.SEASHELL=Object.freeze(Ae.fromCssColorString("#FFF5EE"));Ae.SIENNA=Object.freeze(Ae.fromCssColorString("#A0522D"));Ae.SILVER=Object.freeze(Ae.fromCssColorString("#C0C0C0"));Ae.SKYBLUE=Object.freeze(Ae.fromCssColorString("#87CEEB"));Ae.SLATEBLUE=Object.freeze(Ae.fromCssColorString("#6A5ACD"));Ae.SLATEGRAY=Object.freeze(Ae.fromCssColorString("#708090"));Ae.SLATEGREY=Ae.SLATEGRAY;Ae.SNOW=Object.freeze(Ae.fromCssColorString("#FFFAFA"));Ae.SPRINGGREEN=Object.freeze(Ae.fromCssColorString("#00FF7F"));Ae.STEELBLUE=Object.freeze(Ae.fromCssColorString("#4682B4"));Ae.TAN=Object.freeze(Ae.fromCssColorString("#D2B48C"));Ae.TEAL=Object.freeze(Ae.fromCssColorString("#008080"));Ae.THISTLE=Object.freeze(Ae.fromCssColorString("#D8BFD8"));Ae.TOMATO=Object.freeze(Ae.fromCssColorString("#FF6347"));Ae.TURQUOISE=Object.freeze(Ae.fromCssColorString("#40E0D0"));Ae.VIOLET=Object.freeze(Ae.fromCssColorString("#EE82EE"));Ae.WHEAT=Object.freeze(Ae.fromCssColorString("#F5DEB3"));Ae.WHITE=Object.freeze(Ae.fromCssColorString("#FFFFFF"));Ae.WHITESMOKE=Object.freeze(Ae.fromCssColorString("#F5F5F5"));Ae.YELLOW=Object.freeze(Ae.fromCssColorString("#FFFF00"));Ae.YELLOWGREEN=Object.freeze(Ae.fromCssColorString("#9ACD32"));Ae.TRANSPARENT=Object.freeze(new Ae(0,0,0,0));var U=Ae;function HO(e){e=e??G.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}HO.ALL=Object.freeze(new HO({color:new U(0,0,0,0),depth:1,stencil:0}));HO.prototype.execute=function(e,t){e.clear(this,t)};var si=HO;var Xie={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE:5,CESIUM_3D_TILE_CLASSIFICATION:6,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:7,OPAQUE:8,TRANSLUCENT:9,VOXELS:10,GAUSSIAN_SPLATS:11,CESIUM_3D_TILE_EDGES_DIRECT:12,OVERLAY:13,NUMBER_OF_PASSES:14};Object.freeze(Xie);var Ie=Xie;function Kie(e){e=e??G.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=e.persists??!1,this.pass=Ie.COMPUTE,this.owner=e.owner}Kie.prototype.execute=function(e){e.execute(this)};var Kl=Kie;var ta=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,o=i*2;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=o/2;n[r]=e.unpack(t,o,n[r])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,o){let r=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y);return o.x=r,o.y=a,o}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,WO),e.magnitude(WO)}static distanceSquared(t,n){return e.subtract(t,n,WO),e.magnitudeSquared(WO)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,o){return e.multiplyByScalar(n,i,Qie),o=e.multiplyByScalar(t,1-i,o),e.add(Qie,o,o)}static angleBetween(t,n){return e.normalize(t,$ie),e.normalize(n,Jie),D.acosClamped(e.dot($ie,Jie))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,bMe);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,o){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,o)&&D.equalsEpsilon(t.y,n.y,i,o)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};ta.fromCartesian3=ta.clone;ta.fromCartesian4=ta.clone;ta.packedLength=2;ta.fromArray=ta.unpack;var WO=new ta,Qie=new ta,$ie=new ta,Jie=new ta,bMe=new ta;ta.ZERO=Object.freeze(new ta(0,0));ta.ONE=Object.freeze(new ta(1,1));ta.UNIT_X=Object.freeze(new ta(1,0));ta.UNIT_Y=Object.freeze(new ta(0,1));var z=ta;var TMe=new h,CMe=new h;function EMe(e,t,n,i,o){let r=e.x,a=e.y,s=e.z,c=t.x,u=t.y,f=t.z,d=r*r*c*c,p=a*a*u*u,g=s*s*f*f,m=d+p+g,A=Math.sqrt(1/m),y=h.multiplyByScalar(e,A,TMe);if(m<i)return isFinite(A)?h.clone(y,o):void 0;let x=n.x,b=n.y,T=n.z,E=CMe;E.x=y.x*x*2,E.y=y.y*b*2,E.z=y.z*T*2;let S=(1-A)*h.magnitude(e)/(.5*h.magnitude(E)),w=0,P,O,B,L,_,C,v,I,M,N,j;do{S-=w,B=1/(1+S*x),L=1/(1+S*b),_=1/(1+S*T),C=B*B,v=L*L,I=_*_,M=C*B,N=v*L,j=I*_,P=d*C+p*v+g*I-1,O=d*M*x+p*N*b+g*j*T;let k=-2*O;w=P/k}while(Math.abs(P)>D.EPSILON12);return l(o)?(o.x=r*B,o.y=a*L,o.z=s*_,o):new h(r*B,a*L,s*_)}var ST=EMe;var hl=class hl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,o){return i=i??0,l(o)?(o.longitude=t,o.latitude=n,o.height=i,o):new hl(t,n,i)}static fromDegrees(t,n,i,o){return t=D.toRadians(t),n=D.toRadians(n),hl.fromRadians(t,n,i,o)}static fromCartesian(t,n,i){let o=l(n)?n.oneOverRadii:hl._ellipsoidOneOverRadii,r=l(n)?n.oneOverRadiiSquared:hl._ellipsoidOneOverRadiiSquared,a=l(n)?n._centerToleranceSquared:hl._ellipsoidCenterToleranceSquared,s=ST(t,o,r,a,SMe);if(!l(s))return;let c=h.multiplyComponents(s,r,vMe);c=h.normalize(c,c);let u=h.subtract(t,s,wMe),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=D.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new hl(f,d,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new hl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return hl.clone(this,t)}equals(t){return hl.equals(this,t)}equalsEpsilon(t,n){return hl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};lt(hl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),lt(hl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),lt(hl,"_ellipsoidCenterToleranceSquared",D.EPSILON1);var Iw=hl;Iw.ZERO=Object.freeze(new Iw(0,0,0));var vMe=new h,SMe=new h,wMe=new h,de=Iw;function Zie(e,t,n,i){t=t??0,n=n??0,i=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=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var ml=class e{constructor(t,n,i){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,Zie(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&Zie(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,de._ellipsoidOneOverRadii=t.oneOverRadii,de._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,de._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let o=h.unpack(t,n);return e.fromCartesian3(o,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,o=t.latitude,r=Math.cos(o),a=r*Math.cos(i),s=r*Math.sin(i),c=Math.sin(o);return l(n)||(n=new h),n.x=a,n.y=s,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,D.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=IMe,o=DMe;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,o);let r=Math.sqrt(h.dot(i,o));return h.divideByScalar(o,r,o),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(o,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let o=0;o<i;o++)n[o]=this.cartographicToCartesian(t[o],n[o]);return n}cartesianToCartographic(t,n){let i=this.scaleToGeodeticSurface(t,RMe);if(!l(i))return;let o=this.geodeticSurfaceNormal(i,PMe),r=h.subtract(t,i,OMe),a=Math.atan2(o.y,o.x),s=Math.asin(o.z),c=D.sign(h.dot(r,t))*h.magnitude(r);return l(n)?(n.longitude=a,n.latitude=s,n.height=c,n):new de(a,s,c)}cartesianArrayToCartographicArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let o=0;o<i;++o)n[o]=this.cartesianToCartographic(t[o],n[o]);return n}scaleToGeodeticSurface(t,n){return ST(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)}scaleToGeocentricSurface(t,n){l(n)||(n=new h);let i=t.x,o=t.y,r=t.z,a=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*a.x+o*o*a.y+r*r*a.z);return h.multiplyByScalar(t,s,n)}transformPositionToScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._oneOverRadii,n)}transformPositionFromScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._radii,n)}equals(t){return this===t||l(t)&&h.equals(this._radii,t._radii)}toString(){return this._radii.toString()}getSurfaceNormalIntersectionWithZAxis(t,n,i){n=n??0;let o=this._squaredXOverSquaredZ;if(l(i)||(i=new h),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new z);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,MMe),o=h.distance(t,i),r=this.minimumRadius*o/this.maximumRadius**2,a=o*r**2;return z.fromElements(1/o,1/a,n)}surfaceArea(t){let n=t.west,i=t.east,o=t.south,r=t.north;for(;i<n;)i+=D.TWO_PI;let a=this._radiiSquared,s=a.x,c=a.y,u=a.z,f=s*c;return eoe(o,r,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*eoe(n,i,function(m){let A=Math.cos(m),y=Math.sin(m);return Math.sqrt(f*g*g+u*(c*A*A+s*y*y)*p*p)})})}};ml.WGS84=Object.freeze(new ml(6378137,6378137,6356752314245179e-9));ml.UNIT_SPHERE=Object.freeze(new ml(1,1,1));ml.MOON=Object.freeze(new ml(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));ml.MARS=Object.freeze(new ml(3396190,3396190,3376200));ml._default=ml.WGS84;ml.packedLength=h.packedLength;ml.prototype.geocentricSurfaceNormal=h.normalize;var IMe=new h,DMe=new h,PMe=new h,RMe=new h,OMe=new h,MMe=new h,BMe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],LMe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function eoe(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let a=0;a<5;a++){let s=o*BMe[a];r+=LMe[a]*(n(i+s)+n(i-s))}return r*=o,r}var te=ml;var q9=class{constructor(t){this._ellipsoid=t??te.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(t,n){let i=this._semimajorAxis,o=t.longitude*i,r=t.latitude*i,a=t.height;return l(n)?(n.x=o,n.y=r,n.z=a,n):new h(o,r,a)}unproject(t,n){let i=this._oneOverSemimajorAxis,o=t.x*i,r=t.y*i,a=t.z;return l(n)?(n.longitude=o,n.latitude=r,n.height=a,n):new de(o,r,a)}},Hi=q9;var toe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(toe);var qt=toe;function NMe(e,t,n){let i=0,o=e.length-1,r,a;for(;i<=o;){if(r=~~((i+o)/2),a=n(e[r],t),a<0){i=r+1;continue}if(a>0){o=r-1;continue}return r}return~(o+1)}var Ao=NMe;function FMe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Iy=FMe;function kMe(e){return e%4===0&&e%100!==0||e%400===0}var hm=kMe;var noe=[31,28,31,30,31,30,31,31,30,31,30,31];function zMe(e,t,n,i,o,r,a,s){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,a=a??0,s=s??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=a,this.isLeapSecond=s;function A(){No.typeOf.number.greaterThanOrEquals("Year",e,1),No.typeOf.number.lessThanOrEquals("Year",e,9999),No.typeOf.number.greaterThanOrEquals("Month",t,1),No.typeOf.number.lessThanOrEquals("Month",t,12),No.typeOf.number.greaterThanOrEquals("Day",n,1),No.typeOf.number.lessThanOrEquals("Day",n,31),No.typeOf.number.greaterThanOrEquals("Hour",i,0),No.typeOf.number.lessThanOrEquals("Hour",i,23),No.typeOf.number.greaterThanOrEquals("Minute",o,0),No.typeOf.number.lessThanOrEquals("Minute",o,59),No.typeOf.bool("IsLeapSecond",s),No.typeOf.number.greaterThanOrEquals("Second",r,0),No.typeOf.number.lessThanOrEquals("Second",r,s?60:59),No.typeOf.number.greaterThanOrEquals("Millisecond",a,0),No.typeOf.number.lessThan("Millisecond",a,1e3)}function y(){let x=t===2&&hm(e)?noe[t-1]+1:noe[t-1];if(n>x)throw new _e("Month and Day represents invalid date")}}var Wg=zMe;function UMe(e,t){this.julianDate=e,this.offset=t}var uo=UMe;var ioe={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};Object.freeze(ioe);var oi=ioe;var ooe={UTC:0,TAI:1};Object.freeze(ooe);var ei=ooe;var roe=new Wg,Y9=[31,28,31,30,31,30,31,31,30,31,30,31],X9=29;function Q9(e,t){return ci.compare(e.julianDate,t.julianDate)}var wT=new uo;function qO(e){wT.julianDate=e;let t=ci.leapSeconds,n=Ao(t,wT,Q9);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&ci.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),ci.addSeconds(e,i,e)}function aoe(e,t){wT.julianDate=e;let n=ci.leapSeconds,i=Ao(n,wT,Q9);if(i<0&&(i=~i),i===0)return ci.addSeconds(e,-n[0].offset,t);if(i>=n.length)return ci.addSeconds(e,-n[i-1].offset,t);let o=ci.secondsDifference(n[i].julianDate,e);if(o===0)return ci.addSeconds(e,-n[i].offset,t);if(!(o<=1))return ci.addSeconds(e,-n[--i].offset,t)}function qg(e,t,n){let i=t/oi.SECONDS_PER_DAY|0;return e+=i,t-=oi.SECONDS_PER_DAY*i,t<0&&(e--,t+=oi.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function K9(e,t,n,i,o,r,a){let s=(t-14)/12|0,c=e+4800+s,u=(1461*c/4|0)+(367*(t-2-12*s)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*oi.SECONDS_PER_HOUR+o*oi.SECONDS_PER_MINUTE+a*oi.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var VMe=/^(\d{4})$/,jMe=/^(\d{4})-(\d{2})$/,GMe=/^(\d{4})-?(\d{3})$/,HMe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,WMe=/^(\d{4})-?(\d{2})-?(\d{2})$/,$9=/([Z+\-])?(\d{2})?:?(\d{2})?$/,qMe=/^(\d{2})(\.\d+)?/.source+$9.source,YMe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+$9.source,XMe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+$9.source;var ci=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??ei.UTC;let o=t|0;n=n+(t-o)*oi.SECONDS_PER_DAY,qg(o,n,this),i===ei.UTC&&qO(this)}static fromGregorianDate(t,n){let i=K9(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(qg(i[0],i[1],n),qO(n),n):new e(i[0],i[1],ei.UTC)}static fromDate(t,n){let i=K9(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(qg(i[0],i[1],n),qO(n),n):new e(i[0],i[1],ei.UTC)}static fromIso8601(t,n){t=t.replace(",",".");let i=t.split("T"),o,r=1,a=1,s=0,c=0,u=0,f=0,d=i[0],p=i[1],g,m;if(i=d.match(WMe),i!==null)o=+i[1],r=+i[2],a=+i[3];else if(i=d.match(jMe),i!==null)o=+i[1],r=+i[2];else if(i=d.match(VMe),i!==null)o=+i[1];else{let b;if(i=d.match(GMe),i!==null)o=+i[1],b=+i[2],m=hm(o);else if(i=d.match(HMe),i!==null){o=+i[1];let T=+i[2],E=+i[3]||0,S=new Date(Date.UTC(o,0,4));b=T*7+E-S.getUTCDay()-3}g=new Date(Date.UTC(o,0,1)),g.setUTCDate(b),r=g.getUTCMonth()+1,a=g.getUTCDate()}m=hm(o);let A;if(l(p)){i=p.match(XMe),i!==null?(s=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,A=5):(i=p.match(YMe),i!==null?(s=+i[1],c=+i[2],u=+(i[3]||0)*60,A=4):(i=p.match(qMe),i!==null&&(s=+i[1],c=+(i[2]||0)*60,A=3)));let b=i[A],T=+i[A+1],E=+(i[A+2]||0);switch(b){case"+":s=s-T,c=c-E;break;case"-":s=s+T,c=c+E;break;case"Z":break;default:c=c+new Date(Date.UTC(o,r-1,a,s,c)).getTimezoneOffset();break}}let y=u===60;for(y&&u--;c>=60;)c-=60,s++;for(;s>=24;)s-=24,a++;for(g=m&&r===2?X9:Y9[r-1];a>g;)a-=g,r++,r>12&&(r-=12,o++),g=m&&r===2?X9:Y9[r-1];for(;c<0;)c+=60,s--;for(;s<0;)s+=24,a--;for(;a<1;)r--,r<1&&(r+=12,o--),g=m&&r===2?X9:Y9[r-1],a+=g;let x=K9(o,r,a,s,c,u,f);return l(n)?(qg(x[0],x[1],n),qO(n)):n=new e(x[0],x[1],ei.UTC),y&&e.addSeconds(n,1,n),n}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,o=aoe(t,YO);l(o)||(e.addSeconds(t,-1,YO),o=aoe(YO,YO),i=!0);let r=o.dayNumber,a=o.secondsOfDay;a>=43200&&(r+=1);let s=r+68569|0,c=4*s/146097|0;s=s-((146097*c+3)/4|0)|0;let u=4e3*(s+1)/1461001|0;s=s-(1461*u/4|0)+31|0;let f=80*s/2447|0,d=s-(2447*f/80|0)|0;s=f/11|0;let p=f+2-12*s|0,g=100*(c-49)+u+s|0,m=a/oi.SECONDS_PER_HOUR|0,A=a-m*oi.SECONDS_PER_HOUR,y=A/oi.SECONDS_PER_MINUTE|0;A=A-y*oi.SECONDS_PER_MINUTE;let x=A|0,b=(A-x)/oi.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),i&&(x+=1),l(n)?(n.year=g,n.month=p,n.day=d,n.hour=m,n.minute=y,n.second=x,n.millisecond=b,n.isLeapSecond=i,n):new Wg(g,p,d,m,y,x,b,i)}static toDate(t){let n=e.toGregorianDate(t,roe),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,roe),o=i.year,r=i.month,a=i.day,s=i.hour,c=i.minute,u=i.second,f=i.millisecond;o===1e4&&r===1&&a===1&&s===0&&c===0&&u===0&&f===0&&(o=9999,r=12,a=31,s=24);let d;if(!l(n)&&f!==0){let p=f*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`}return!l(n)||n===0?`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(d=(f*.01).toFixed(n).replace(".","").slice(0,n),`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,ei.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/oi.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*oi.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,o=(t.secondsOfDay-n.secondsOfDay)/oi.SECONDS_PER_DAY;return i+o}static computeTaiMinusUtc(t){wT.julianDate=t;let n=e.leapSeconds,i=Ao(n,wT,Q9);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return qg(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let o=t.secondsOfDay+n*oi.SECONDS_PER_MINUTE;return qg(t.dayNumber,o,i)}static addHours(t,n,i){let o=t.secondsOfDay+n*oi.SECONDS_PER_HOUR;return qg(t.dayNumber,o,i)}static addDays(t,n,i){let o=t.dayNumber+n;return qg(o,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},YO=new ci(0,0,ei.TAI);ci.leapSeconds=[new uo(new ci(2441317,43210,ei.TAI),10),new uo(new ci(2441499,43211,ei.TAI),11),new uo(new ci(2441683,43212,ei.TAI),12),new uo(new ci(2442048,43213,ei.TAI),13),new uo(new ci(2442413,43214,ei.TAI),14),new uo(new ci(2442778,43215,ei.TAI),15),new uo(new ci(2443144,43216,ei.TAI),16),new uo(new ci(2443509,43217,ei.TAI),17),new uo(new ci(2443874,43218,ei.TAI),18),new uo(new ci(2444239,43219,ei.TAI),19),new uo(new ci(2444786,43220,ei.TAI),20),new uo(new ci(2445151,43221,ei.TAI),21),new uo(new ci(2445516,43222,ei.TAI),22),new uo(new ci(2446247,43223,ei.TAI),23),new uo(new ci(2447161,43224,ei.TAI),24),new uo(new ci(2447892,43225,ei.TAI),25),new uo(new ci(2448257,43226,ei.TAI),26),new uo(new ci(2448804,43227,ei.TAI),27),new uo(new ci(2449169,43228,ei.TAI),28),new uo(new ci(2449534,43229,ei.TAI),29),new uo(new ci(2450083,43230,ei.TAI),30),new uo(new ci(2450630,43231,ei.TAI),31),new uo(new ci(2451179,43232,ei.TAI),32),new uo(new ci(2453736,43233,ei.TAI),33),new uo(new ci(2454832,43234,ei.TAI),34),new uo(new ci(2456109,43235,ei.TAI),35),new uo(new ci(2457204,43236,ei.TAI),36),new uo(new ci(2457754,43237,ei.TAI),37)];var Q=ci;var woe=Na(ju(),1);function KMe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var $O=KMe;function hoe(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=hoe(o,t)),n[i]=o}return n}var qe=hoe;function moe(e,t,n){n=n??!1;let i={},o=l(e),r=l(t),a,s,c;if(o)for(a in e)e.hasOwnProperty(a)&&(s=e[a],r&&n&&typeof s=="object"&&t.hasOwnProperty(a)?(c=t[a],typeof c=="object"?i[a]=moe(s,c,n):i[a]=s):i[a]=s);if(r)for(a in t)t.hasOwnProperty(a)&&!i.hasOwnProperty(a)&&(c=t[a],i[a]=c);return i}var It=moe;function QMe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Gu=QMe;var poe=Na(ju(),1);function J9(e,t){let n;return typeof document<"u"&&(n=document),J9._implementation(e,t,n)}J9._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new poe.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Jd=J9;var goe=Na(ju(),1);function $Me(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new goe.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var JO=$Me;var _oe=Na(ju(),1);function JMe(e){let t=new _oe.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 Yg=JMe;var Aoe={};function ZMe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Aoe[t];l(i)||(i={},Aoe[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 mm=ZMe;var eBe=/^blob:/i;function tBe(e){return eBe.test(e)}var PT=tBe;var pm;function nBe(e){l(pm)||(pm=document.createElement("a")),pm.href=window.location.href;let t=pm.host,n=pm.protocol;return pm.href=e,pm.href=pm.href,n!==pm.protocol||t!==pm.host}var Dy=nBe;var iBe=/^data:/i;function oBe(e){return iBe.test(e)}var gm=oBe;function rBe(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 RT=rBe;function aBe(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,a=i.length;r<a;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var OT=aBe;function sBe(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("="),a=decodeURIComponent(r[0]),s=r[1];l(s)?s=decodeURIComponent(s):s="";let c=t[a];typeof c=="string"?t[a]=[c,s]:Array.isArray(c)?c.push(s):t[a]=s}return t}var Uf=sBe;var yoe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(yoe);var Ai=yoe;var xoe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(xoe);var ts=xoe;function ZO(e){e=e??G.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??ts.OTHER,this.serverKey=e.serverKey,this.state=Ai.UNISSUED,this.deferred=void 0,this.cancelled=!1}ZO.prototype.cancel=function(){this.cancelled=!0};ZO.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=Ai.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new ZO(this)};var Cr=ZO;function cBe(e){let t={};if(!e)return t;let n=e.split(`\r
  79. `);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let a=o.substring(0,r),s=o.substring(r+2);t[a]=s}}return t}var eM=cBe;function boe(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eM(this.responseHeaders))}boe.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var r0=boe;var nM=Na(ju(),1);function Dw(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(Dw.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});Dw.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return e7(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function e7(e,t,n,i){t.has(n)||t.set(n,new Set);let o=t.get(n);return o.has(i)?!1:(o.add(i),!0)}Dw.prototype.removeEventListener=function(e,t){let n=Z9(this,this._listeners,e,t),i=Z9(this,this._toAdd,e,t),o=n||i;return o&&this._listenerCount--,o};function Z9(e,t,n,i){let o=t.get(n);if(!o||!o.has(i))return!1;if(e._invokingListeners){if(!e7(e,e._toRemove,n,i))return!1}else o.delete(i),o.size===0&&t.delete(n);return!0}Dw.prototype.raiseEvent=function(){this._invokingListeners=!0;for(let[e,t]of this._listeners.entries())if(l(e))for(let n of t)e.apply(n,arguments);this._invokingListeners=!1;for(let[e,t]of this._toAdd.entries())for(let n of t)e7(this,this._listeners,e,n);this._toAdd.clear();for(let[e,t]of this._toRemove.entries())for(let n of t)Z9(this,this._listeners,e,n);this._toRemove.clear()};var ye=Dw;function Py(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Py.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 t7(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}Py.prototype.reserve=function(e){e=e??this._length,this._array.length=e};Py.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let a=2*(e+1),s=a-1;s<t&&n(i[s],i[e])<0?o=s:o=e,a<t&&n(i[a],i[o])<0&&(o=a),o!==e?(t7(i,o,e),e=o):r=!1}};Py.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};Py.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 a=Math.floor((o-1)/2);if(n(t[o],t[a])<0)t7(t,o,a),o=a;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};Py.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return t7(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var tM=Py;function lBe(e,t){return e.priority-t.priority}var mo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},MT=20,Nc=new tM({comparator:lBe});Nc.maximumLength=MT;Nc.reserve(MT);var _m=[],a0={},uBe=typeof document<"u"?new nM.default(document.location.href):new nM.default,iM=new ye;function fr(){}fr.maximumRequests=50;fr.maximumRequestsPerServer=18;fr.requestsByServer={};fr.throttleRequests=!0;fr.debugShowStatistics=!1;fr.requestCompletedEvent=iM;Object.defineProperties(fr,{statistics:{get:function(){return mo}},priorityHeapLength:{get:function(){return MT},set:function(e){if(e<MT)for(;Nc.length>e;){let t=Nc.pop();Ry(t)}MT=e,Nc.maximumLength=e,Nc.reserve(e)}}});function Toe(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}fr.serverHasOpenSlots=function(e,t){t=t??1;let n=fr.requestsByServer[e]??fr.maximumRequestsPerServer;return a0[e]+t<=n};fr.heapHasOpenSlots=function(e){return Nc.length+e<=MT};function Coe(e){return e.state===Ai.UNISSUED&&(e.state=Ai.ISSUED,e.deferred=Gu()),e.deferred.promise}function fBe(e){return function(t){if(e.state===Ai.CANCELLED)return;let n=e.deferred;--mo.numberOfActiveRequests,--a0[e.serverKey],iM.raiseEvent(),e.state=Ai.RECEIVED,e.deferred=void 0,n.resolve(t)}}function dBe(e){return function(t){e.state!==Ai.CANCELLED&&(++mo.numberOfFailedRequests,--mo.numberOfActiveRequests,--a0[e.serverKey],iM.raiseEvent(t),e.state=Ai.FAILED,e.deferred.reject(t))}}function Eoe(e){let t=Coe(e);return e.state=Ai.ACTIVE,_m.push(e),++mo.numberOfActiveRequests,++mo.numberOfActiveRequestsEver,++a0[e.serverKey],e.requestFunction().then(fBe(e)).catch(dBe(e)),t}function Ry(e){let t=e.state===Ai.ACTIVE;if(e.state=Ai.CANCELLED,++mo.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new re(`Request cancelled: "${e.url}"`))}t&&(--mo.numberOfActiveRequests,--a0[e.serverKey],++mo.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}fr.update=function(){let e,t,n=0,i=_m.length;for(e=0;e<i;++e){if(t=_m[e],t.cancelled&&Ry(t),t.state!==Ai.ACTIVE){++n;continue}n>0&&(_m[e-n]=t)}_m.length-=n;let o=Nc.internalArray,r=Nc.length;for(e=0;e<r;++e)Toe(o[e]);Nc.resort();let a=Math.max(fr.maximumRequests-_m.length,0),s=0;for(;s<a&&Nc.length>0;){if(t=Nc.pop(),t.cancelled){Ry(t);continue}if(t.throttleByServer&&!fr.serverHasOpenSlots(t.serverKey)){Ry(t);continue}Eoe(t),++s}hBe()};fr.getServerKey=function(e){let t=new nM.default(e);t.scheme()===""&&(t=t.absoluteTo(uBe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=a0[n];return l(i)||(a0[n]=0),n};fr.request=function(e){if(gm(e.url)||PT(e.url))return iM.raiseEvent(),e.state=Ai.RECEIVED,e.requestFunction();if(++mo.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=fr.getServerKey(e.url)),fr.throttleRequests&&e.throttleByServer&&!fr.serverHasOpenSlots(e.serverKey))return;if(!fr.throttleRequests||!e.throttle)return Eoe(e);if(_m.length>=fr.maximumRequests)return;Toe(e);let t=Nc.insert(e);if(l(t)){if(t===e)return;Ry(t)}return Coe(e)};function hBe(){fr.debugShowStatistics&&(mo.numberOfActiveRequests===0&&mo.lastNumberOfActiveRequests>0&&(mo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${mo.numberOfAttemptedRequests}`),mo.numberOfAttemptedRequests=0),mo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${mo.numberOfCancelledRequests}`),mo.numberOfCancelledRequests=0),mo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${mo.numberOfCancelledActiveRequests}`),mo.numberOfCancelledActiveRequests=0),mo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${mo.numberOfFailedRequests}`),mo.numberOfFailedRequests=0)),mo.lastNumberOfActiveRequests=mo.numberOfActiveRequests)}fr.clearForSpecs=function(){for(;Nc.length>0;){let t=Nc.pop();Ry(t)}let e=_m.length;for(let t=0;t<e;++t)Ry(_m[t]);_m.length=0,a0={},mo.numberOfAttemptedRequests=0,mo.numberOfActiveRequests=0,mo.numberOfCancelledRequests=0,mo.numberOfCancelledActiveRequests=0,mo.numberOfFailedRequests=0,mo.numberOfActiveRequestsEver=0,mo.lastNumberOfActiveRequests=0};fr.numberOfActiveRequestsByServer=function(e){return a0[e]};fr.requestHeap=Nc;var pl=fr;var voe=Na(ju(),1);var Pw={},BT={};Pw.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(BT[n])||(BT[n]=!0)};Pw.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(BT[n])&&delete BT[n]};function mBe(e){let t=new voe.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}}Pw.contains=function(e){let t=mBe(e);return!!(l(t)&&l(BT[t]))};Pw.clear=function(){BT={}};var Rw=Pw;var Ioe=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function Lt(e){e=e??G.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Am(e.templateValues,{}),this._queryParameters=Am(e.queryParameters,{}),this.headers=Am(e.headers,{}),this.request=e.request??new Cr,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Am(e,t){return l(e)?qe(e):t}Lt.createIfNeeded=function(e){return e instanceof Lt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Lt({url:e})};var LT;Lt.supportsImageBitmapOptions=function(){return l(LT)?LT:typeof createImageBitmap!="function"?(LT=Promise.resolve(!1),LT):(LT=Lt.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=mm(t[0]),i=mm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),LT)};Object.defineProperties(Lt,{isBlobSupported:{get:function(){return Ioe}}});Object.defineProperties(Lt.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 Yg(this._url)}},isDataUri:{get:function(){return gm(this._url)}},isBlobUri:{get:function(){return PT(this._url)}},isCrossOriginUrl:{get:function(){return Dy(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Lt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Lt.prototype.parseUrl=function(e,t,n,i){let o=new woe.default(e),r=pBe(o.query());this._queryParameters=t?rM(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Jd(i))),this._url=o.toString()};function pBe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Uf(e)}function rM(e,t,n){if(!n)return It(e,t);let i=qe(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],a=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(a)):i[o]=Array.isArray(a)?a.slice():a}return i}Lt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${gBe(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 a=i[r];return l(a)?encodeURIComponent(a):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function gBe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${OT(e)}`}Lt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=rM(this._queryParameters,e,!1):this._queryParameters=rM(e,this._queryParameters,!1)};Lt.prototype.appendQueryParameters=function(e){this._queryParameters=rM(e,this._queryParameters,!0)};Lt.prototype.setTemplateValues=function(e,t){t?this._templateValues=It(this._templateValues,e):this._templateValues=It(e,this._templateValues)};Lt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=It(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=It(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=It(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};Lt.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})};Lt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=qe(this._queryParameters),e._templateValues=qe(this._templateValues),e.headers=qe(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Lt({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})};Lt.prototype.getBaseUri=function(e){return JO(this.getUrlComponent(e),e)};Lt.prototype.appendForwardSlash=function(){this._url=$O(this._url)};Lt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Lt.fetchArrayBuffer=function(e){return new Lt(e).fetchArrayBuffer()};Lt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Lt.fetchBlob=function(e){return new Lt(e).fetchBlob()};Lt.prototype.fetchImage=function(e){e=e??G.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(n7(this.request),!Ioe||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let a,s,c,u;return Lt.supportsImageBitmapOptions().then(function(f){return a=f,s=a&&t,r}).then(function(f){if(!l(f))return;if(u=f,s)return Lt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let d=window.URL.createObjectURL(f);return c=new Lt({url:d}),c._fetchImage({flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,s||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};Lt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let s=!1;!t.isDataUri&&!t.isBlobUri&&(s=t.isCrossOriginUrl);let c=Gu();return Lt._Implementations.createImage(r,s,c,n,i,o),c.promise};let a=pl.request(r);if(l(a))return a.catch(function(s){return r.state!==Ai.FAILED?Promise.reject(s):t.retryOnError(s).then(function(c){return c?(r.state=Ai.UNISSUED,r.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(s)})})};Lt.fetchImage=function(e){return new Lt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Lt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Lt.fetchText=function(e){return new Lt(e).fetchText()};Lt.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)})};Lt.fetchJson=function(e){return new Lt(e).fetchJson()};Lt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Lt.fetchXML=function(e){return new Lt(e).fetchXML()};Lt.prototype.fetchJsonp=function(e){e=e??"callback",n7(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Doe(this,e,t)};function Doe(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 s=Gu();return window[n]=function(c){s.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Lt._Implementations.loadAndExecuteScript(r,n,s),s.promise};let a=pl.request(o);if(l(a))return a.catch(function(s){return o.state!==Ai.FAILED?Promise.reject(s):e.retryOnError(s).then(function(c){return c?(o.state=Ai.UNISSUED,o.deferred=void 0,Doe(e,t,n)):Promise.reject(s)})})}Lt.fetchJsonp=function(e){return new Lt(e).fetchJsonp(e.callbackParameterName)};Lt.prototype._makeRequest=function(e){let t=this;n7(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,a=It(e.headers,t.headers),s=e.overrideMimeType,c=e.method,u=e.data,f=Gu(),d=Lt._Implementations.loadWithXhr(i,r,c,u,a,f,s);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=pl.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!==Ai.FAILED?Promise.reject(r):t.retryOnError(r).then(function(a){return a?(n.state=Ai.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function n7(e){if(e.state===Ai.ISSUED||e.state===Ai.ACTIVE)throw new re("The Resource is already being fetched.");e.state=Ai.UNISSUED,e.deferred=void 0}var _Be=/^data:(.*?)(;base64)?,(.*)$/;function oM(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Soe(e,t){let n=oM(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 ABe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,a;switch(t){case"":case"text":return oM(i,o);case"arraybuffer":return Soe(i,o);case"blob":return r=Soe(i,o),new Blob([r],{type:n});case"document":return a=new DOMParser,a.parseFromString(oM(i,o),n);case"json":return JSON.parse(oM(i,o));default:}}Lt.prototype.fetch=function(e){return e=Am(e,{}),e.method="GET",this._makeRequest(e)};Lt.fetch=function(e){return new Lt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.delete=function(e){return e=Am(e,{}),e.method="DELETE",this._makeRequest(e)};Lt.delete=function(e){return new Lt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Lt.prototype.head=function(e){return e=Am(e,{}),e.method="HEAD",this._makeRequest(e)};Lt.head=function(e){return new Lt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.options=function(e){return e=Am(e,{}),e.method="OPTIONS",this._makeRequest(e)};Lt.options=function(e){return new Lt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.post=function(e,t){return No.defined("data",e),t=Am(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Lt.post=function(e){return new Lt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.put=function(e,t){return No.defined("data",e),t=Am(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Lt.put=function(e){return new Lt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.patch=function(e,t){return No.defined("data",e),t=Am(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Lt.patch=function(e){return new Lt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt._Implementations={};Lt._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&&(Rw.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Lt._Implementations.createImage=function(e,t,n,i,o,r,a){let s=e.url;Lt.supportsImageBitmapOptions().then(function(c){if(!(c&&r)){Lt._Implementations.loadImageElement(s,t,n);return}let u="blob",f="GET",d=Gu(),p=Lt._Implementations.loadWithXhr(s,u,f,void 0,a,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!l(g)){n.reject(new re(`Successfully retrieved ${s} but it contained no content.`));return}return Lt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};Lt.createImageBitmapFromBlob=function(e,t){return No.defined("options",t),No.typeOf.bool("options.flipY",t.flipY),No.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),No.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function yBe(e,t,n,i,o,r,a){fetch(e,{method:n,headers:o}).then(async s=>{if(!s.ok){let c={};s.headers.forEach((u,f)=>{c[f]=u}),r.reject(new r0(s.status,s,c));return}switch(t){case"text":r.resolve(s.text());break;case"json":r.resolve(s.json());break;default:r.resolve(new Uint8Array(await s.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new r0)})}var xBe=typeof XMLHttpRequest>"u";Lt._Implementations.loadWithXhr=function(e,t,n,i,o,r,a){let s=_Be.exec(e);if(s!==null){r.resolve(ABe(s,t));return}if(xBe){yBe(e,t,n,i,o,r,a);return}let c=new XMLHttpRequest;if(Rw.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(a)&&l(c.overrideMimeType)&&c.overrideMimeType(a),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new r0(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(A){let y=A.split(": "),x=y.shift();m[x]=y.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||d===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new re("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new r0)},c.send(i),c};Lt._Implementations.loadAndExecuteScript=function(e,t,n){return RT(e,t).catch(function(i){n.reject(i)})};Lt._DefaultImplementations={};Lt._DefaultImplementations.createImage=Lt._Implementations.createImage;Lt._DefaultImplementations.loadWithXhr=Lt._Implementations.loadWithXhr;Lt._DefaultImplementations.loadAndExecuteScript=Lt._Implementations.loadAndExecuteScript;Lt.DEFAULT=Object.freeze(new Lt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=Lt;function Mw(e){e=e??G.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=e.addNewLeapSeconds??!0,l(e.data)?Poe(this,e.data):Poe(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Mw.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new re(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new Mw({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};Mw.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 Iy(0,0,0,0,0),t}});Mw.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Iy(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 s=n[i],c=n[i+1],u=Q.lessThanOrEquals(s,e),f=!l(c),d=f||Q.greaterThanOrEquals(c,e);if(u&&d)return o=i,!f&&c.equals(e)&&++o,r=o+1,Ooe(this,n,this._samples,e,o,r,t),t}let a=Ao(n,e,Q.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,o=a,r=a):(r=~a,o=r-1,o<0&&(o=0)),this._lastIndex=o,Ooe(this,n,this._samples,e,o,r,t),t};function bBe(e,t){return Q.compare(e.julianDate,t)}function Poe(e,t){if(!l(t.columnNames))throw new re("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new re("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"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||a<0||s<0||c<0)throw new re("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=s,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let A=u[g+n],y=u[g+c],x=A+oi.MODIFIED_JULIAN_DATE_DIFFERENCE,b=new Q(x,y,ei.TAI);if(f.push(b),p){if(y!==d&&l(d)){let T=Q.leapSeconds,E=Ao(T,b,bBe);if(E<0){let S=new uo(b,y);T.splice(~E,0,S)}}d=y}}}function Roe(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 Ow(e,t,n){return t+e*(n-t)}function Ooe(e,t,n,i,o,r,a){let s=e._columnCount;if(r>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return Roe(e,n,o,s,a),a;if(i.equals(u))return Roe(e,n,r,s,a),a;let f=Q.secondsDifference(i,c)/Q.secondsDifference(u,c),d=o*s,p=r*s,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],A=m-g;if(A>.5||A<-.5){let y=n[d+e._taiMinusUtcSecondsColumn],x=n[p+e._taiMinusUtcSecondsColumn];y!==x&&(u.equals(i)?g=m:m-=x-y)}return a.xPoleWander=Ow(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),a.yPoleWander=Ow(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),a.xPoleOffset=Ow(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=Ow(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=Ow(f,g,m),a}var aM=Mw;function Fc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Fc.fromQuaternion=function(e,t){l(t)||(t=new Fc);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),a=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(a,r),t.roll=Math.atan2(o,i),t.pitch=-D.asinClamped(n),t};Fc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Fc),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};Fc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Fc(e.heading,e.pitch,e.roll)};Fc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Fc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};Fc.prototype.clone=function(e){return Fc.clone(this,e)};Fc.prototype.equals=function(e){return Fc.equals(this,e)};Fc.prototype.equalsEpsilon=function(e,t,n){return Fc.equalsEpsilon(this,e,t,n)};Fc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var kc=Fc;var Moe=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function TBe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=Moe.exec(i);if(o!==null)return o[1]}}var sM;function Boe(e){return typeof document>"u"?e:(l(sM)||(sM=document.createElement("a")),sM.href=e,sM.href)}var Oy;function Loe(){if(l(Oy))return Oy;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=Jd(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(DO.toUrl)?e=Jd("..",My("Core/buildModuleUrl.js")):e=TBe(),Oy=new De({url:Boe(e)}),Oy.appendForwardSlash(),Oy}function CBe(e){return Boe(DO.toUrl(`../${e}`))}function Noe(e){return Loe().getDerivedResource({url:e}).url}var cM;function My(e){return l(cM)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(DO.toUrl)?cM=CBe:cM=Noe),cM(e)}My._cesiumScriptRegex=Moe;My._buildModuleUrlFromBaseUrl=Noe;My._clearBaseResource=function(){Oy=void 0};My.setBaseUrl=function(e){Oy=De.DEFAULT.getDerivedResource({url:e})};My.getCesiumBaseUrl=Loe;var Xt=My;function EBe(e,t,n){this.x=e,this.y=t,this.s=n}var NT=EBe;function lM(e){e=e??G.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new Q(this._sampleZeroJulianEphemerisDate,0,ei.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=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 a=0;a<=t;++a)a!==r&&(n[r]*=r-a);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var vBe=new Q(0,0,ei.TAI);function i7(e,t,n){let i=vBe;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}lM.prototype.preload=function(e,t,n,i){let o=i7(this,e,t),r=i7(this,n,i),a=o/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let s=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);let c=a/this._samplesPerXysFile|0,u=s/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(o7(this,d));return Promise.all(f)};lM.prototype.computeXysRadians=function(e,t,n){let i=i7(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,a=o-(r/2|0);a<0&&(a=0);let s=a+r;s>=this._totalSamples&&(s=this._totalSamples-1,a=s-r,a<0&&(a=0));let c=!1,u=this._samples;if(l(u[a*3])||(o7(this,a/this._samplesPerXysFile|0),c=!0),l(u[s*3])||(o7(this,s/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new NT(0,0,0);let f=i-a*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,A,y;for(A=0;A<=r;++A)d[A]=f-m[A];for(A=0;A<=r;++A){for(g[A]=1,y=0;y<=r;++y)y!==A&&(g[A]*=d[y]);g[A]*=p[A];let x=(a+A)*3;n.x+=g[A]*u[x++],n.y+=g[A]*u[x++],n.s+=g[A]*u[x]}return n};lM.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let o=0;o<t.length;++o)this._samples[i+o]=t[o]};async function SBe(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function o7(e,t){if(l(e._chunkDownloadsInProgress[t]))return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:Xt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=SBe(n,t,e);return e._chunkDownloadsInProgress[t]=o,o}var uM=lM;function ct(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var Bw=new h;ct.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);Bw=h.normalize(e,Bw);let r=Bw.x*o,a=Bw.y*o,s=Bw.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=a,n.z=s,n.w=c,n):new ct(r,a,s,c)};var wBe=[1,2,0],IBe=new Array(3);ct.fromRotationMatrix=function(e,t){let n,i,o,r,a,s=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=s+c+u;if(f>0)n=Math.sqrt(f+1),a=.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 d=wBe,p=0;c>s&&(p=1),u>s&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let A=IBe;A[p]=.5*n,n=.5/n,a=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,A[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,A[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-A[0],o=-A[1],r=-A[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=a,t):new ct(i,o,r,a)};var Foe=new ct,koe=new ct,r7=new ct,zoe=new ct;ct.fromHeadingPitchRoll=function(e,t){return zoe=ct.fromAxisAngle(h.UNIT_X,e.roll,Foe),r7=ct.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=ct.multiply(r7,zoe,r7),koe=ct.fromAxisAngle(h.UNIT_Z,-e.heading,Foe),ct.multiply(koe,t,t)};var fM=new h,a7=new h,Zd=new ct,Uoe=new ct,dM=new ct;ct.packedLength=4;ct.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ct.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ct),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ct.packedInterpolationLength=3;ct.convertPackedArrayForInterpolation=function(e,t,n,i){ct.unpack(e,n*4,dM),ct.conjugate(dM,dM);for(let o=0,r=n-t+1;o<r;o++){let a=o*3;ct.unpack(e,(t+o)*4,Zd),ct.multiply(Zd,dM,Zd),Zd.w<0&&ct.negate(Zd,Zd),ct.computeAxis(Zd,fM);let s=ct.computeAngle(Zd);l(i)||(i=[]),i[a]=fM.x*s,i[a+1]=fM.y*s,i[a+2]=fM.z*s}};ct.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new ct),h.fromArray(e,0,a7);let r=h.magnitude(a7);return ct.unpack(t,i*4,Uoe),r===0?ct.clone(ct.IDENTITY,Zd):ct.fromAxisAngle(a7,r,Zd),ct.multiply(Zd,Uoe,o)};ct.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 ct(e.x,e.y,e.z,e.w)};ct.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};ct.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};ct.magnitude=function(e){return Math.sqrt(ct.magnitudeSquared(e))};ct.normalize=function(e,t){let n=1/ct.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,a=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=a,t};ct.inverse=function(e,t){let n=ct.magnitudeSquared(e);return t=ct.conjugate(e,t),ct.multiplyByScalar(t,1/n,t)};ct.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};ct.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};ct.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};ct.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};ct.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,a=e.w,s=t.x,c=t.y,u=t.z,f=t.w,d=a*s+i*f+o*u-r*c,p=a*c-i*u+o*f+r*s,g=a*u+i*c-o*s+r*f,m=a*f-i*s-o*c-r*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};ct.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};ct.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};ct.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<D.EPSILON6||Math.abs(n+1)<D.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};ct.computeAngle=function(e){return Math.abs(e.w-1)<D.EPSILON6?0:2*Math.acos(e.w)};var s7=new ct;ct.lerp=function(e,t,n,i){return s7=ct.multiplyByScalar(t,n,s7),i=ct.multiplyByScalar(e,1-n,i),ct.add(s7,i,i)};var Voe=new ct,c7=new ct,l7=new ct;ct.slerp=function(e,t,n,i){let o=ct.dot(e,t),r=t;if(o<0&&(o=-o,r=Voe=ct.negate(t,Voe)),1-o<D.EPSILON6)return ct.lerp(e,r,n,i);let a=Math.acos(o);return c7=ct.multiplyByScalar(e,Math.sin((1-n)*a),c7),l7=ct.multiplyByScalar(r,Math.sin(n*a),l7),i=ct.add(c7,l7,i),ct.multiplyByScalar(i,1/Math.sin(a),i)};ct.log=function(e,t){let n=D.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};ct.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 DBe=new h,PBe=new h,Lw=new ct,FT=new ct;ct.computeInnerQuadrangle=function(e,t,n,i){let o=ct.conjugate(t,Lw);ct.multiply(o,n,FT);let r=ct.log(FT,DBe);ct.multiply(o,e,FT);let a=ct.log(FT,PBe);return h.add(r,a,r),h.multiplyByScalar(r,.25,r),h.negate(r,r),ct.exp(r,Lw),ct.multiply(t,Lw,i)};ct.squad=function(e,t,n,i,o,r){let a=ct.slerp(e,t,o,Lw),s=ct.slerp(n,i,o,FT);return ct.slerp(a,s,2*o*(1-o),r)};var RBe=new ct,joe=1.9011074535173003,hM=cn.supportsTypedArrays()?new Float32Array(8):[],mM=cn.supportsTypedArrays()?new Float32Array(8):[],s0=cn.supportsTypedArrays()?new Float32Array(8):[],c0=cn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;hM[e]=1/(t*n),mM[e]=t/n}hM[7]=joe/136;mM[7]=joe*8/17;ct.fastSlerp=function(e,t,n,i){let o=ct.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let a=o-1,s=1-n,c=n*n,u=s*s;for(let g=7;g>=0;--g)s0[g]=(hM[g]*c-mM[g])*a,c0[g]=(hM[g]*u-mM[g])*a;let f=r*n*(1+s0[0]*(1+s0[1]*(1+s0[2]*(1+s0[3]*(1+s0[4]*(1+s0[5]*(1+s0[6]*(1+s0[7])))))))),d=s*(1+c0[0]*(1+c0[1]*(1+c0[2]*(1+c0[3]*(1+c0[4]*(1+c0[5]*(1+c0[6]*(1+c0[7])))))))),p=ct.multiplyByScalar(e,d,RBe);return ct.multiplyByScalar(t,f,i),ct.add(p,i,i)};ct.fastSquad=function(e,t,n,i,o,r){let a=ct.fastSlerp(e,t,o,Lw),s=ct.fastSlerp(n,i,o,FT);return ct.fastSlerp(a,s,2*o*(1-o),r)};ct.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};ct.equalsEpsilon=function(e,t,n){return n=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};ct.ZERO=Object.freeze(new ct(0,0,0,0));ct.IDENTITY=Object.freeze(new ct(0,0,0,1));ct.prototype.clone=function(e){return ct.clone(this,e)};ct.prototype.equals=function(e){return ct.equals(this,e)};ct.prototype.equalsEpsilon=function(e,t){return ct.equalsEpsilon(this,e,t)};ct.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=ct;var li={},u7={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"}},kT={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},f7={},Ql={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Xg=new h,Kg=new h,Qg=new h;li.localFrameToFixedFrameGenerator=function(e,t){if(!u7.hasOwnProperty(e)||!u7[e].hasOwnProperty(t))throw new _e("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=u7[e][t],i,o=e+t;return l(f7[o])?i=f7[o]:(i=function(r,a,s){if(l(s)||(s=new R),h.equalsEpsilon(r,h.ZERO,D.EPSILON14))h.unpack(kT[e],0,Xg),h.unpack(kT[t],0,Kg),h.unpack(kT[n],0,Qg);else if(D.equalsEpsilon(r.x,0,D.EPSILON14)&&D.equalsEpsilon(r.y,0,D.EPSILON14)){let c=D.sign(r.z);h.unpack(kT[e],0,Xg),e!=="east"&&e!=="west"&&h.multiplyByScalar(Xg,c,Xg),h.unpack(kT[t],0,Kg),t!=="east"&&t!=="west"&&h.multiplyByScalar(Kg,c,Kg),h.unpack(kT[n],0,Qg),n!=="east"&&n!=="west"&&h.multiplyByScalar(Qg,c,Qg)}else{a=a??te.default,a.geodeticSurfaceNormal(r,Ql.up);let c=Ql.up,u=Ql.east;u.x=-r.y,u.y=r.x,u.z=0,h.normalize(u,Ql.east),h.cross(c,u,Ql.north),h.multiplyByScalar(Ql.up,-1,Ql.down),h.multiplyByScalar(Ql.east,-1,Ql.west),h.multiplyByScalar(Ql.north,-1,Ql.south),Xg=Ql[e],Kg=Ql[t],Qg=Ql[n]}return s[0]=Xg.x,s[1]=Xg.y,s[2]=Xg.z,s[3]=0,s[4]=Kg.x,s[5]=Kg.y,s[6]=Kg.z,s[7]=0,s[8]=Qg.x,s[9]=Qg.y,s[10]=Qg.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},f7[o]=i),i};li.eastNorthUpToFixedFrame=li.localFrameToFixedFrameGenerator("east","north");li.northEastDownToFixedFrame=li.localFrameToFixedFrameGenerator("north","east");li.northUpEastToFixedFrame=li.localFrameToFixedFrameGenerator("north","up");li.northWestUpToFixedFrame=li.localFrameToFixedFrameGenerator("north","west");var OBe=new Le,MBe=new h(1,1,1),BBe=new R;li.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??li.eastNorthUpToFixedFrame;let r=Le.fromHeadingPitchRoll(t,OBe),a=R.fromTranslationQuaternionRotationScale(h.ZERO,r,MBe,BBe);return o=i(e,n,o),R.multiply(o,a,o)};var LBe=new R,NBe=new $;li.headingPitchRollQuaternion=function(e,t,n,i,o){let r=li.headingPitchRollToFixedFrame(e,t,n,i,LBe),a=R.getMatrix3(r,NBe);return Le.fromRotationMatrix(a,o)};var FBe=new h(1,1,1),kBe=new h,Goe=new R,zBe=new R,UBe=new $,VBe=new Le;li.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??te.default,n=n??li.eastNorthUpToFixedFrame,l(i)||(i=new kc);let o=R.getTranslation(e,kBe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=R.inverseTransformation(n(o,t,Goe),Goe),a=R.setScale(e,FBe,zBe);a=R.setTranslation(a,h.ZERO,a),r=R.multiply(r,a,r);let s=Le.fromRotationMatrix(R.getMatrix3(r,UBe),VBe);return s=Le.normalize(s,s),kc.fromQuaternion(s,i)};var jBe=6*3600+2460+50.54841,GBe=8640184812866e-6,HBe=.093104,WBe=-62e-7,qBe=11772758384668e-32,YBe=72921158553e-15,XBe=D.TWO_PI/86400,pM=new Q;li.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=li.computeIcrfToFixedMatrix(e,t);return l(n)||(n=li.computeTemeToPseudoFixedMatrix(e,t)),n};li.computeTemeToPseudoFixedMatrix=function(e,t){pM=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),pM);let n=pM.dayNumber,i=pM.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/oi.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/oi.DAYS_PER_JULIAN_CENTURY;let s=(jBe+o*(GBe+o*(HBe+o*WBe)))*XBe%D.TWO_PI,c=YBe+qBe*(n-24515455e-1),u=(i+oi.SECONDS_PER_DAY*.5)%oi.SECONDS_PER_DAY,f=s+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};li.iau2006XysData=new uM;li.earthOrientationParameters=aM.NONE;var m7=32.184,KBe=2451545;li.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+m7,i=e.stop.dayNumber,o=e.stop.secondsOfDay+m7;return li.iau2006XysData.preload(t,n,i,o)};li.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=li.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var QBe=32.184,$Be=2451545,gM=new kc,JBe=new $,ZBe=new Q;li.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Q.addSeconds(e,QBe,ZBe),i=Q.totalDays(n)-$Be,o=D.toRadians(12.112)-D.toRadians(.052992)*i,r=D.toRadians(24.224)-D.toRadians(.105984)*i,a=D.toRadians(227.645)+D.toRadians(13.012)*i,s=D.toRadians(261.105)+D.toRadians(13.340716)*i,c=D.toRadians(358)+D.toRadians(.9856)*i;return gM.pitch=D.toRadians(180)-D.toRadians(3.878)*Math.sin(o)-D.toRadians(.12)*Math.sin(r)+D.toRadians(.07)*Math.sin(a)-D.toRadians(.017)*Math.sin(s),gM.roll=D.toRadians(66.53-90)+D.toRadians(1.543)*Math.cos(o)+D.toRadians(.24)*Math.cos(r)-D.toRadians(.028)*Math.cos(a)+D.toRadians(.007)*Math.cos(s),gM.heading=D.toRadians(244.375-90)+D.toRadians(13.17635831)*i+D.toRadians(3.558)*Math.sin(o)+D.toRadians(.121)*Math.sin(r)-D.toRadians(.064)*Math.sin(a)+D.toRadians(.016)*Math.sin(s)+D.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(gM,JBe)};li.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=li.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var eLe=new NT(0,0,0),tLe=new Iy(0,0,0,0,0,0),d7=new $,h7=new $;li.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=li.earthOrientationParameters.compute(e,tLe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+m7,r=li.iau2006XysData.computeXysRadians(i,o,eLe);if(!l(r))return;let a=r.x+n.xPoleOffset,s=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-a*a-s*s)),u=d7;u[0]=1-c*a*a,u[3]=-c*a*s,u[6]=a,u[1]=-c*a*s,u[4]=1-c*s*s,u[7]=s,u[2]=-a,u[5]=-s,u[8]=1-c*(a*a+s*s);let f=$.fromRotationZ(-r.s,h7),d=$.multiply(u,f,d7),p=e.dayNumber,g=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,A=g/oi.SECONDS_PER_DAY,y=.779057273264+A+.00273781191135448*(m+A);y=y%1*D.TWO_PI;let x=$.fromRotationZ(y,h7),b=$.multiply(d,x,d7),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),S=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),P=i-KBe+o/oi.SECONDS_PER_DAY;P/=36525;let O=-47e-6*P*D.RADIANS_PER_DEGREE/3600,B=Math.cos(O),L=Math.sin(O),_=h7;return _[0]=T*B,_[1]=T*L,_[2]=S,_[3]=-E*L+w*S*B,_[4]=E*B+w*S*L,_[5]=-w*T,_[6]=-w*L-E*S*B,_[7]=w*B-E*S*L,_[8]=E*T,$.multiply(b,_,t)};var nLe=new se;li.pointToWindowCoordinates=function(e,t,n,i){return i=li.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};li.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new z);let o=nLe;return R.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),R.multiplyByVector(t,o,o),z.fromCartesian4(o,i)};var iLe=new h,oLe=new h,rLe=new h;li.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??te.default).geodeticSurfaceNormal(e,iLe),r=h.cross(t,o,oLe);h.equalsEpsilon(r,h.ZERO,D.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let a=h.cross(r,t,rLe);return h.normalize(a,a),h.cross(t,a,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]=a.x,i[7]=a.y,i[8]=a.z,i};li.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new R(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var Hoe=new de,p7=new h,aLe=new h,sLe=new $,g7=new R,Woe=new R;li.basisTo2D=function(e,t,n){let i=R.getTranslation(t,aLe),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,p7);else{let f=o.cartesianToCartographic(i,Hoe);r=e.project(f,p7),h.fromElements(r.z,r.x,r.y,r)}let a=li.eastNorthUpToFixedFrame(i,o,g7),s=R.inverseTransformation(a,Woe),c=R.getMatrix3(t,sLe),u=R.multiplyByMatrix3(s,c,n);return R.multiply(li.SWIZZLE_3D_TO_2D_MATRIX,u,n),R.setTranslation(n,r,n),n};li.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=li.eastNorthUpToFixedFrame(t,i,g7),r=R.inverseTransformation(o,Woe),a=i.cartesianToCartographic(t,Hoe),s=e.project(a,p7);h.fromElements(s.z,s.x,s.y,s);let c=R.fromTranslation(s,g7);return R.multiply(li.SWIZZLE_3D_TO_2D_MATRIX,r,n),R.multiply(c,n,n),n};var pt=li;var zT=class e{constructor(t,n,i,o){this.west=t??0,this.south=n??0,this.east=i??0,this.north=o??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n<i&&(n+=D.TWO_PI),n-i}static computeHeight(t){return t.north-t.south}static fromDegrees(t,n,i,o,r){return t=D.toRadians(t??0),n=D.toRadians(n??0),i=D.toRadians(i??0),o=D.toRadians(o??0),l(r)?(r.west=t,r.south=n,r.east=i,r.north=o,r):new e(t,n,i,o)}static fromRadians(t,n,i,o,r){return l(r)?(r.west=t??0,r.south=n??0,r.east=i??0,r.north=o??0,r):new e(t,n,i,o)}static fromCartographicArray(t,n){let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=t.length;u<f;u++){let d=t[u];i=Math.min(i,d.longitude),o=Math.max(o,d.longitude),s=Math.min(s,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+D.TWO_PI;r=Math.min(r,p),a=Math.max(a,p)}return o-i>a-r&&(i=r,o=a,o>D.PI&&(o=o-D.TWO_PI),i>D.PI&&(i=i-D.TWO_PI)),l(n)?(n.west=i,n.south=s,n.east=o,n.north=c,n):new e(i,s,o,c)}static fromCartesianArray(t,n,i){n=n??te.default;let o=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let f=0,d=t.length;f<d;f++){let p=n.cartesianToCartographic(t[f]);o=Math.min(o,p.longitude),r=Math.max(r,p.longitude),c=Math.min(c,p.latitude),u=Math.max(u,p.latitude);let g=p.longitude>=0?p.longitude:p.longitude+D.TWO_PI;a=Math.min(a,g),s=Math.max(s,g)}return r-o>s-a&&(o=a,r=s,r>D.PI&&(r=r-D.TWO_PI),o>D.PI&&(o=o-D.TWO_PI)),l(i)?(i.west=o,i.south=c,i.east=r,i.north=u,i):new e(o,c,r,u)}static fromBoundingSphere(t,n,i){let o=t.center,r=t.radius;if(l(n)||(n=te.default),l(i)||(i=new e),h.equals(o,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let a=pt.eastNorthUpToFixedFrame(o,n,cLe),s=R.multiplyByPointAsVector(a,h.UNIT_X,lLe);h.normalize(s,s);let c=R.multiplyByPointAsVector(a,h.UNIT_Y,uLe);h.normalize(c,c),h.multiplyByScalar(c,r,c),h.multiplyByScalar(s,r,s);let u=h.negate(c,dLe),f=h.negate(s,fLe),d=_7,p=d[0];return h.add(o,c,p),p=d[1],h.add(o,f,p),p=d[2],h.add(o,u,p),p=d[3],h.add(o,s,p),d[4]=o,e.fromCartesianArray(d,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new de(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new de(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new de(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new de(t.east,t.south)}static center(t,n){let i=t.east,o=t.west;i<o&&(i+=D.TWO_PI);let r=D.negativePiToPi((o+i)*.5),a=(t.south+t.north)*.5;return l(n)?(n.longitude=r,n.latitude=a,n.height=0,n):new de(r,a)}static intersection(t,n,i){let o=t.east,r=t.west,a=n.east,s=n.west;o<r&&a>0?o+=D.TWO_PI:a<s&&o>0&&(a+=D.TWO_PI),o<r&&s<0?s+=D.TWO_PI:a<s&&r<0&&(r+=D.TWO_PI);let c=D.negativePiToPi(Math.max(r,s)),u=D.negativePiToPi(Math.min(o,a));if((t.west<t.east||n.west<n.east)&&u<=c)return;let f=Math.max(t.south,n.south),d=Math.min(t.north,n.north);if(!(f>=d))return l(i)?(i.west=c,i.south=f,i.east=u,i.north=d,i):new e(c,f,u,d)}static simpleIntersection(t,n,i){let o=Math.max(t.west,n.west),r=Math.max(t.south,n.south),a=Math.min(t.east,n.east),s=Math.min(t.north,n.north);if(!(r>=s||o>=a))return l(i)?(i.west=o,i.south=r,i.east=a,i.north=s,i):new e(o,r,a,s)}static union(t,n,i){l(i)||(i=new e);let o=t.east,r=t.west,a=n.east,s=n.west;o<r&&a>0?o+=D.TWO_PI:a<s&&o>0&&(a+=D.TWO_PI),o<r&&s<0?s+=D.TWO_PI:a<s&&r<0&&(r+=D.TWO_PI);let c=D.negativePiToPi(Math.min(r,s)),u=D.negativePiToPi(Math.max(o,a));return i.west=c,i.south=Math.min(t.south,n.south),i.east=u,i.north=Math.max(t.north,n.north),i}static expand(t,n,i){return l(i)||(i=new e),i.west=Math.min(t.west,n.longitude),i.south=Math.min(t.south,n.latitude),i.east=Math.max(t.east,n.longitude),i.north=Math.max(t.north,n.latitude),i}static contains(t,n){let i=n.longitude,o=n.latitude,r=t.west,a=t.east;return a<r&&(a+=D.TWO_PI,i<0&&(i+=D.TWO_PI)),(i>r||D.equalsEpsilon(i,r,D.EPSILON14))&&(i<a||D.equalsEpsilon(i,a,D.EPSILON14))&&o>=t.south&&o<=t.north}static subsample(t,n,i,o){n=n??te.default,i=i??0,l(o)||(o=[]);let r=0,a=t.north,s=t.south,c=t.east,u=t.west,f=hLe;f.height=i,f.longitude=u,f.latitude=a,o[r]=n.cartographicToCartesian(f,o[r]),r++,f.longitude=c,o[r]=n.cartographicToCartesian(f,o[r]),r++,f.latitude=s,o[r]=n.cartographicToCartesian(f,o[r]),r++,f.longitude=u,o[r]=n.cartographicToCartesian(f,o[r]),r++,a<0?f.latitude=a:s>0?f.latitude=s:f.latitude=0;for(let d=1;d<8;++d)f.longitude=-Math.PI+d*D.PI_OVER_TWO,e.contains(t,f)&&(o[r]=n.cartographicToCartesian(f,o[r]),r++);return f.latitude===0&&(f.longitude=u,o[r]=n.cartographicToCartesian(f,o[r]),r++,f.longitude=c,o[r]=n.cartographicToCartesian(f,o[r]),r++),o.length=r,o}static subsection(t,n,i,o,r,a){if(l(a)||(a=new e),t.west<=t.east){let c=t.east-t.west;a.west=t.west+n*c,a.east=t.west+o*c}else{let c=D.TWO_PI+t.east-t.west;a.west=D.negativePiToPi(t.west+n*c),a.east=D.negativePiToPi(t.west+o*c)}let s=t.north-t.south;return a.south=t.south+i*s,a.north=t.south+r*s,n===1&&(a.west=t.east),o===1&&(a.east=t.east),i===1&&(a.south=t.north),r===1&&(a.north=t.north),a}};zT.packedLength=4;var cLe=new R,lLe=new h,uLe=new h,fLe=new h,dLe=new h,_7=new Array(5);for(let e=0;e<_7.length;++e)_7[e]=new h;var hLe=new de;zT.MAX_VALUE=Object.freeze(new zT(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var oe=zT;function na(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}na.packedLength=4;na.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};na.unpack=function(e,t,n){return t=t??0,l(n)||(n=new na),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};na.fromPoints=function(e,t){if(l(t)||(t=new na),!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,a=e[0].y;for(let s=1;s<n;s++){let c=e[s],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),a=Math.max(f,a)}return t.x=i,t.y=o,t.width=r-i,t.height=a-o,t};var qoe=new Hi,mLe=new de,pLe=new de;na.fromRectangle=function(e,t,n){if(l(n)||(n=new na),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;qoe._ellipsoid=te.default,t=t??qoe;let i=t.project(oe.southwest(e,mLe)),o=t.project(oe.northeast(e,pLe));return z.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};na.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 na(e.x,e.y,e.width,e.height)};na.union=function(e,t,n){l(n)||(n=new na);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),a=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=a-o,n};na.expand=function(e,t,n){n=na.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};na.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?qt.OUTSIDE:qt.INTERSECTING};na.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};na.prototype.clone=function(e){return na.clone(this,e)};na.prototype.intersect=function(e){return na.intersect(this,e)};na.prototype.equals=function(e){return na.equals(this,e)};var Je=na;var Us={POINTS:ee.POINTS,LINES:ee.LINES,LINE_LOOP:ee.LINE_LOOP,LINE_STRIP:ee.LINE_STRIP,TRIANGLES:ee.TRIANGLES,TRIANGLE_STRIP:ee.TRIANGLE_STRIP,TRIANGLE_FAN:ee.TRIANGLE_FAN};Us.isLines=function(e){return e===Us.LINES||e===Us.LINE_LOOP||e===Us.LINE_STRIP};Us.isTriangles=function(e){return e===Us.TRIANGLES||e===Us.TRIANGLE_STRIP||e===Us.TRIANGLE_FAN};Us.validate=function(e){return e===Us.POINTS||e===Us.LINES||e===Us.LINE_LOOP||e===Us.LINE_STRIP||e===Us.TRIANGLES||e===Us.TRIANGLE_STRIP||e===Us.TRIANGLE_FAN};Object.freeze(Us);var Re=Us;var UT=`in vec4 position;
  80. in vec2 textureCoordinates;
  81. out vec2 v_textureCoordinates;
  82. void main()
  83. {
  84. gl_Position = position;
  85. v_textureCoordinates = textureCoordinates;
  86. }
  87. `;var zr={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},A7=class e{constructor(t=G.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Re.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return zc(this,zr.CULL)}set cull(t){zc(this,zr.CULL)!==t&&($g(this,zr.CULL,t),this.dirty=!0)}get occlude(){return zc(this,zr.OCCLUDE)}set occlude(t){zc(this,zr.OCCLUDE)!==t&&($g(this,zr.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return zc(this,zr.CAST_SHADOWS)}set castShadows(t){zc(this,zr.CAST_SHADOWS)!==t&&($g(this,zr.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return zc(this,zr.RECEIVE_SHADOWS)}set receiveShadows(t){zc(this,zr.RECEIVE_SHADOWS)!==t&&($g(this,zr.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return zc(this,zr.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){zc(this,zr.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&($g(this,zr.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return zc(this,zr.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){zc(this,zr.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&($g(this,zr.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return zc(this,zr.PICK_ONLY)}set pickOnly(t){zc(this,zr.PICK_ONLY)!==t&&($g(this,zr.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return zc(this,zr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){zc(this,zr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&($g(this,zr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function zc(e,t){return(e._flags&t)===t}function $g(e,t,n){n?e._flags|=t:e._flags&=~t}var tt=A7;var xi={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,HALF_FLOAT:ee.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ee.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ee.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ee.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ee.UNSIGNED_SHORT_5_6_5};xi.toWebGLConstant=function(e,t){switch(e){case xi.UNSIGNED_BYTE:return ee.UNSIGNED_BYTE;case xi.UNSIGNED_SHORT:return ee.UNSIGNED_SHORT;case xi.UNSIGNED_INT:return ee.UNSIGNED_INT;case xi.FLOAT:return ee.FLOAT;case xi.HALF_FLOAT:return t.webgl2?ee.HALF_FLOAT:ee.HALF_FLOAT_OES;case xi.UNSIGNED_INT_24_8:return ee.UNSIGNED_INT_24_8;case xi.UNSIGNED_SHORT_4_4_4_4:return ee.UNSIGNED_SHORT_4_4_4_4;case xi.UNSIGNED_SHORT_5_5_5_1:return ee.UNSIGNED_SHORT_5_5_5_1;case xi.UNSIGNED_SHORT_5_6_5:return xi.UNSIGNED_SHORT_5_6_5}};xi.isPacked=function(e){return e===xi.UNSIGNED_INT_24_8||e===xi.UNSIGNED_SHORT_4_4_4_4||e===xi.UNSIGNED_SHORT_5_5_5_1||e===xi.UNSIGNED_SHORT_5_6_5};xi.sizeInBytes=function(e){switch(e){case xi.UNSIGNED_BYTE:return 1;case xi.UNSIGNED_SHORT:case xi.UNSIGNED_SHORT_4_4_4_4:case xi.UNSIGNED_SHORT_5_5_5_1:case xi.UNSIGNED_SHORT_5_6_5:case xi.HALF_FLOAT:return 2;case xi.UNSIGNED_INT:case xi.FLOAT:case xi.UNSIGNED_INT_24_8:return 4}};xi.validate=function(e){return e===xi.UNSIGNED_BYTE||e===xi.UNSIGNED_SHORT||e===xi.UNSIGNED_INT||e===xi.FLOAT||e===xi.HALF_FLOAT||e===xi.UNSIGNED_INT_24_8||e===xi.UNSIGNED_SHORT_4_4_4_4||e===xi.UNSIGNED_SHORT_5_5_5_1||e===xi.UNSIGNED_SHORT_5_6_5};xi.getTypedArrayConstructor=function(e){let t=xi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===xi.FLOAT?Float32Array:Uint32Array};Object.freeze(xi);var je=xi;var Ze={DEPTH_COMPONENT:ee.DEPTH_COMPONENT,DEPTH_STENCIL:ee.DEPTH_STENCIL,ALPHA:ee.ALPHA,RED:ee.RED,RG:ee.RG,RGB:ee.RGB,RGBA:ee.RGBA,RED_INTEGER:ee.RED_INTEGER,RG_INTEGER:ee.RG_INTEGER,RGB_INTEGER:ee.RGB_INTEGER,RGBA_INTEGER:ee.RGBA_INTEGER,LUMINANCE:ee.LUMINANCE,LUMINANCE_ALPHA:ee.LUMINANCE_ALPHA,RGB_DXT1:ee.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ee.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ee.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ee.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ee.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ee.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ee.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ee.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ee.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ee.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ee.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ee.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ee.COMPRESSED_RGBA_BPTC_UNORM};Ze.componentsLength=function(e){switch(e){case Ze.RGB:case Ze.RGB_INTEGER:return 3;case Ze.RGBA:case Ze.RGBA_INTEGER:return 4;case Ze.LUMINANCE_ALPHA:case Ze.RG:case Ze.RG_INTEGER:return 2;case Ze.ALPHA:case Ze.RED:case Ze.RED_INTEGER:case Ze.LUMINANCE:return 1;default:return 1}};Ze.validate=function(e){return e===Ze.DEPTH_COMPONENT||e===Ze.DEPTH_STENCIL||e===Ze.ALPHA||e===Ze.RED||e===Ze.RG||e===Ze.RGB||e===Ze.RGBA||e===Ze.RED_INTEGER||e===Ze.RG_INTEGER||e===Ze.RGB_INTEGER||e===Ze.RGBA_INTEGER||e===Ze.LUMINANCE||e===Ze.LUMINANCE_ALPHA||e===Ze.RGB_DXT1||e===Ze.RGBA_DXT1||e===Ze.RGBA_DXT3||e===Ze.RGBA_DXT5||e===Ze.RGB_PVRTC_4BPPV1||e===Ze.RGB_PVRTC_2BPPV1||e===Ze.RGBA_PVRTC_4BPPV1||e===Ze.RGBA_PVRTC_2BPPV1||e===Ze.RGBA_ASTC||e===Ze.RGB_ETC1||e===Ze.RGB8_ETC2||e===Ze.RGBA8_ETC2_EAC||e===Ze.RGBA_BC7};Ze.isColorFormat=function(e){return e===Ze.RED||e===Ze.ALPHA||e===Ze.RGB||e===Ze.RGBA||e===Ze.LUMINANCE||e===Ze.LUMINANCE_ALPHA};Ze.isDepthFormat=function(e){return e===Ze.DEPTH_COMPONENT||e===Ze.DEPTH_STENCIL};Ze.isCompressedFormat=function(e){return e===Ze.RGB_DXT1||e===Ze.RGBA_DXT1||e===Ze.RGBA_DXT3||e===Ze.RGBA_DXT5||e===Ze.RGB_PVRTC_4BPPV1||e===Ze.RGB_PVRTC_2BPPV1||e===Ze.RGBA_PVRTC_4BPPV1||e===Ze.RGBA_PVRTC_2BPPV1||e===Ze.RGBA_ASTC||e===Ze.RGB_ETC1||e===Ze.RGB8_ETC2||e===Ze.RGBA8_ETC2_EAC||e===Ze.RGBA_BC7};Ze.isDXTFormat=function(e){return e===Ze.RGB_DXT1||e===Ze.RGBA_DXT1||e===Ze.RGBA_DXT3||e===Ze.RGBA_DXT5};Ze.isPVRTCFormat=function(e){return e===Ze.RGB_PVRTC_4BPPV1||e===Ze.RGB_PVRTC_2BPPV1||e===Ze.RGBA_PVRTC_4BPPV1||e===Ze.RGBA_PVRTC_2BPPV1};Ze.isASTCFormat=function(e){return e===Ze.RGBA_ASTC};Ze.isETC1Format=function(e){return e===Ze.RGB_ETC1};Ze.isETC2Format=function(e){return e===Ze.RGB8_ETC2||e===Ze.RGBA8_ETC2_EAC};Ze.isBC7Format=function(e){return e===Ze.RGBA_BC7};Ze.compressedTextureSizeInBytes=function(e,t,n){switch(e){case Ze.RGB_DXT1:case Ze.RGBA_DXT1:case Ze.RGB_ETC1:case Ze.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case Ze.RGBA_DXT3:case Ze.RGBA_DXT5:case Ze.RGBA_ASTC:case Ze.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case Ze.RGB_PVRTC_4BPPV1:case Ze.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case Ze.RGB_PVRTC_2BPPV1:case Ze.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case Ze.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};Ze.textureSizeInBytes=function(e,t,n,i){let o=Ze.componentsLength(e);return je.isPacked(t)&&(o=1),o*je.sizeInBytes(t)*n*i};Ze.texture3DSizeInBytes=function(e,t,n,i,o){let r=Ze.componentsLength(e);return je.isPacked(t)&&(r=1),r*je.sizeInBytes(t)*n*i*o};Ze.alignmentInBytes=function(e,t,n){let i=Ze.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};Ze.createTypedArray=function(e,t,n,i){let o=je.getTypedArrayConstructor(t),r=Ze.componentsLength(e)*n*i;return new o(r)};Ze.flipY=function(e,t,n,i,o){if(o===1)return e;let r=Ze.createTypedArray(t,n,i,o),a=Ze.componentsLength(t),s=i*a;for(let c=0;c<o;++c){let u=c*i*a,f=(o-c-1)*i*a;for(let d=0;d<s;++d)r[f+d]=e[u+d]}return r};Ze.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===Ze.DEPTH_STENCIL)return ee.DEPTH24_STENCIL8;if(e===Ze.DEPTH_COMPONENT){if(t===je.UNSIGNED_SHORT)return ee.DEPTH_COMPONENT16;if(t===je.UNSIGNED_INT)return ee.DEPTH_COMPONENT24}if(t===je.FLOAT)switch(e){case Ze.RGBA:return ee.RGBA32F;case Ze.RGB:return ee.RGB32F;case Ze.RG:return ee.RG32F;case Ze.RED:return ee.R32F}if(t===je.HALF_FLOAT)switch(e){case Ze.RGBA:return ee.RGBA16F;case Ze.RGB:return ee.RGB16F;case Ze.RG:return ee.RG16F;case Ze.RED:return ee.R16F}if(t===je.UNSIGNED_BYTE)switch(e){case Ze.RGBA:return ee.RGBA8;case Ze.RGB:return ee.RGB8;case Ze.RG:return ee.RG8;case Ze.RED:return ee.R8}if(t===je.INT)switch(e){case Ze.RGBA_INTEGER:return ee.RGBA32I;case Ze.RGB_INTEGER:return ee.RGB32I;case Ze.RG_INTEGER:return ee.RG32I;case Ze.RED_INTEGER:return ee.R32I}if(t===je.UNSIGNED_INT)switch(e){case Ze.RGBA_INTEGER:return ee.RGBA32UI;case Ze.RGB_INTEGER:return ee.RGB32UI;case Ze.RG_INTEGER:return ee.RG32UI;case Ze.RED_INTEGER:return ee.R32UI}return e};Object.freeze(Ze);var Xe=Ze;var Er={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize: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(Er,{maximumCombinedTextureImageUnits:{get:function(){return Er._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Er._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Er._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Er._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Er._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Er._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Er._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Er._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Er._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Er._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Er._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Er._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Er._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Er._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Er._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Er._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Er._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Er._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Er._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Er._maximumColorAttachments}},maximumSamples:{get:function(){return Er._maximumSamples}},highpFloatSupported:{get:function(){return Er._highpFloatSupported}},highpIntSupported:{get:function(){return Er._highpIntSupported}}});var Mt=Er;function y7(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function _M(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function eh(e){e=e??G.EMPTY_OBJECT;let n=e.context._gl,i=Mt.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=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let a=0;a<r;++a){let s=o[a],c=this._gl.COLOR_ATTACHMENT0+a;y7(this,c,s),this._activeColorAttachments[a]=c,this._colorTextures[a]=s}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let a=0;a<r;++a){let s=o[a],c=this._gl.COLOR_ATTACHMENT0+a;_M(this,c,s),this._activeColorAttachments[a]=c,this._colorRenderbuffers[a]=s}}if(l(e.depthTexture)){let o=e.depthTexture;y7(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;_M(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;_M(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;y7(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;_M(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(eh.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)}}});eh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};eh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};eh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};eh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};eh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};eh.prototype.getColorTexture=function(e){return this._colorTextures[e]};eh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};eh.prototype.isDestroyed=function(){return!1};eh.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),fe(this)};var pa=eh;var Nw={CLOCKWISE:ee.CW,COUNTER_CLOCKWISE:ee.CCW};Nw.validate=function(e){return e===Nw.CLOCKWISE||e===Nw.COUNTER_CLOCKWISE};Object.freeze(Nw);var ns=Nw;function Yoe(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]=Yoe(e[t]));return Object.freeze(e)}var Xoe=Yoe;function xm(e){let t=e??G.EMPTY_OBJECT,n=t.cull??G.EMPTY_OBJECT,i=t.polygonOffset??G.EMPTY_OBJECT,o=t.scissorTest??G.EMPTY_OBJECT,r=o.rectangle??G.EMPTY_OBJECT,a=t.depthRange??G.EMPTY_OBJECT,s=t.depthTest??G.EMPTY_OBJECT,c=t.colorMask??G.EMPTY_OBJECT,u=t.blending??G.EMPTY_OBJECT,f=u.color??G.EMPTY_OBJECT,d=t.stencilTest??G.EMPTY_OBJECT,p=d.frontOperation??G.EMPTY_OBJECT,g=d.backOperation??G.EMPTY_OBJECT,m=t.sampleCoverage??G.EMPTY_OBJECT,A=t.viewport;this.frontFace=t.frontFace??ns.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ee.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:o.enabled??!1,rectangle:Je.clone(r)},this.depthRange={near:a.near??0,far:a.far??1},this.depthTest={enabled:s.enabled??!1,func:s.func??ee.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new U(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??ee.FUNC_ADD,equationAlpha:u.equationAlpha??ee.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??ee.ONE,functionSourceAlpha:u.functionSourceAlpha??ee.ONE,functionDestinationRgb:u.functionDestinationRgb??ee.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??ee.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??ee.ALWAYS,backFunction:d.backFunction??ee.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??ee.KEEP,zFail:p.zFail??ee.KEEP,zPass:p.zPass??ee.KEEP},backOperation:{fail:g.fail??ee.KEEP,zFail:g.zFail??ee.KEEP,zPass:g.zPass??ee.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(A)?new Je(A.x,A.y,A.width,A.height):void 0,this.id=0,this._applyFunctions=[]}var gLe=0,ym={};xm.fromCache=function(e){let t=JSON.stringify(e),n=ym[t];if(l(n))return++n.referenceCount,n.state;let i=new xm(e),o=JSON.stringify(i);return n=ym[o],l(n)||(i.id=gLe++,n={referenceCount:0,state:i},ym[o]=n),++n.referenceCount,ym[t]={referenceCount:1,state:n.state},n.state};xm.removeFromCache=function(e){let t=new xm(e),n=JSON.stringify(t),i=ym[n],o=JSON.stringify(e),r=ym[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete ym[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete ym[n]};xm.getCache=function(){return ym};xm.clearCache=function(){ym={}};function By(e,t,n){n?e.enable(t):e.disable(t)}function Koe(e,t){e.frontFace(t.frontFace)}function Qoe(e,t){let n=t.cull,i=n.enabled;By(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function $oe(e,t){e.lineWidth(t.lineWidth)}function Joe(e,t){let n=t.polygonOffset,i=n.enabled;By(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Zoe(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(By(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 ere(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function tre(e,t){let n=t.depthTest,i=n.enabled;By(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function nre(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function ire(e,t){e.depthMask(t.depthMask)}function ore(e,t){e.stencilMask(t.stencilMask)}function _Le(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function rre(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;By(e,e.BLEND,o),o&&(_Le(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function are(e,t){let n=t.stencilTest,i=n.enabled;if(By(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,a=n.reference,s=n.mask;e.stencilFunc(o,a,s),e.stencilFuncSeparate(e.BACK,r,a,s),e.stencilFuncSeparate(e.FRONT,o,a,s);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,A=p.zPass;e.stencilOpSeparate(e.BACK,g,m,A)}}function sre(e,t){let n=t.sampleCoverage,i=n.enabled;By(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var ALe=new Je;function cre(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=ALe,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)}xm.apply=function(e,t,n){Koe(e,t),Qoe(e,t),$oe(e,t),Joe(e,t),ere(e,t),tre(e,t),nre(e,t),ire(e,t),ore(e,t),are(e,t),sre(e,t),Zoe(e,t,n),rre(e,t,n),cre(e,t,n)};function yLe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(Koe),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Qoe),e.lineWidth!==t.lineWidth&&n.push($oe),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Joe),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(ere),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(tre),(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(nre),e.depthMask!==t.depthMask&&n.push(ire),e.stencilMask!==t.stencilMask&&n.push(ore),(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(are),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(sre),n}xm.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=yLe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let a=l(i.scissorTest)?i.scissorTest:t.scissorTest,s=l(o.scissorTest)?o.scissorTest:n.scissorTest;(a!==s||r)&&Zoe(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&rre(e,n,o),(t!==n||i!==o||i.context!==o.context)&&cre(e,n,o)};xm.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:Je.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:U.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)?Je.clone(e.viewport):void 0}};var Ve=xm;var $l=class e{constructor(t,n,i,o){this[0]=t??0,this[1]=i??0,this[2]=n??0,this[3]=o??0}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i}static packArray(t,n){let i=t.length,o=i*4;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let o=0;o<i;o+=4){let r=o/4;n[r]=e.unpack(t,o,n[r])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):new e(t[0],t[2],t[1],t[3])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[2],n[2]=t[1],n[3]=t[3],n):new e(t[0],t[1],t[2],t[3])}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=t.y,n):new e(t.x,0,0,t.y)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=t,n):new e(t,0,0,t)}static fromRotation(t,n){let i=Math.cos(t),o=Math.sin(t);return l(n)?(n[0]=i,n[1]=o,n[2]=-o,n[3]=i,n):new e(i,-o,o,i)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):[t[0],t[1],t[2],t[3]]}static getElementIndex(t,n){return t*2+n}static getColumn(t,n,i){let o=n*2,r=t[o],a=t[o+1];return i.x=r,i.y=a,i}static setColumn(t,n,i,o){o=e.clone(t,o);let r=n*2;return o[r]=i.x,o[r+1]=i.y,o}static getRow(t,n,i){let o=t[n],r=t[n+2];return i.x=o,i.y=r,i}static setRow(t,n,i,o){return o=e.clone(t,o),o[n]=i.x,o[n+2]=i.y,o}static setScale(t,n,i){let o=e.getScale(t,xLe),r=n.x/o.x,a=n.y/o.y;return i[0]=t[0]*r,i[1]=t[1]*r,i[2]=t[2]*a,i[3]=t[3]*a,i}static setUniformScale(t,n,i){let o=e.getScale(t,bLe),r=n/o.x,a=n/o.y;return i[0]=t[0]*r,i[1]=t[1]*r,i[2]=t[2]*a,i[3]=t[3]*a,i}static getScale(t,n){return n.x=z.magnitude(z.fromElements(t[0],t[1],lre)),n.y=z.magnitude(z.fromElements(t[2],t[3],lre)),n}static getMaximumScale(t){return e.getScale(t,ure),z.maximumComponent(ure)}static setRotation(t,n,i){let o=e.getScale(t,TLe);return i[0]=n[0]*o.x,i[1]=n[1]*o.x,i[2]=n[2]*o.y,i[3]=n[3]*o.y,i}static getRotation(t,n){let i=e.getScale(t,CLe);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}static multiply(t,n,i){let o=t[0]*n[0]+t[2]*n[1],r=t[0]*n[2]+t[2]*n[3],a=t[1]*n[0]+t[3]*n[1],s=t[1]*n[2]+t[3]*n[3];return i[0]=o,i[1]=a,i[2]=r,i[3]=s,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i}static multiplyByVector(t,n,i){let o=t[0]*n.x+t[2]*n.y,r=t[1]*n.x+t[3]*n.y;return i.x=o,i.y=r,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.y,i[3]=t[3]*n.y,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}static transpose(t,n){let i=t[0],o=t[2],r=t[1],a=t[3];return n[0]=i,n[1]=o,n[2]=r,n[3]=a,n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[2]})
  88. (${this[1]}, ${this[3]})`}};$l.packedLength=4;$l.fromArray=$l.unpack;$l.IDENTITY=Object.freeze(new $l(1,0,0,1));$l.ZERO=Object.freeze(new $l(0,0,0,0));$l.COLUMN0ROW0=0;$l.COLUMN0ROW1=1;$l.COLUMN1ROW0=2;$l.COLUMN1ROW1=3;var xLe=new z,bLe=new z,lre=new z,ure=new z,TLe=new z,CLe=new z,Wi=$l;function ELe(e,t,n,i){switch(t.type){case e.FLOAT:return new x7(e,t,n,i);case e.FLOAT_VEC2:return new b7(e,t,n,i);case e.FLOAT_VEC3:return new T7(e,t,n,i);case e.FLOAT_VEC4:return new C7(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new AM(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new AM(e,t,n,i);case e.INT:case e.BOOL:return new E7(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new v7(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new S7(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new w7(e,t,n,i);case e.FLOAT_MAT2:return new I7(e,t,n,i);case e.FLOAT_MAT3:return new D7(e,t,n,i);case e.FLOAT_MAT4:return new P7(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var x7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=o}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))}},b7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new z,this._gl=t,this._location=o}set(){let t=this.value;z.equals(t,this._value)||(z.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},T7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=o}set(){let t=this.value;l(t.red)?U.equals(t,this._value)||(this._value=U.clone(t,this._value),this._gl.uniform3f(this._location,t.red,t.green,t.blue)):l(t.x)&&(h.equals(t,this._value)||(this._value=h.clone(t,this._value),this._gl.uniform3f(this._location,t.x,t.y,t.z)))}},C7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=o}set(){let t=this.value;l(t.red)?U.equals(t,this._value)||(this._value=U.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha)):l(t.x)&&(se.equals(t,this._value)||(this._value=se.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w)))}},AM=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._gl=t,this._location=o,this.textureUnitIndex=void 0}set(){let t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex);let n=this.value;t.bindTexture(n._target,n._texture)}_setSampler(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1}},E7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=o}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))}},v7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new z,this._gl=t,this._location=o}set(){let t=this.value;z.equals(t,this._value)||(z.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},S7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new h,this._gl=t,this._location=o}set(){let t=this.value;h.equals(t,this._value)||(h.clone(t,this._value),this._gl.uniform3i(this._location,t.x,t.y,t.z))}},w7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new se,this._gl=t,this._location=o}set(){let t=this.value;se.equals(t,this._value)||(se.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))}},vLe=new Float32Array(4),I7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new Wi,this._gl=t,this._location=o}set(){if(!Wi.equalsArray(this.value,this._value,0)){Wi.clone(this.value,this._value);let t=Wi.toArray(this.value,vLe);this._gl.uniformMatrix2fv(this._location,!1,t)}}},SLe=new Float32Array(9),D7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new $,this._gl=t,this._location=o}set(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let t=$.toArray(this.value,SLe);this._gl.uniformMatrix3fv(this._location,!1,t)}}},wLe=new Float32Array(16),P7=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new R,this._gl=t,this._location=o}set(){if(!R.equalsArray(this.value,this._value,0)){R.clone(this.value,this._value);let t=R.toArray(this.value,wLe);this._gl.uniformMatrix4fv(this._location,!1,t)}}},yM=ELe;function ILe(e,t,n,i){switch(t.type){case e.FLOAT:return new R7(e,t,n,i);case e.FLOAT_VEC2:return new O7(e,t,n,i);case e.FLOAT_VEC3:return new M7(e,t,n,i);case e.FLOAT_VEC4:return new B7(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new L7(e,t,n,i);case e.INT:case e.BOOL:return new N7(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new F7(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new k7(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new z7(e,t,n,i);case e.FLOAT_MAT2:return new U7(e,t,n,i);case e.FLOAT_MAT3:return new V7(e,t,n,i);case e.FLOAT_MAT4:return new j7(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var R7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Float32Array(r),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1;for(let r=0;r<n;++r){let a=t[r];a!==i[r]&&(i[r]=a,o=!0)}o&&this._gl.uniform1fv(this._location,i)}},O7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Float32Array(r*2),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1,r=0;for(let a=0;a<n;++a){let s=t[a];z.equalsArray(s,i,r)||(z.pack(s,i,r),o=!0),r+=2}o&&this._gl.uniform2fv(this._location,i)}},M7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Float32Array(r*3),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1,r=0;for(let a=0;a<n;++a){let s=t[a];l(s.red)?(s.red!==i[r]||s.green!==i[r+1]||s.blue!==i[r+2])&&(i[r]=s.red,i[r+1]=s.green,i[r+2]=s.blue,o=!0):l(s.x)&&(h.equalsArray(s,i,r)||(h.pack(s,i,r),o=!0)),r+=3}o&&this._gl.uniform3fv(this._location,i)}},B7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1,r=0;for(let a=0;a<n;++a){let s=t[a];l(s.red)?U.equalsArray(s,i,r)||(U.pack(s,i,r),o=!0):l(s.x)&&(se.equalsArray(s,i,r)||(se.pack(s,i,r),o=!0)),r+=4}o&&this._gl.uniform4fv(this._location,i)}},L7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Float32Array(r),this._gl=t,this._locations=o,this.textureUnitIndex=void 0}set(){let t=this._gl,n=t.TEXTURE0+this.textureUnitIndex,i=this.value,o=i.length;for(let r=0;r<o;++r){let a=i[r];t.activeTexture(n+r),t.bindTexture(a._target,a._texture)}}_setSampler(t){this.textureUnitIndex=t;let n=this._locations,i=n.length;for(let o=0;o<i;++o){let r=t+o;this._gl.uniform1i(n[o],r)}return t+i}},N7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Int32Array(r),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1;for(let r=0;r<n;++r){let a=t[r];a!==i[r]&&(i[r]=a,o=!0)}o&&this._gl.uniform1iv(this._location,i)}},F7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Int32Array(r*2),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1,r=0;for(let a=0;a<n;++a){let s=t[a];z.equalsArray(s,i,r)||(z.pack(s,i,r),o=!0),r+=2}o&&this._gl.uniform2iv(this._location,i)}},k7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Int32Array(r*3),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1,r=0;for(let a=0;a<n;++a){let s=t[a];h.equalsArray(s,i,r)||(h.pack(s,i,r),o=!0),r+=3}o&&this._gl.uniform3iv(this._location,i)}},z7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Int32Array(r*4),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1,r=0;for(let a=0;a<n;++a){let s=t[a];se.equalsArray(s,i,r)||(se.pack(s,i,r),o=!0),r+=4}o&&this._gl.uniform4iv(this._location,i)}},U7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Float32Array(r*4),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1,r=0;for(let a=0;a<n;++a){let s=t[a];Wi.equalsArray(s,i,r)||(Wi.pack(s,i,r),o=!0),r+=4}o&&this._gl.uniformMatrix2fv(this._location,!1,i)}},V7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Float32Array(r*9),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1,r=0;for(let a=0;a<n;++a){let s=t[a];$.equalsArray(s,i,r)||($.pack(s,i,r),o=!0),r+=9}o&&this._gl.uniformMatrix3fv(this._location,!1,i)}},j7=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Float32Array(r*16),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1,r=0;for(let a=0;a<n;++a){let s=t[a];R.equalsArray(s,i,r)||(R.pack(s,i,r),o=!0),r+=16}o&&this._gl.uniformMatrix4fv(this._location,!1,i)}},xM=ILe;var DLe=0;function l0(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=PLe(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=DLe++}l0.fromCache=function(e){return e=e??G.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};l0.replaceCache=function(e){return e=e??G.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(l0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return bM(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return bM(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return bM(this),this._uniformsByName}}});function fre(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(),a=r.slice(r.lastIndexOf(" ")+1);t.push(a)}}return t}function PLe(e,t){let n={};if(!Mt.highpFloatSupported||!Mt.highpIntSupported){let i,o,r,a,s=fre(e),c=fre(t),u=s.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(s[i]===c[o]){r=s[i],a=`czm_mediump_${r}`;let d=new RegExp(`${r}\\b`,"g");t=t.replace(d,a),n[a]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var bm="[Cesium WebGL] ";function RLe(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 a=e.createProgram();e.attachShader(a,o),e.attachShader(a,r);let s=t._attributeLocations;if(l(s))for(let p in s)s.hasOwnProperty(p)&&e.bindAttribLocation(a,s[p],p);e.linkProgram(a);let c;if(e.getProgramParameter(a,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${bm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${bm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(a),l(c)&&c.length>0&&console.log(`${bm}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),a;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(a),console.error(`${bm}Shader program link log: ${c}`),d(o,"vertex"),d(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${bm}Vertex shader compile log: ${c}`),console.error(`${bm} Vertex shader source:
  89. ${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${bm}Fragment shader compile log: ${c}`),console.error(`${bm} Fragment shader source:
  90. ${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(a),new re(u);function d(p,g){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${bm}${g} shader translation failed.`);return}console.error(`${bm}Translated ${g} shaderSource:
  91. ${m}`)}}function OLe(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),a=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:a}}return i}function MLe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<r;++a){let s=e.getActiveUniform(t,a),c="[0]",u=s.name.indexOf(c,s.name.length-c.length)!==-1?s.name.slice(0,s.name.length-3):s.name;if(u.indexOf("gl_")!==0)if(s.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=yM(e,s,u,f);n[u]=d,i.push(d),d._setSampler&&o.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let A=0;A<s.size;++A)g=e.getUniformLocation(t,`${u}[${A}]`),g!==null&&d.push(g);f=xM(e,s,u,d),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function BLe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],a=o,s=e._duplicateUniformNames[a];l(s)&&(r.name=s,a=s);let c=Gg[a];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function LLe(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 bM(e){l(e._program)||dre(e)}function dre(e){let t=e._program,n=e._gl,i=RLe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=MLe(n,i),a=BLe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=OLe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=LLe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(s,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=s.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{dre(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let y=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(y?y[1]:m.message)}})}l0.prototype._bind=function(){bM(this),this._gl.useProgram(this._program)};l0.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let s=this._manualUniforms;for(i=s.length,o=0;o<i;++o){let c=s[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let s=r[o];s.uniform.value=s.automaticUniform.getValue(t)}let a=this._uniforms;for(i=a.length,o=0;o<i;++o)a[o].set();if(n){let s=this._gl,c=this._program;s.validateProgram(c)}};l0.prototype.isDestroyed=function(){return!1};l0.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};l0.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),fe(this)};var Qt=l0;function TM(e){this._context=e}var Fw,NLe=new tt({primitiveType:Re.TRIANGLES}),FLe=new si({color:new U(0,0,0,0)});function kLe(e,t){return new pa({context:e,colorTextures:[t],destroyAttachments:!1})}function zLe(e,t){return Qt.fromCache({context:e,vertexShaderSource:UT,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function ULe(e,t){return(!l(Fw)||Fw.viewport.width!==e||Fw.viewport.height!==t)&&(Fw=Ve.fromCache({viewport:new Je(0,0,e,t)})),Fw}TM.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(),a=l(e.shaderProgram)?e.shaderProgram:zLe(o,e.fragmentShaderSource),s=kLe(o,t),c=ULe(n,i),u=e.uniformMap,f=FLe;f.framebuffer=s,f.renderState=c,f.execute(o);let d=NLe;d.vertexArray=r,d.renderState=c,d.shaderProgram=a,d.uniformMap=u,d.framebuffer=s,d.execute(o),s.destroy(),e.persists||(a.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};TM.prototype.isDestroyed=function(){return!1};TM.prototype.destroy=function(){return fe(this)};var CM=TM;var dn={BYTE:ee.BYTE,UNSIGNED_BYTE:ee.UNSIGNED_BYTE,SHORT:ee.SHORT,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,INT:ee.INT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,DOUBLE:ee.DOUBLE};dn.getSizeInBytes=function(e){switch(e){case dn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case dn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case dn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case dn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case dn.INT:return Int32Array.BYTES_PER_ELEMENT;case dn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case dn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case dn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};dn.fromTypedArray=function(e){if(e instanceof Int8Array)return dn.BYTE;if(e instanceof Uint8Array)return dn.UNSIGNED_BYTE;if(e instanceof Int16Array)return dn.SHORT;if(e instanceof Uint16Array)return dn.UNSIGNED_SHORT;if(e instanceof Int32Array)return dn.INT;if(e instanceof Uint32Array)return dn.UNSIGNED_INT;if(e instanceof Float32Array)return dn.FLOAT;if(e instanceof Float64Array)return dn.DOUBLE};dn.validate=function(e){return l(e)&&(e===dn.BYTE||e===dn.UNSIGNED_BYTE||e===dn.SHORT||e===dn.UNSIGNED_SHORT||e===dn.INT||e===dn.UNSIGNED_INT||e===dn.FLOAT||e===dn.DOUBLE)};dn.createTypedArray=function(e,t){switch(e){case dn.BYTE:return new Int8Array(t);case dn.UNSIGNED_BYTE:return new Uint8Array(t);case dn.SHORT:return new Int16Array(t);case dn.UNSIGNED_SHORT:return new Uint16Array(t);case dn.INT:return new Int32Array(t);case dn.UNSIGNED_INT:return new Uint32Array(t);case dn.FLOAT:return new Float32Array(t);case dn.DOUBLE:return new Float64Array(t)}};dn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/dn.getSizeInBytes(e),e){case dn.BYTE:return new Int8Array(t,n,i);case dn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case dn.SHORT:return new Int16Array(t,n,i);case dn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case dn.INT:return new Int32Array(t,n,i);case dn.UNSIGNED_INT:return new Uint32Array(t,n,i);case dn.FLOAT:return new Float32Array(t,n,i);case dn.DOUBLE:return new Float64Array(t,n,i)}};dn.fromName=function(e){switch(e){case"BYTE":return dn.BYTE;case"UNSIGNED_BYTE":return dn.UNSIGNED_BYTE;case"SHORT":return dn.SHORT;case"UNSIGNED_SHORT":return dn.UNSIGNED_SHORT;case"INT":return dn.INT;case"UNSIGNED_INT":return dn.UNSIGNED_INT;case"FLOAT":return dn.FLOAT;case"DOUBLE":return dn.DOUBLE}};dn.dequantize=function(e,t){switch(t){case dn.BYTE:return Math.max(e/127,-1);case dn.UNSIGNED_BYTE:return e/255;case dn.SHORT:return Math.max(e/32767,-1);case dn.UNSIGNED_SHORT:return e/65535;case dn.INT:return Math.max(e/2147483647,-1);case dn.UNSIGNED_INT:return e/4294967295}};Object.freeze(dn);var Y=dn;var hre={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(hre);var th=hre;function G7(e){e=e??G.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Re.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??th.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}G7.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 VLe=new de,jLe=new h,mre=new R,GLe=[new de,new de,new de],HLe=[new z,new z,new z],WLe=[new z,new z,new z],qLe=new h,YLe=new Le,XLe=new R,KLe=new Wi;G7._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=oe.center(i,VLe),a=de.toCartesian(r,n,jLe),s=pt.eastNorthUpToFixedFrame(a,n,mre),c=R.inverse(s,mre),u=HLe,f=GLe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=qLe;for(o=0;o<3;o++)de.toCartesian(f[o],n,d),d=R.multiplyByPointAsVector(c,d,d),u[o].x=d.x,u[o].y=d.y;let p=Le.fromAxisAngle(h.UNIT_Z,-t,YLe),g=$.fromQuaternion(p,XLe),m=e.length,A=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)d=R.multiplyByPointAsVector(c,e[o],d),d=$.multiplyByVector(g,d,d),A=Math.min(A,d.x),y=Math.min(y,d.y),x=Math.max(x,d.x),b=Math.max(b,d.y);let T=Wi.fromRotation(t,KLe),E=WLe;E[0].x=A,E[0].y=y,E[1].x=A,E[1].y=b,E[2].x=x,E[2].y=y;let S=u[0],w=u[2].x-S.x,P=u[1].y-S.y;for(o=0;o<3;o++){let C=E[o];Wi.multiplyByVector(T,C,C),C.x=(C.x-S.x)/w,C.y=(C.y-S.y)/P}let O=E[0],B=E[1],L=E[2],_=new Array(6);return z.pack(O,_),z.pack(B,_,2),z.pack(L,_,4),_};var At=G7;function QLe(e){e=e??G.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Me=QLe;function VT(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(VT.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}}});VT.clone=function(e){if(l(e))return new VT(e._format,e._datatype,e._width,e._height,e._buffer)};VT.prototype.clone=function(){return VT.clone(this)};var EM=VT;var pre=Na(ju(),1);function gre(){if(!l(Vs._canTransferArrayBuffer)){let e=q7("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Vs._canTransferArrayBuffer=!1,Vs._canTransferArrayBuffer}Vs._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,a=l(r)&&r[0]===t;i(a),e.terminate(),Vs._canTransferArrayBuffer=a}})}return Vs._canTransferArrayBuffer}var W7=new ye;function H7(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 q7(e){let t=new pre.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,a;if(Dy(e))a=e;else if(!n){let s=Xt(`${Vs._workerModulePrefix}/${i}.js`);Dy(s)&&(a=s)}if(a){let s=`import "${a}";`;return r=H7(s),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let s=`
  92. importScripts("${H7(CESIUM_WORKERS)}");
  93. CesiumWorkers["${i}"]();
  94. `;return r=H7(s),new Worker(r,o)}if(r=e,n||(r=Xt(`${Vs._workerModulePrefix+i}.js`)),!cn.supportsEsmWebWorkers())throw new re("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function $Le(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!cn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new re(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Xt(t.fallbackModulePath),n}n.wasmBinaryFile=Xt(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function Vs(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var JLe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let a=r.error;a.name==="RuntimeError"?(a=new re(r.error.message),a.stack=r.error.stack):a.name==="DeveloperError"?(a=new _e(r.error.message),a.stack=r.error.stack):a.name==="Error"&&(a=new Error(r.error.message),a.stack=r.error.stack),W7.raiseEvent(a),i(a)}else W7.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},ZLe=[];async function eNe(e,t,n){let i=await Promise.resolve(gre());l(n)?i||(n.length=0):n=ZLe;let o=e._nextID++,r=new Promise((a,s)=>{e._worker.addEventListener("message",JLe(e._worker,o,a,s))});return e._worker.postMessage({id:o,baseUrl:Xt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function tNe(e,t,n){++e._activeTasks;try{let i=await eNe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Vs.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=q7(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return tNe(this,e,t)};Vs.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=q7(this._workerPath),i=await $Le(this,e),o=await Promise.resolve(gre()),r,a=i.wasmBinary;l(a)&&o&&(r=[a]);let s=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new re("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),s};return this._webAssemblyPromise=t(),this._webAssemblyPromise};Vs.prototype.isDestroyed=function(){return!1};Vs.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),fe(this)};Vs.taskCompletedEvent=W7;Vs._defaultWorkerModulePrefix="Workers/";Vs._workerModulePrefix=Vs._defaultWorkerModulePrefix;Vs._canTransferArrayBuffer=void 0;var Wn=Vs;function u0(){}u0._transcodeTaskProcessor=new Wn("transcodeKTX2",Number.POSITIVE_INFINITY);u0._readyPromise=void 0;function nNe(){let e=u0._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return u0._transcodeTaskProcessor;throw new re("KTX2 transcoder could not be initialized.")});u0._readyPromise=e}u0.transcode=function(e,t){return l(u0._readyPromise)||nNe(),u0._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 a=n[r];for(let s=0;s<o.length;s++){let c=a[o[s]];a[o[s]]=new EM(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 vM=u0;var _re;Are.setKTX2SupportedFormats=function(e,t,n,i,o,r){_re={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function Are(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return vM.transcode(n,_re)})}var Hu=Are;function iNe(e,t){this.start=e??0,this.stop=t??0}var ia=iNe;var SM=class e{constructor(t,n){this.center=h.clone(t??h.ZERO),this.radius=n??0}static fromPoints(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=h.clone(t[0],Z7),o=h.clone(i,Y7),r=h.clone(i,X7),a=h.clone(i,K7),s=h.clone(i,Q7),c=h.clone(i,$7),u=h.clone(i,J7),f=t.length,d;for(d=1;d<f;d++){h.clone(t[d],i);let B=i.x,L=i.y,_=i.z;B<o.x&&h.clone(i,o),B>s.x&&h.clone(i,s),L<r.y&&h.clone(i,r),L>c.y&&h.clone(i,c),_<a.z&&h.clone(i,a),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(s,o,js)),g=h.magnitudeSquared(h.subtract(c,r,js)),m=h.magnitudeSquared(h.subtract(u,a,js)),A=o,y=s,x=p;g>x&&(x=g,A=r,y=c),m>x&&(x=m,A=a,y=u);let b=eW;b.x=(A.x+y.x)*.5,b.y=(A.y+y.y)*.5,b.z=(A.z+y.z)*.5;let T=h.magnitudeSquared(h.subtract(y,b,js)),E=Math.sqrt(T),S=tW;S.x=o.x,S.y=r.y,S.z=a.z;let w=nW;w.x=s.x,w.y=c.y,w.z=u.z;let P=h.midpoint(S,w,iW),O=0;for(d=0;d<f;d++){h.clone(t[d],i);let B=h.magnitude(h.subtract(i,P,js));B>O&&(O=B);let L=h.magnitudeSquared(h.subtract(i,b,js));if(L>T){let _=Math.sqrt(L);E=(E+_)*.5,T=E*E;let C=_-E;b.x=(E*b.x+C*i.x)/_,b.y=(E*b.y+C*i.y)/_,b.z=(E*b.z+C*i.z)/_}}return E<O?(h.clone(b,n.center),n.radius=E):(h.clone(P,n.center),n.radius=O),n}static fromRectangle2D(t,n,i){return e.fromRectangleWithHeights2D(t,n,0,0,i)}static fromRectangleWithHeights2D(t,n,i,o,r){if(l(r)||(r=new e),!l(t))return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;yre._ellipsoid=te.default,n=n??yre,oe.southwest(t,oW),oW.height=i,oe.northeast(t,rW),rW.height=o;let a=n.project(oW,rNe),s=n.project(rW,aNe),c=s.x-a.x,u=s.y-a.y,f=s.z-a.z;r.radius=Math.sqrt(c*c+u*u+f*f)*.5;let d=r.center;return d.x=a.x+c*.5,d.y=a.y+u*.5,d.z=a.z+f*.5,r}static fromRectangle3D(t,n,i,o){if(n=n??te.default,i=i??0,l(o)||(o=new e),!l(t))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;let r=oe.subsample(t,n,i,sNe);return e.fromPoints(r,o)}static fromVertices(t,n,i,o){if(l(o)||(o=new e),!l(t)||t.length===0)return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;n=n??h.ZERO,i=i??3;let r=Z7;r.x=t[0]+n.x,r.y=t[1]+n.y,r.z=t[2]+n.z;let a=h.clone(r,Y7),s=h.clone(r,X7),c=h.clone(r,K7),u=h.clone(r,Q7),f=h.clone(r,$7),d=h.clone(r,J7),p=t.length,g;for(g=0;g<p;g+=i){let _=t[g]+n.x,C=t[g+1]+n.y,v=t[g+2]+n.z;r.x=_,r.y=C,r.z=v,_<a.x&&h.clone(r,a),_>u.x&&h.clone(r,u),C<s.y&&h.clone(r,s),C>f.y&&h.clone(r,f),v<c.z&&h.clone(r,c),v>d.z&&h.clone(r,d)}let m=h.magnitudeSquared(h.subtract(u,a,js)),A=h.magnitudeSquared(h.subtract(f,s,js)),y=h.magnitudeSquared(h.subtract(d,c,js)),x=a,b=u,T=m;A>T&&(T=A,x=s,b=f),y>T&&(T=y,x=c,b=d);let E=eW;E.x=(x.x+b.x)*.5,E.y=(x.y+b.y)*.5,E.z=(x.z+b.z)*.5;let S=h.magnitudeSquared(h.subtract(b,E,js)),w=Math.sqrt(S),P=tW;P.x=a.x,P.y=s.y,P.z=c.z;let O=nW;O.x=u.x,O.y=f.y,O.z=d.z;let B=h.midpoint(P,O,iW),L=0;for(g=0;g<p;g+=i){r.x=t[g]+n.x,r.y=t[g+1]+n.y,r.z=t[g+2]+n.z;let _=h.magnitude(h.subtract(r,B,js));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(r,E,js));if(C>S){let v=Math.sqrt(C);w=(w+v)*.5,S=w*w;let I=v-w;E.x=(w*E.x+I*r.x)/v,E.y=(w*E.y+I*r.y)/v,E.z=(w*E.z+I*r.z)/v}}return w<L?(h.clone(E,o.center),o.radius=w):(h.clone(B,o.center),o.radius=L),o}static fromEncodedCartesianVertices(t,n,i){if(l(i)||(i=new e),!l(t)||!l(n)||t.length!==n.length||t.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let o=Z7;o.x=t[0]+n[0],o.y=t[1]+n[1],o.z=t[2]+n[2];let r=h.clone(o,Y7),a=h.clone(o,X7),s=h.clone(o,K7),c=h.clone(o,Q7),u=h.clone(o,$7),f=h.clone(o,J7),d=t.length,p;for(p=0;p<d;p+=3){let L=t[p]+n[p],_=t[p+1]+n[p+1],C=t[p+2]+n[p+2];o.x=L,o.y=_,o.z=C,L<r.x&&h.clone(o,r),L>c.x&&h.clone(o,c),_<a.y&&h.clone(o,a),_>u.y&&h.clone(o,u),C<s.z&&h.clone(o,s),C>f.z&&h.clone(o,f)}let g=h.magnitudeSquared(h.subtract(c,r,js)),m=h.magnitudeSquared(h.subtract(u,a,js)),A=h.magnitudeSquared(h.subtract(f,s,js)),y=r,x=c,b=g;m>b&&(b=m,y=a,x=u),A>b&&(b=A,y=s,x=f);let T=eW;T.x=(y.x+x.x)*.5,T.y=(y.y+x.y)*.5,T.z=(y.z+x.z)*.5;let E=h.magnitudeSquared(h.subtract(x,T,js)),S=Math.sqrt(E),w=tW;w.x=r.x,w.y=a.y,w.z=s.z;let P=nW;P.x=c.x,P.y=u.y,P.z=f.z;let O=h.midpoint(w,P,iW),B=0;for(p=0;p<d;p+=3){o.x=t[p]+n[p],o.y=t[p+1]+n[p+1],o.z=t[p+2]+n[p+2];let L=h.magnitude(h.subtract(o,O,js));L>B&&(B=L);let _=h.magnitudeSquared(h.subtract(o,T,js));if(_>E){let C=Math.sqrt(_);S=(S+C)*.5,E=S*S;let v=C-S;T.x=(S*T.x+v*o.x)/C,T.y=(S*T.y+v*o.y)/C,T.z=(S*T.z+v*o.z)/C}}return S<B?(h.clone(T,i.center),i.radius=S):(h.clone(O,i.center),i.radius=B),i}static fromCornerPoints(t,n,i){l(i)||(i=new e);let o=h.midpoint(t,n,i.center);return i.radius=h.distance(o,n),i}static fromEllipsoid(t,n){return l(n)||(n=new e),h.clone(h.ZERO,n.center),n.radius=t.maximumRadius,n}static fromBoundingSpheres(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=t.length;if(i===1)return e.clone(t[0],n);if(i===2)return e.union(t[0],t[1],n);let o=[],r;for(r=0;r<i;r++)o.push(t[r].center);n=e.fromPoints(o,n);let a=n.center,s=n.radius;for(r=0;r<i;r++){let c=t[r];s=Math.max(s,h.distance(a,c.center)+c.radius)}return n.radius=s,n}static fromOrientedBoundingBox(t,n){l(n)||(n=new e);let i=t.halfAxes,o=$.getColumn(i,0,cNe),r=$.getColumn(i,1,lNe),a=$.getColumn(i,2,uNe);return h.add(o,r,o),h.add(o,a,o),n.center=h.clone(t.center,n.center),n.radius=h.magnitude(o),n}static fromTransformation(t,n){l(n)||(n=new e);let i=R.getTranslation(t,fNe),o=R.getScale(t,dNe),r=.5*h.magnitude(o);return n.center=h.clone(i,n.center),n.radius=r,n}static clone(t,n){if(l(t))return l(n)?(n.center=h.clone(t.center,n.center),n.radius=t.radius,n):new e(t.center,t.radius)}static pack(t,n,i){i=i??0;let o=t.center;return n[i++]=o.x,n[i++]=o.y,n[i++]=o.z,n[i]=t.radius,n}static unpack(t,n,i){n=n??0,l(i)||(i=new e);let o=i.center;return o.x=t[n++],o.y=t[n++],o.z=t[n++],i.radius=t[n],i}static union(t,n,i){l(i)||(i=new e);let o=t.center,r=t.radius,a=n.center,s=n.radius,c=h.subtract(a,o,hNe),u=h.magnitude(c);if(r>=u+s)return t.clone(i),i;if(s>=u+r)return n.clone(i),i;let f=(r+u+s)*.5,d=h.multiplyByScalar(c,(-r+f)/u,mNe);return h.add(d,o,d),h.clone(d,i.center),i.radius=f,i}static expand(t,n,i){i=e.clone(t,i);let o=h.magnitude(h.subtract(n,i.center,pNe));return o>i.radius&&(i.radius=o),i}static intersectPlane(t,n){let i=t.center,o=t.radius,r=n.normal,a=h.dot(r,i)+n.distance;return a<-o?qt.OUTSIDE:a<o?qt.INTERSECTING:qt.INSIDE}static transform(t,n,i){return l(i)||(i=new e),i.center=R.multiplyByPoint(n,t.center,i.center),i.radius=R.getMaximumScale(n)*t.radius,i}static distanceSquaredTo(t,n){let i=h.subtract(t.center,n,gNe),o=h.magnitude(i)-t.radius;return o<=0?0:o*o}static transformWithoutScale(t,n,i){return l(i)||(i=new e),i.center=R.multiplyByPoint(n,t.center,i.center),i.radius=t.radius,i}static computePlaneDistances(t,n,i,o){l(o)||(o=new ia);let r=h.subtract(t.center,n,_Ne),a=h.dot(i,r);return o.start=a-t.radius,o.stop=a+t.radius,o}static projectTo2D(t,n,i){bre._ellipsoid=te.default,n=n??bre;let o=n.ellipsoid,r=t.center,a=t.radius,s;h.equals(r,h.ZERO)?s=h.clone(h.UNIT_X,xre):s=o.geodeticSurfaceNormal(r,xre);let c=h.cross(h.UNIT_Z,s,ANe);h.normalize(c,c);let u=h.cross(s,c,yNe);h.normalize(u,u),h.multiplyByScalar(s,a,s),h.multiplyByScalar(u,a,u),h.multiplyByScalar(c,a,c);let f=h.negate(u,bNe),d=h.negate(c,xNe),p=Tre,g=p[0];h.add(s,u,g),h.add(g,c,g),g=p[1],h.add(s,u,g),h.add(g,d,g),g=p[2],h.add(s,f,g),h.add(g,d,g),g=p[3],h.add(s,f,g),h.add(g,c,g),h.negate(s,s),g=p[4],h.add(s,u,g),h.add(g,c,g),g=p[5],h.add(s,u,g),h.add(g,d,g),g=p[6],h.add(s,f,g),h.add(g,d,g),g=p[7],h.add(s,f,g),h.add(g,c,g);let m=p.length;for(let b=0;b<m;++b){let T=p[b];h.add(r,T,T);let E=o.cartesianToCartographic(T,TNe);n.project(E,T)}i=e.fromPoints(p,i),r=i.center;let A=r.x,y=r.y,x=r.z;return r.x=x,r.y=A,r.z=y,i}static isOccluded(t,n){return!n.isBoundingSphereVisible(t)}static equals(t,n){return t===n||l(t)&&l(n)&&h.equals(t.center,n.center)&&t.radius===n.radius}intersectPlane(t){return e.intersectPlane(this,t)}distanceSquaredTo(t){return e.distanceSquaredTo(this,t)}computePlaneDistances(t,n,i){return e.computePlaneDistances(this,t,n,i)}isOccluded(t){return e.isOccluded(this,t)}equals(t){return e.equals(this,t)}clone(t){return e.clone(this,t)}volume(){let t=this.radius;return oNe*t*t*t}};SM.packedLength=4;var Y7=new h,X7=new h,K7=new h,Q7=new h,$7=new h,J7=new h,Z7=new h,js=new h,eW=new h,tW=new h,nW=new h,iW=new h,oNe=4/3*D.PI,yre=new Hi,rNe=new h,aNe=new h,oW=new de,rW=new de,sNe=[],cNe=new h,lNe=new h,uNe=new h,fNe=new h,dNe=new h,hNe=new h,mNe=new h,pNe=new h,gNe=new h,_Ne=new h,xre=new h,ANe=new h,yNe=new h,xNe=new h,bNe=new h,TNe=new de,Tre=new Array(8);for(let e=0;e<8;++e)Tre[e]=new h;var bre=new Hi,ce=SM;function CNe(e){e=e??G.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 _n=CNe;var Cre={NONE:0,TOP:1,ALL:2};Object.freeze(Cre);var ln=Cre;function ka(e){e=e??G.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}ka.POSITION_ONLY=Object.freeze(new ka({position:!0}));ka.POSITION_AND_NORMAL=Object.freeze(new ka({position:!0,normal:!0}));ka.POSITION_NORMAL_AND_ST=Object.freeze(new ka({position:!0,normal:!0,st:!0}));ka.POSITION_AND_ST=Object.freeze(new ka({position:!0,st:!0}));ka.POSITION_AND_COLOR=Object.freeze(new ka({position:!0,color:!0}));ka.ALL=Object.freeze(new ka({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ka.DEFAULT=ka.POSITION_NORMAL_AND_ST;ka.packedLength=6;ka.pack=function(e,t,n){return n=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};ka.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ka),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};ka.clone=function(e,t){if(l(e))return l(t)||(t=new ka),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 Ne=ka;var ENe=new h;function Wu(e){e=e??G.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Ne.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Wu.fromDimensions=function(e){e=e??G.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Wu({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Wu.fromAxisAlignedBoundingBox=function(e){return new Wu({minimum:e.minimum,maximum:e.maximum})};Wu.packedLength=2*h.packedLength+Ne.packedLength+1;Wu.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Ne.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Ne.packedLength]=e._offsetAttribute??-1,t};var vre=new h,Sre=new h,wre=new Ne,Ere={minimum:vre,maximum:Sre,vertexFormat:wre,offsetAttribute:void 0};Wu.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,vre),o=h.unpack(e,t+h.packedLength,Sre),r=Ne.unpack(e,t+2*h.packedLength,wre),a=e[t+2*h.packedLength+Ne.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(o,n._maximum),n._vertexFormat=Ne.clone(r,n._vertexFormat),n._offsetAttribute=a===-1?void 0:a,n):(Ere.offsetAttribute=a===-1?void 0:a,new Wu(Ere))};Wu.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let o=new _n,r,a;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(a=new Float64Array(72),a[0]=t.x,a[1]=t.y,a[2]=n.z,a[3]=n.x,a[4]=t.y,a[5]=n.z,a[6]=n.x,a[7]=n.y,a[8]=n.z,a[9]=t.x,a[10]=n.y,a[11]=n.z,a[12]=t.x,a[13]=t.y,a[14]=t.z,a[15]=n.x,a[16]=t.y,a[17]=t.z,a[18]=n.x,a[19]=n.y,a[20]=t.z,a[21]=t.x,a[22]=n.y,a[23]=t.z,a[24]=n.x,a[25]=t.y,a[26]=t.z,a[27]=n.x,a[28]=n.y,a[29]=t.z,a[30]=n.x,a[31]=n.y,a[32]=n.z,a[33]=n.x,a[34]=t.y,a[35]=n.z,a[36]=t.x,a[37]=t.y,a[38]=t.z,a[39]=t.x,a[40]=n.y,a[41]=t.z,a[42]=t.x,a[43]=n.y,a[44]=n.z,a[45]=t.x,a[46]=t.y,a[47]=n.z,a[48]=t.x,a[49]=n.y,a[50]=t.z,a[51]=n.x,a[52]=n.y,a[53]=t.z,a[54]=n.x,a[55]=n.y,a[56]=n.z,a[57]=t.x,a[58]=n.y,a[59]=n.z,a[60]=t.x,a[61]=t.y,a[62]=t.z,a[63]=n.x,a[64]=t.y,a[65]=t.z,a[66]=n.x,a[67]=t.y,a[68]=n.z,a[69]=t.x,a[70]=t.y,a[71]=n.z,o.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}r=new Uint16Array(36),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 a=new Float64Array(24),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=n.x,a[4]=t.y,a[5]=t.z,a[6]=n.x,a[7]=n.y,a[8]=t.z,a[9]=t.x,a[10]=n.y,a[11]=t.z,a[12]=t.x,a[13]=t.y,a[14]=n.z,a[15]=n.x,a[16]=t.y,a[17]=n.z,a[18]=n.x,a[19]=n.y,a[20]=n.z,a[21]=t.x,a[22]=n.y,a[23]=n.z,o.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a}),r=new Uint16Array(36),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 s=h.subtract(n,t,ENe),c=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let u=a.length,f=e._offsetAttribute===ln.NONE?0:1,d=new Uint8Array(u/3).fill(f);o.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new At({attributes:o,indices:r,primitiveType:Re.TRIANGLES,boundingSphere:new ce(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var aW;Wu.getUnitBox=function(){return l(aW)||(aW=Wu.createGeometry(Wu.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Ne.POSITION_ONLY}))),aW};var Uc=Wu;var fo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};fo.getMathType=function(e){switch(e){case fo.SCALAR:return Number;case fo.VEC2:return z;case fo.VEC3:return h;case fo.VEC4:return se;case fo.MAT2:return Wi;case fo.MAT3:return $;case fo.MAT4:return R}};fo.getNumberOfComponents=function(e){switch(e){case fo.SCALAR:return 1;case fo.VEC2:return 2;case fo.VEC3:return 3;case fo.VEC4:case fo.MAT2:return 4;case fo.MAT3:return 9;case fo.MAT4:return 16}};fo.getAttributeLocationCount=function(e){switch(e){case fo.SCALAR:case fo.VEC2:case fo.VEC3:case fo.VEC4:return 1;case fo.MAT2:return 2;case fo.MAT3:return 3;case fo.MAT4:return 4}};fo.getGlslType=function(e){switch(e){case fo.SCALAR:return"float";case fo.VEC2:return"vec2";case fo.VEC3:return"vec3";case fo.VEC4:return"vec4";case fo.MAT2:return"mat2";case fo.MAT3:return"mat3";case fo.MAT4:return"mat4"}};Object.freeze(fo);var Ft=fo;var Ire=1/256,vNe=65536,cW=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))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(o)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};yo.octEncode=function(e,t){return yo.octEncodeInRange(e,255,t)};var kw=new z,Dre=new Uint8Array(1);function wM(e){return Dre[0]=e,Dre[0]}yo.octEncodeToCartesian4=function(e,t){return yo.octEncodeInRange(e,65535,kw),t.x=wM(kw.x*Ire),t.y=wM(kw.x),t.z=wM(kw.y*Ire),t.w=wM(kw.y),t};yo.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.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))*D.signNotZero(o),i.y=(1-Math.abs(o))*D.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,a=n*cW+i,s=o*cW+r;return yo.octDecodeInRange(a,s,65535,t)};yo.octPackFloat=function(e){return 256*e.x+e.y};var lW=new z;yo.octEncodeFloat=function(e){return yo.octEncode(e,lW),yo.octPackFloat(lW)};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),a=yo.octEncode(n,lW);return i.x=65536*a.x+o,i.y=65536*a.y+r,i};yo.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),a=(o-r)*65536;o=e.y/65536;let s=Math.floor(o),c=(o-s)*65536;yo.octDecodeFloat(a,t),yo.octDecodeFloat(c,n),yo.octDecode(r,s,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 sW(e){return e>>1^-(e&1)}yo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,a=0;for(let s=0;s<i;++s)o+=sW(e[s]),r+=sW(t[s]),e[s]=o,t[s]=r,l(n)&&(a+=sW(n[s]),n[s]=a)};yo.dequantize=function(e,t,n,i){let o=Ft.getNumberOfComponents(n),r;switch(t){case Y.BYTE:r=127;break;case Y.UNSIGNED_BYTE:r=255;break;case Y.SHORT:r=32767;break;case Y.UNSIGNED_SHORT:r=65535;break;case Y.INT:r=2147483647;break;case Y.UNSIGNED_INT:r=4294967295;break}let a=new Float32Array(i*o);for(let s=0;s<i;s++)for(let c=0;c<o;c++){let u=s*o+c;a[u]=Math.max(e[u]/r,-1)}return a};yo.encodeRGB8=function(e){return Math.round(D.clamp(e.red*255,0,255))*vNe+Math.round(D.clamp(e.green*255,0,255))*cW+Math.round(D.clamp(e.blue*255,0,255))};yo.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};yo.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,a=1/63;for(let s=0;s<n;s++){let c=e[s],u=c>>11,f=c>>5&o,d=c&i,p=3*s;t[p]=u*r,t[p+1]=f*a,t[p+2]=d*r}return t};var on=yo;var Pre=new h,Rre=new h,Ore=new h;function SNe(e,t,n,i,o){l(o)||(o=new h);let r,a,s,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,Pre),a=h.subtract(i,t,Rre),s=h.subtract(e,t,Ore),c=h.dot(r,r),u=h.dot(r,a),f=h.dot(r,s),d=h.dot(a,a),p=h.dot(a,s)}else{if(z.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,o);if(z.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,o);if(z.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,o);r=z.subtract(n,t,Pre),a=z.subtract(i,t,Rre),s=z.subtract(e,t,Ore),c=z.dot(r,r),u=z.dot(r,a),f=z.dot(r,s),d=z.dot(a,a),p=z.dot(a,s)}o.y=d*f-u*p,o.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var jT=SNe;function Tm(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Tm.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 f0={high:0,low:0};Tm.fromCartesian=function(e,t){l(t)||(t=new Tm);let n=t.high,i=t.low;return Tm.encode(e.x,f0),n.x=f0.high,i.x=f0.low,Tm.encode(e.y,f0),n.y=f0.high,i.y=f0.low,Tm.encode(e.z,f0),n.z=f0.high,i.z=f0.low,t};var uW=new Tm;Tm.writeElements=function(e,t,n){Tm.fromCartesian(e,uW);let i=uW.high,o=uW.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 Tn=Tm;var fW={};fW.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Mre(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}fW.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),u=Math.abs(e);if(c<u&&c/u<D.EPSILON14)return[0,0];if(c>u&&u/c<D.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,a=Mre(o,-r,D.EPSILON14);if(a<0)return[];let s=-.5*Mre(t,D.sign(t)*Math.sqrt(a),D.EPSILON14);return t>0?[s/e,n/s]:[n/s,s/e]};var Jl=fW;var hW={};hW.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,a=n*n,s=i*i;return 18*e*t*n*i+r*a-27*o*s-4*(e*a*n+r*t*i)};function dW(e,t,n,i){let o=e,r=t/3,a=n/3,s=i,c=o*a,u=r*s,f=r*r,d=a*a,p=o*a-f,g=o*s-r*a,m=r*s-d,A=4*p*m-g*g,y,x;if(A<0){let W,q,J;f*u>=c*d?(W=o,q=p,J=-2*r*p+o*g):(W=s,q=m,J=-s*g+2*a*m);let Z=-(J<0?-1:1)*Math.abs(W)*Math.sqrt(-A);x=-J+Z;let K=x/2,le=K<0?-Math.pow(-K,1/3):Math.pow(K,1/3),me=x===Z?-le:-q/le;return y=q<=0?le+me:-J/(le*le+me*me+q),f*u>=c*d?[(y-r)/o]:[-s/(y+a)]}let b=p,T=-2*r*p+o*g,E=m,S=-s*g+2*a*m,w=Math.sqrt(A),P=Math.sqrt(3)/2,O=Math.abs(Math.atan2(o*w,-T)/3);y=2*Math.sqrt(-b);let B=Math.cos(O);x=y*B;let L=y*(-B/2-P*Math.sin(O)),_=x+L>2*r?x-r:L-r,C=o,v=_/C;O=Math.abs(Math.atan2(s*w,-S)/3),y=2*Math.sqrt(-E),B=Math.cos(O),x=y*B,L=y*(-B/2-P*Math.sin(O));let I=-s,M=x+L<2*a?x+a:L+a,N=I/M,j=C*M,k=-_*M-C*I,V=_*I,F=(a*k-r*V)/(-r*k+a*j);return v<=F?v<=N?F<=N?[v,F,N]:[v,N,F]:[N,v,F]:v<=N?[F,v,N]:F<=N?[F,N,v]:[N,F,v]}hW.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Jl.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let a=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[a,a,a]}else if(i===0)return o=Jl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return dW(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):dW(e,t,0,i);if(i===0)return o=Jl.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 dW(e,t,n,i)};var GT=hW;var mW={};mW.computeDiscriminant=function(e,t,n,i,o){let r=e*e,a=r*e,s=t*t,c=s*t,u=n*n,f=u*n,d=i*i,p=d*i,g=o*o,m=g*o;return s*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*r*d*d+256*a*m+o*(18*c*n*i-4*s*f+16*e*u*u-80*e*t*u*i-6*e*s*d+144*r*n*d)+g*(144*e*s*n-27*s*s-128*r*u-192*r*t*i)};function nh(e,t,n,i){let o=e*e,r=t-3*o/8,a=n-t*e/2+o*e/8,s=i-n*e/4+t*o/16-3*o*o/256,c=GT.computeRealRoots(1,2*r,r*r-4*s,-a*a);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<D.EPSILON14){let d=Jl.computeRealRoots(1,r,s);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let A=Math.sqrt(p),y=Math.sqrt(g);return[u-y,u-A,u+A,u+y]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(r+f-a/d)/2,g=(r+f+a/d)/2,m=Jl.computeRealRoots(1,d,p),A=Jl.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,A.length!==0?(A[0]+=u,A[1]+=u,m[1]<=A[0]?[m[0],m[1],A[0],A[1]]:A[1]<=m[0]?[A[0],A[1],m[0],m[1]]:m[0]>=A[0]&&m[1]<=A[1]?[A[0],m[0],m[1],A[1]]:A[0]>=m[0]&&A[1]<=m[1]?[m[0],A[0],A[1],m[1]]:m[0]>A[0]&&m[0]<A[1]?[A[0],m[0],A[1],m[1]]:[m[0],A[0],m[1],A[1]]):m):A.length!==0?(A[0]+=u,A[1]+=u,A):[]}}return[]}function zw(e,t,n,i){let o=n*n,r=t*t,a=e*e,s=-2*t,c=n*e+r-4*i,u=a*i-n*t*e+o,f=GT.computeRealRoots(1,s,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,A=p/2,y=g-4*i,x=g+4*Math.abs(i),b=a-4*d,T=a+4*Math.abs(d),E,S;if(d<0||y*T<b*x){let C=Math.sqrt(b);E=C/2,S=C===0?0:(e*A-n)/C}else{let C=Math.sqrt(y);E=C===0?0:(e*A-n)/C,S=C/2}let w,P;m===0&&E===0?(w=0,P=0):D.sign(m)===D.sign(E)?(w=m+E,P=d/w):(P=m-E,w=d/P);let O,B;A===0&&S===0?(O=0,B=0):D.sign(A)===D.sign(S)?(O=A+S,B=i/O):(B=A-S,O=i/B);let L=Jl.computeRealRoots(1,w,O),_=Jl.computeRealRoots(1,P,B);if(L.length!==0)return _.length!==0?L[1]<=_[0]?[L[0],L[1],_[0],_[1]]:_[1]<=L[0]?[_[0],_[1],L[0],L[1]]:L[0]>=_[0]&&L[1]<=_[1]?[_[0],L[0],L[1],_[1]]:_[0]>=L[0]&&_[1]<=L[1]?[L[0],_[0],_[1],L[1]]:L[0]>_[0]&&L[0]<_[1]?[_[0],L[0],_[1],L[1]]:[L[0],_[0],L[1],_[1]]:L;if(_.length!==0)return _}return[]}mW.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<D.EPSILON15)return GT.computeRealRoots(t,n,i,o);let r=t/e,a=n/e,s=i/e,c=o/e,u=r<0?1:0;switch(u+=a<0?u+1:u,u+=s<0?u+1:u,u+=c<0?u+1:u,u){case 0:return nh(r,a,s,c);case 1:return zw(r,a,s,c);case 2:return zw(r,a,s,c);case 3:return nh(r,a,s,c);case 4:return nh(r,a,s,c);case 5:return zw(r,a,s,c);case 6:return nh(r,a,s,c);case 7:return nh(r,a,s,c);case 8:return zw(r,a,s,c);case 9:return nh(r,a,s,c);case 10:return nh(r,a,s,c);case 11:return zw(r,a,s,c);case 12:return nh(r,a,s,c);case 13:return nh(r,a,s,c);case 14:return nh(r,a,s,c);case 15:return nh(r,a,s,c);default:return}};var IM=mW;var pW=class e{constructor(t,n){n=h.clone(n??h.ZERO),h.equals(n,h.ZERO)||h.normalize(n,n),this.origin=h.clone(t??h.ZERO),this.direction=n}static clone(t,n){if(l(t))return l(n)?(n.origin=h.clone(t.origin),n.direction=h.clone(t.direction),n):new e(t.origin,t.direction)}static getPoint(t,n,i){return l(i)||(i=new h),i=h.multiplyByScalar(t.direction,n,i),h.add(t.origin,i,i)}},An=pW;var Wo={};Wo.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,o=e.direction,r=t.normal,a=h.dot(r,o);if(Math.abs(a)<D.EPSILON15)return;let s=(-t.distance-h.dot(r,i))/a;if(!(s<0))return n=h.multiplyByScalar(o,s,n),h.add(i,n,n)};var wNe=new h,INe=new h,Vre=new h,Bre=new h,Lre=new h;Wo.rayTriangleParametric=function(e,t,n,i,o){o=o??!1;let r=e.origin,a=e.direction,s=h.subtract(n,t,wNe),c=h.subtract(i,t,INe),u=h.cross(a,c,Vre),f=h.dot(s,u),d,p,g,m,A;if(o){if(f<D.EPSILON6||(d=h.subtract(r,t,Bre),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,s,Lre),m=h.dot(a,p),m<0||g+m>f))return;A=h.dot(c,p)/f}else{if(Math.abs(f)<D.EPSILON6)return;let y=1/f;if(d=h.subtract(r,t,Bre),g=h.dot(d,u)*y,g<0||g>1||(p=h.cross(d,s,Lre),m=h.dot(a,p)*y,m<0||g+m>1))return;A=h.dot(c,p)*y}return A};Wo.rayTriangle=function(e,t,n,i,o,r){let a=Wo.rayTriangleParametric(e,t,n,i,o);if(!(!l(a)||a<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,a,r),h.add(e.origin,r,r)};var DNe=new An;Wo.lineSegmentTriangle=function(e,t,n,i,o,r,a){let s=DNe;h.clone(e,s.origin),h.subtract(t,e,s.direction),h.normalize(s.direction,s.direction);let c=Wo.rayTriangleParametric(s,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(a)||(a=new h),h.multiplyByScalar(s.direction,c,a),h.add(s.origin,a,a)};function PNe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let a=1/(2*e),s=Math.sqrt(o),c=(-t+s)*a,u=(-t-s)*a;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var RNe={root0:0,root1:0};function jre(e,t,n){l(n)||(n=new ia);let i=e.origin,o=e.direction,r=t.center,a=t.radius*t.radius,s=h.subtract(i,r,Vre),c=h.dot(o,o),u=2*h.dot(o,s),f=h.magnitudeSquared(s)-a,d=PNe(c,u,f,RNe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Wo.raySphere=function(e,t,n){if(n=jre(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var ONe=new An;Wo.lineSegmentSphere=function(e,t,n,i){let o=ONe;h.clone(e,o.origin);let r=h.subtract(t,e,o.direction),a=h.magnitude(r);if(h.normalize(r,r),i=jre(o,n,i),!(!l(i)||i.stop<0||i.start>a))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,a),i};var MNe=new h,BNe=new h;Wo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,MNe),o=h.multiplyComponents(n,e.direction,BNe),r=h.magnitudeSquared(i),a=h.dot(i,o),s,c,u,f,d;if(r>1){if(a>=0)return;let p=a*a;if(s=r-1,c=h.magnitudeSquared(o),u=c*s,p<u)return;if(p>u){f=a*a-u,d=-a+Math.sqrt(f);let m=d/c,A=s/d;return m<A?new ia(m,A):{start:A,stop:m}}let g=Math.sqrt(s/c);return new ia(g,g)}else if(r<1)return s=r-1,c=h.magnitudeSquared(o),u=c*s,f=a*a-u,d=-a+Math.sqrt(f),new ia(0,d/c);if(a<0)return c=h.magnitudeSquared(o),new ia(0,-a/c)};var LNe=new ia,NNe=new ia,FNe=new ia;Wo.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new ia);let i=gW(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,LNe),o=gW(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,NNe),r=gW(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,FNe);if(n.start=i.start>o.start?i.start:o.start,n.stop=i.stop<o.stop?i.stop:o.stop,!(i.start>o.stop||o.start>i.stop)&&!(n.start>r.stop||r.start>n.stop))return r.start>n.start&&(n.start=r.start),r.stop<n.stop&&(n.stop=r.stop),n};function gW(e,t,n,i,o){if(o.start=(n-e)/t,o.stop=(i-e)/t,o.stop<o.start){let r=o.stop;o.stop=o.start,o.start=r}return o}function Ly(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Wo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,a=o*o,s=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*a,c=o*(i*Ly(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*a+i*t.x+n,f=a*Ly(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],D.EPSILON15),d=o*(i*Ly(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Jl.computeRealRoots(s,c,u),p.length===0)return g;let O=p[0],B=Math.sqrt(Math.max(1-O*O,0));if(g.push(new h(i,o*O,o*-B)),g.push(new h(i,o*O,o*B)),p.length===2){let L=p[1],_=Math.sqrt(Math.max(1-L*L,0));g.push(new h(i,o*L,o*-_)),g.push(new h(i,o*L,o*_))}return g}let m=d*d,A=f*f,y=s*s,x=d*f,b=y+A,T=2*(c*s+x),E=2*u*s+c*c-A+m,S=2*(u*c-x),w=u*u-m;if(b===0&&T===0&&E===0&&S===0)return g;p=IM.computeRealRoots(b,T,E,S,w);let P=p.length;if(P===0)return g;for(let O=0;O<P;++O){let B=p[O],L=B*B,_=Math.max(1-L,0),C=Math.sqrt(_),v;D.sign(s)===D.sign(u)?v=Ly(s*L+u,c*B,D.EPSILON12):D.sign(u)===D.sign(c*B)?v=Ly(s*L,c*B+u,D.EPSILON12):v=Ly(s*L+c*B,u,D.EPSILON12);let I=Ly(f*B,d,D.EPSILON15),M=v*I;M<0?g.push(new h(i,o*B,o*C)):M>0?g.push(new h(i,o*B,o*-C)):C!==0?(g.push(new h(i,o*B,o*-C)),g.push(new h(i,o*B,o*C)),++O):g.push(new h(i,o*B,o*C))}return g};var _W=new h,Nre=new h,Fre=new h,DM=new h,kNe=new h,zNe=new $,UNe=new $,VNe=new $,jNe=new $,GNe=new $,kre=new $,zre=new $,Ure=new h,HNe=new h,WNe=new de;Wo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let w=t.geodeticSurfaceNormal(n,_W);if(h.dot(i,w)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,_W),a=h.normalize(r,r),s=h.mostOrthogonalAxis(r,DM),c=h.normalize(h.cross(s,a,Nre),Nre),u=h.normalize(h.cross(a,c,Fre),Fre),f=zNe;f[0]=a.x,f[1]=a.y,f[2]=a.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,UNe),p=$.fromScale(t.radii,VNe),g=$.fromScale(t.oneOverRadii,jNe),m=GNe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let A=$.multiply($.multiply(d,g,kre),m,kre),y=$.multiply($.multiply(A,p,zre),f,zre),x=$.multiplyByVector(A,n,kNe),b=Wo.quadraticVectorExpression(y,h.negate(x,_W),0,0,1),T,E,S=b.length;if(S>0){let w=h.clone(h.ZERO,HNe),P=Number.NEGATIVE_INFINITY;for(let B=0;B<S;++B){T=$.multiplyByVector(p,$.multiplyByVector(f,b[B],Ure),Ure);let L=h.normalize(h.subtract(T,n,DM),DM),_=h.dot(L,i);_>P&&(P=_,w=h.clone(T,w))}let O=t.cartesianToCartographic(w,WNe);return P=D.clamp(P,0,1),E=h.magnitude(h.subtract(w,n,DM))*Math.sqrt(1-P*P),E=o?-E:E,O.height=E,t.cartographicToCartesian(O,new h)}};var qNe=new h;Wo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,qNe),r=n.normal,a=h.dot(r,o);if(Math.abs(a)<D.EPSILON6)return;let s=h.dot(r,e),c=-(n.distance+s)/a;if(!(c<0||c>1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};Wo.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,a=h.dot(o,e)+r<0,s=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,u=0;u+=a?1:0,u+=s?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(a)return Wo.lineSegmentPlane(e,t,i,f),Wo.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return Wo.lineSegmentPlane(t,n,i,f),Wo.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Wo.lineSegmentPlane(n,e,i,f),Wo.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(a)if(s){if(!c)return Wo.lineSegmentPlane(e,n,i,f),Wo.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Wo.lineSegmentPlane(n,t,i,f),Wo.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Wo.lineSegmentPlane(t,e,i,f),Wo.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var ui=Wo;function bs(e,t){this.normal=h.clone(e),this.distance=t}bs.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new bs(t,i)};var YNe=new h;bs.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,YNe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new bs(n,i)};bs.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var XNe=new h;bs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=bs.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,XNe);return h.subtract(t,o,n)};var KNe=new R,QNe=new se,$Ne=new h;bs.transform=function(e,t,n){let i=e.normal,o=e.distance,r=R.inverseTranspose(t,KNe),a=se.fromElements(i.x,i.y,i.z,o,QNe);a=R.multiplyByVector(r,a,a);let s=h.fromCartesian4(a,$Ne);return a=se.divideByScalar(a,h.magnitude(s),a),bs.fromCartesian4(a,n)};bs.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new bs(e.normal,e.distance)};bs.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};bs.ORIGIN_XY_PLANE=Object.freeze(new bs(h.UNIT_Z,0));bs.ORIGIN_YZ_PLANE=Object.freeze(new bs(h.UNIT_X,0));bs.ORIGIN_ZX_PLANE=Object.freeze(new bs(h.UNIT_Y,0));var tn=bs;var AW={};AW.calculateACMR=function(e){e=e??G.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o=t.length;if(!l(n)){n=0;let s=0,c=t[s];for(;s<o;)c>n&&(n=c),++s,c=t[s]}let r=[];for(let s=0;s<n+1;s++)r[s]=0;let a=i+1;for(let s=0;s<o;++s)a-r[t[s]]>i&&(r[t[s]]=a,++a);return(a-i+1)/(o/3)};AW.tipsify=function(e){e=e??G.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(_,C,v,I){for(;C.length>=1;){let M=C[C.length-1];if(C.splice(C.length-1,1),_[M].numLiveTriangles>0)return M}for(;o<I;){if(_[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function a(_,C,v,I,M,N,j){let k=-1,V,F=-1,W=0;for(;W<v.length;){let q=v[W];I[q].numLiveTriangles&&(V=0,M-I[q].timeStamp+2*I[q].numLiveTriangles<=C&&(V=M-I[q].timeStamp),(V>F||F===-1)&&(F=V,k=q)),++W}return k===-1?r(I,N,_,j):k}let s=t.length,c=0,u=0,f=t[u],d=s;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let A=0,y=i+1;o=1;let x=[],b=[],T,E,S=0,w=[],P=s/3,O=[];for(g=0;g<P;g++)O[g]=!1;let B,L;for(;A!==-1;){x=[],E=p[A],L=E.vertexTriangles.length;for(let _=0;_<L;++_)if(m=E.vertexTriangles[_],!O[m]){O[m]=!0,u=m+m+m;for(let C=0;C<3;++C)B=t[u],x.push(B),b.push(B),w[S]=B,++S,T=p[B],--T.numLiveTriangles,y-T.timeStamp>i&&(T.timeStamp=y,++y),++u}A=a(t,i,x,p,y,b,c)}return w};var PM=AW;var gl={};function FM(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function JNe(e){let t=e.length,n=t/3*6,i=Ue.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)FM(i,o,e[r],e[r+1],e[r+2]);return i}function ZNe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ue.createTypedArray(t,n);FM(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)FM(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function eFe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ue.createTypedArray(t,n),o=e[0],r=0;for(let a=1;a<t;++a,r+=6)FM(i,r,o,e[a],e[a+1]);return i}return new Uint16Array}gl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Re.TRIANGLES:e.indices=JNe(t);break;case Re.TRIANGLE_STRIP:e.indices=ZNe(t);break;case Re.TRIANGLE_FAN:e.indices=eFe(t);break}e.primitiveType=Re.LINES}return e};gl.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,a=new Float64Array(2*r),s=0;for(let f=0;f<r;f+=3)a[s++]=i[f],a[s++]=i[f+1],a[s++]=i[f+2],a[s++]=i[f]+o[f]*n,a[s++]=i[f+1]+o[f+1]*n,a[s++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ce(u.center,u.radius+n)),new At({attributes:{position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:Re.LINES,boundingSphere:c})};gl.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,a=t.length;for(r=0;r<a;++r){let s=t[r];l(n[s])&&(i[s]=o++)}for(let s in n)n.hasOwnProperty(s)&&!l(i[s])&&(i[s]=o++);return i};gl.reorderForPreVertexCache=function(e){let t=At.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,a=Ue.createTypedArray(t,r),s=0,c=0,u=0,f;for(;s<r;)f=i[o[s]],f!==-1?a[c]=f:(f=o[s],i[f]=u,a[c]=u,++u),++s,++c;e.indices=a;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,A=0,y=g.componentsPerAttribute,x=Y.createTypedArray(g.componentDatatype,u*y);for(;A<t;){let b=i[A];if(b!==-1)for(let T=0;T<y;T++)x[y*b+T]=m[y*A+T];++A}g.values=x}}return e};gl.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Re.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=PM.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Gre(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 Me({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function tFe(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])}}gl.fitToUnsignedShortIndices=function(e){let t=[],n=At.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,a=Gre(e.attributes),s=e.indices,c=s.length,u;e.primitiveType===Re.TRIANGLES?u=3:e.primitiveType===Re.LINES?u=2:e.primitiveType===Re.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=s[f+d],g=i[p];l(g)||(g=r++,i[p]=g,tFe(a,e.attributes,p)),o.push(g)}r+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new At({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,a=Gre(e.attributes))}o.length!==0&&t.push(new At({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Hre=new h,nFe=new de;gl.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Hi;let a=o.ellipsoid,s=r.values,c=new Float64Array(s.length),u=0;for(let f=0;f<s.length;f+=3){let d=h.fromArray(s,f,Hre),p=a.cartesianToCartographic(d,nFe),g=o.project(p,Hre);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=r,e.attributes[i]=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var yW={high:0,low:0};gl.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,a=r.length,s=new Float32Array(a),c=new Float32Array(a);for(let f=0;f<a;++f)Tn.encode(r[f],yW),s[f]=yW.high,c[f]=yW.low;let u=o.componentsPerAttribute;return e.attributes[n]=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:s}),e.attributes[i]=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var oh=new h;function xW(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,oh),R.multiplyByPoint(e,oh,oh),h.pack(oh,n,o)}}function bW(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,oh),$.multiplyByVector(e,oh,oh),oh=h.normalize(oh,oh),h.pack(oh,n,o)}}var RM=new R,OM=new $;gl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;let n=e.geometry.attributes;xW(t,n.position),xW(t,n.prevPosition),xW(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(R.inverse(t,RM),R.transpose(RM,RM),R.getMatrix3(RM,OM),bW(OM,n.normal),bW(OM,n.tangent),bW(OM,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ce.transform(i,t,i)),e.modelMatrix=R.clone(R.IDENTITY),e};function iFe(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 a=o[r],s=a.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){c=!1;break}s+=f.values.length}c&&(i[r]=new Me({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:Y.createTypedArray(a.componentDatatype,s)}))}return i}var oFe=new h;function TW(e,t){let n=e.length,i,o,r,a,s=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=iFe(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,a=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,g=p.length,r=0;r<g;++r)d[a++]=p[r];let m;if(c){let b=0;for(o=0;o<n;++o)b+=e[o][t].indices.length;let T=At.computeNumberOfVertices(new At({attributes:f,primitiveType:Re.POINTS})),E=Ue.createTypedArray(T,b),S=0,w=0;for(o=0;o<n;++o){let P=e[o][t].indices,O=P.length;for(a=0;a<O;++a)E[S++]=w+P[a];w+=At.computeNumberOfVertices(e[o][t])}m=E}let A=new h,y=0,x;for(o=0;o<n;++o){if(x=e[o][t].boundingSphere,!l(x)){A=void 0;break}h.add(x.center,A,A)}if(l(A))for(h.divideByScalar(A,n,A),o=0;o<n;++o){x=e[o][t].boundingSphere;let b=h.magnitude(h.subtract(x.center,A,oFe))+x.radius;b>y&&(y=b)}return new At({attributes:f,indices:m,primitiveType:u,boundingSphere:l(A)?new ce(A,y):void 0})}gl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r];l(a.geometry)?t.push(a):l(a.westHemisphereGeometry)&&l(a.eastHemisphereGeometry)&&n.push(a)}let o=[];return t.length>0&&o.push(TW(t,"geometry")),n.length>0&&(o.push(TW(n,"westHemisphereGeometry")),o.push(TW(n,"eastHemisphereGeometry"))),o};var Vf=new h,Uw=new h,HT=new h,WT=new h;gl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,a=new Array(o),s=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)a[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],A=t[u+1],y=t[u+2],x=m*3,b=A*3,T=y*3;Uw.x=i[x],Uw.y=i[x+1],Uw.z=i[x+2],HT.x=i[b],HT.y=i[b+1],HT.z=i[b+2],WT.x=i[T],WT.y=i[T+1],WT.z=i[T+2],a[m].count++,a[A].count++,a[y].count++,h.subtract(HT,Uw,HT),h.subtract(WT,Uw,WT),s[f]=h.cross(HT,WT,new h),f++}let d=0;for(u=0;u<o;u++)a[u].indexOffset+=d,d+=a[u].count;f=0;let p;for(u=0;u<r;u+=3){p=a[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=a[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=a[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=a[u],h.clone(h.ZERO,Vf),p.count>0){for(f=0;f<p.count;f++)h.add(Vf,s[c[p.indexOffset+f]],Vf);h.equalsEpsilon(h.ZERO,Vf,D.EPSILON10)&&h.clone(s[c[p.indexOffset]],Vf)}h.equalsEpsilon(h.ZERO,Vf,D.EPSILON10)&&(Vf.z=1),h.normalize(Vf,Vf),g[m]=Vf.x,g[m+1]=Vf.y,g[m+2]=Vf.z}return e.attributes.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var rFe=new h,Wre=new h,aFe=new h;gl.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,a=e.attributes.position.values.length/3,s=n.length,c=new Array(a*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<s;u+=3){let A=n[u],y=n[u+1],x=n[u+2];f=A*3,d=y*3,p=x*3;let b=A*2,T=y*2,E=x*2,S=i[f],w=i[f+1],P=i[f+2],O=r[b],B=r[b+1],L=r[T+1]-B,_=r[E+1]-B,C=1/((r[T]-O)*_-(r[E]-O)*L),v=(_*(i[d]-S)-L*(i[p]-S))*C,I=(_*(i[d+1]-w)-L*(i[p+1]-w))*C,M=(_*(i[d+2]-P)-L*(i[p+2]-P))*C;c[f]+=v,c[f+1]+=I,c[f+2]+=M,c[d]+=v,c[d+1]+=I,c[d+2]+=M,c[p]+=v,c[p+1]+=I,c[p+2]+=M}let g=new Float32Array(a*3),m=new Float32Array(a*3);for(u=0;u<a;u++){f=u*3,d=f+1,p=f+2;let A=h.fromArray(o,f,rFe),y=h.fromArray(c,f,aFe),x=h.dot(A,y);h.multiplyByScalar(A,x,Wre),h.normalize(h.subtract(y,Wre,y),y),g[f]=y.x,g[d]=y.y,g[p]=y.z,h.normalize(h.cross(A,y,y),y),m[f]=y.x,m[d]=y.y,m[p]=y.z}return e.attributes.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m}),e};var Vw=new z,ih=new h,qre=new h,Yre=new h,MM=new z;gl.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let w=t.values;i=w.length/3;let P=new Float32Array(i*2),O=0;for(n=0;n<i;++n){if(h.fromArray(w,n*3,ih),h.equals(ih,h.ZERO)){O+=2;continue}MM=on.octEncodeInRange(ih,65535,MM),P[O++]=MM.x,P[O++]=MM.y}return e.attributes.compressedAttributes=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:P}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,a=l(o),s=l(r);if(!a&&!s)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,A;a&&(p=o.values),s&&(g=r.values),f&&(m=c.values),d&&(A=u.values),i=(a?p.length:g.length)/(a?3:2);let b=i,T=s&&a?2:1;T+=f||d?1:0,b*=T;let E=new Float32Array(b),S=0;for(n=0;n<i;++n){s&&(z.fromArray(g,n*2,Vw),E[S++]=on.compressTextureCoordinates(Vw));let w=n*3;a&&l(m)&&l(A)?(h.fromArray(p,w,ih),h.fromArray(m,w,qre),h.fromArray(A,w,Yre),on.octPack(ih,qre,Yre,Vw),E[S++]=Vw.x,E[S++]=Vw.y):(a&&(h.fromArray(p,w,ih),E[S++]=on.octEncodeFloat(ih)),f&&(h.fromArray(m,w,ih),E[S++]=on.octEncodeFloat(ih)),d&&(h.fromArray(A,w,ih),E[S++]=on.octEncodeFloat(ih)))}return e.attributes.compressedAttributes=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:T,values:E}),a&&delete e.attributes.normal,s&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function sFe(e){if(l(e.indices))return e;let t=At.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function cFe(e){let t=At.computeNumberOfVertices(e),n=Ue.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=Re.TRIANGLES,e}function lFe(e){let t=At.computeNumberOfVertices(e),n=Ue.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=Re.TRIANGLES,e}function uFe(e){if(l(e.indices))return e;let t=At.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function fFe(e){let t=At.computeNumberOfVertices(e),n=Ue.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=Re.LINES,e}function dFe(e){let t=At.computeNumberOfVertices(e),n=Ue.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=Re.LINES,e}function hFe(e){switch(e.primitiveType){case Re.TRIANGLE_FAN:return cFe(e);case Re.TRIANGLE_STRIP:return lFe(e);case Re.TRIANGLES:return sFe(e);case Re.LINE_STRIP:return fFe(e);case Re.LINE_LOOP:return dFe(e);case Re.LINES:return uFe(e)}return e}function Jg(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function mFe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Jg(e,e.y<0),Jg(t,t.y<0),Jg(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),a;i>o?i>r?a=D.sign(e.y):a=D.sign(n.y):o>r?a=D.sign(t.y):a=D.sign(n.y);let s=a<0;Jg(e,s),Jg(t,s),Jg(n,s)}var Xre=new h;function jf(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Xre),e.y/(e.y-t.y),Xre),n),h.clone(n,i),Jg(n,!0),Jg(i,!1)}var Ny=new h,Fy=new h,ky=new h,zy=new h,CW={positions:new Array(7),indices:new Array(9)};function pFe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;mFe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,a=0;a+=i?1:0,a+=o?1:0,a+=r?1:0;let s=CW.indices;a===1?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(jf(e,t,Ny,ky),jf(e,n,Fy,zy),s[0]=0,s[3]=1,s[4]=2,s[6]=1):o?(jf(t,n,Ny,ky),jf(t,e,Fy,zy),s[0]=1,s[3]=2,s[4]=0,s[6]=2):r&&(jf(n,e,Ny,ky),jf(n,t,Fy,zy),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):a===2&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?o?r||(jf(n,e,Ny,ky),jf(n,t,Fy,zy),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(jf(t,n,Ny,ky),jf(t,e,Fy,zy),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(jf(e,t,Ny,ky),jf(e,n,Fy,zy),s[0]=1,s[1]=2,s[3]=1,s[6]=0));let c=CW.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(a===1||a===2)&&(c[3]=Ny,c[4]=Fy,c[5]=ky,c[6]=zy,c.length=7),CW}function Kre(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=Y.createTypedArray(r.componentDatatype,r.values)}let i=At.computeNumberOfVertices(e);return e.indices=Ue.createTypedArray(i,e.indices),t&&(e.boundingSphere=ce.fromVertices(n.position.values)),e}function YT(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 Me({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new At({attributes:n,indices:[],primitiveType:e.primitiveType})}function wW(e,t,n){let i=l(e.geometry.boundingSphere);t=Kre(t,i),n=Kre(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 IW(e,t){let n=new e,i=new e,o=new e;return function(r,a,s,c,u,f,d,p){let g=e.fromArray(u,r*t,n),m=e.fromArray(u,a*t,i),A=e.fromArray(u,s*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(A,c.z,A);let y=e.add(g,m,g);e.add(y,A,y),p&&e.normalize(y,y),e.pack(y,f,d*t)}}var gFe=IW(se,4),NM=IW(h,3),tae=IW(z,2),_Fe=function(e,t,n,i,o,r,a){let s=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[a]=s+c+u>D.EPSILON6?1:0},jw=new h,EW=new h,vW=new h,AFe=new h;function BM(e,t,n,i,o,r,a,s,c,u,f,d,p,g,m,A){if(!l(r)&&!l(a)&&!l(s)&&!l(c)&&!l(u)&&g===0)return;let y=h.fromArray(o,e*3,jw),x=h.fromArray(o,t*3,EW),b=h.fromArray(o,n*3,vW),T=jT(i,y,x,b,AFe);if(l(T)){if(l(r)&&NM(e,t,n,T,r,d.normal.values,A,!0),l(u)){let E=h.fromArray(u,e*3,jw),S=h.fromArray(u,t*3,EW),w=h.fromArray(u,n*3,vW);h.multiplyByScalar(E,T.x,E),h.multiplyByScalar(S,T.y,S),h.multiplyByScalar(w,T.z,w);let P;!h.equals(E,h.ZERO)||!h.equals(S,h.ZERO)||!h.equals(w,h.ZERO)?(P=h.add(E,S,E),h.add(P,w,P),h.normalize(P,P)):(P=jw,P.x=0,P.y=0,P.z=0),h.pack(P,d.extrudeDirection.values,A*3)}if(l(f)&&_Fe(e,t,n,T,f,d.applyOffset.values,A),l(a)&&NM(e,t,n,T,a,d.tangent.values,A,!0),l(s)&&NM(e,t,n,T,s,d.bitangent.values,A,!0),l(c)&&tae(e,t,n,T,c,d.st.values,A),g>0)for(let E=0;E<g;E++){let S=p[E];yFe(e,t,n,T,A,m[S],d[S])}}}function yFe(e,t,n,i,o,r,a){let s=r.componentsPerAttribute,c=r.values,u=a.values;switch(s){case 4:gFe(e,t,n,i,c,u,o,!1);break;case 3:NM(e,t,n,i,c,u,o,!1);break;case 2:tae(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Cm(e,t,n,i,o,r){let a=e.position.values.length/3;if(o!==-1){let s=i[o],c=n[s];return c===-1?(n[s]=a,e.position.values.push(r.x,r.y,r.z),t.push(a),a):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(a),a}var xFe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Qre(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,a=l(n.tangent)?n.tangent.values:void 0,s=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let P in n)n.hasOwnProperty(P)&&!xFe[P]&&l(n[P])&&d.push(P);let p=d.length,g=YT(t),m=YT(t),A,y,x,b,T,E=[];E.length=i.length/3;let S=[];for(S.length=i.length/3,T=0;T<E.length;++T)E[T]=-1,S[T]=-1;let w=f.length;for(T=0;T<w;T+=3){let P=f[T],O=f[T+1],B=f[T+2],L=h.fromArray(i,P*3),_=h.fromArray(i,O*3),C=h.fromArray(i,B*3),v=pFe(L,_,C);if(l(v)&&v.positions.length>3){let I=v.positions,M=v.indices,N=M.length;for(let j=0;j<N;++j){let k=M[j],V=I[k];V.y<0?(A=m.attributes,y=m.indices,x=E):(A=g.attributes,y=g.indices,x=S),b=Cm(A,y,x,f,k<3?T+k:-1,V),BM(P,O,B,V,i,o,a,r,s,c,u,A,d,p,n,b)}}else l(v)&&(L=v.positions[0],_=v.positions[1],C=v.positions[2]),L.y<0?(A=m.attributes,y=m.indices,x=E):(A=g.attributes,y=g.indices,x=S),b=Cm(A,y,x,f,T,L),BM(P,O,B,L,i,o,a,r,s,c,u,A,d,p,n,b),b=Cm(A,y,x,f,T+1,_),BM(P,O,B,_,i,o,a,r,s,c,u,A,d,p,n,b),b=Cm(A,y,x,f,T+2,C),BM(P,O,B,C,i,o,a,r,s,c,u,A,d,p,n,b)}wW(e,m,g)}var nae=tn.fromPointNormal(h.ZERO,h.UNIT_Y),bFe=new h,TFe=new h;function qT(e,t,n,i,o,r,a){if(!l(a))return;let s=h.fromArray(i,e*3,jw);h.equalsEpsilon(s,n,D.EPSILON10)?r.applyOffset.values[o]=a[e]:r.applyOffset.values[o]=a[t]}function $re(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,a=YT(t),s=YT(t),c,u=r.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=r[c],g=r[c+1],m=h.fromArray(i,p*3,jw),A=h.fromArray(i,g*3,EW),y;Math.abs(m.y)<D.EPSILON6&&(m.y<0?m.y=-D.EPSILON6:m.y=D.EPSILON6),Math.abs(A.y)<D.EPSILON6&&(A.y<0?A.y=-D.EPSILON6:A.y=D.EPSILON6);let x=a.attributes,b=a.indices,T=d,E=s.attributes,S=s.indices,w=f,P=ui.lineSegmentPlane(m,A,nae,vW);if(l(P)){let O=h.multiplyByScalar(h.UNIT_Y,5*D.EPSILON9,bFe);m.y<0&&(h.negate(O,O),x=s.attributes,b=s.indices,T=f,E=a.attributes,S=a.indices,w=d);let B=h.add(P,O,TFe);y=Cm(x,b,T,r,c,m),qT(p,g,m,i,y,x,o),y=Cm(x,b,T,r,-1,B),qT(p,g,B,i,y,x,o),h.negate(O,O),h.add(P,O,B),y=Cm(E,S,w,r,-1,B),qT(p,g,B,i,y,E,o),y=Cm(E,S,w,r,c+1,A),qT(p,g,A,i,y,E,o)}else{let O,B,L;m.y<0?(O=s.attributes,B=s.indices,L=f):(O=a.attributes,B=a.indices,L=d),y=Cm(O,B,L,r,c,m),qT(p,g,m,i,y,O,o),y=Cm(O,B,L,r,c+1,A),qT(p,g,A,i,y,O,o)}}wW(e,s,a)}var Jre=new z,CFe=new z,iae=new h,oae=new h,SW=new h,EFe=new h,vFe=new h,SFe=new h,Zre=new se;function eae(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let a=0;a<r;a+=3){let s=h.unpack(n,a,iae);if(s.x>0)continue;let c=h.unpack(i,a,oae);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(a-3>0?(i[a]=n[a-3],i[a+1]=n[a-2],i[a+2]=n[a-1]):h.pack(s,i,a));let u=h.unpack(o,a,SW);(s.y<0&&u.y>0||s.y>0&&u.y<0)&&(a+3<r?(o[a]=n[a+3],o[a+1]=n[a+4],o[a+2]=n[a+5]):h.pack(s,o,a))}}var wFe=5*D.EPSILON9,LM=D.EPSILON6;function IFe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,a=n.expandAndWidth.values,s=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=YT(t),f=YT(t),d,p,g,m=!1,A=i.length/3;for(d=0;d<A;d+=4){let y=d,x=d+2,b=h.fromArray(i,y*3,iae),T=h.fromArray(i,x*3,oae);if(Math.abs(b.y)<LM)for(b.y=LM*(T.y<0?-1:1),i[d*3+1]=b.y,i[(d+1)*3+1]=b.y,p=y*3;p<y*3+12;p+=3)o[p]=i[d*3],o[p+1]=i[d*3+1],o[p+2]=i[d*3+2];if(Math.abs(T.y)<LM)for(T.y=LM*(b.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=y*3;p<y*3+12;p+=3)r[p]=i[(d+2)*3],r[p+1]=i[(d+2)*3+1],r[p+2]=i[(d+2)*3+2];let E=u.attributes,S=u.indices,w=f.attributes,P=f.indices,O=ui.lineSegmentPlane(b,T,nae,EFe);if(l(O)){m=!0;let B=h.multiplyByScalar(h.UNIT_Y,wFe,vFe);b.y<0&&(h.negate(B,B),E=f.attributes,S=f.indices,w=u.attributes,P=u.indices);let L=h.add(O,B,SFe);E.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),E.position.values.push(L.x,L.y,L.z),E.position.values.push(L.x,L.y,L.z),E.prevPosition.values.push(o[y*3],o[y*3+1],o[y*3+2]),E.prevPosition.values.push(o[y*3+3],o[y*3+4],o[y*3+5]),E.prevPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),h.negate(B,B),h.add(O,B,L),w.position.values.push(L.x,L.y,L.z),w.position.values.push(L.x,L.y,L.z),w.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),w.nextPosition.values.push(r[x*3],r[x*3+1],r[x*3+2]),w.nextPosition.values.push(r[x*3+3],r[x*3+4],r[x*3+5]);let _=z.fromArray(a,y*2,Jre),C=Math.abs(_.y);E.expandAndWidth.values.push(-1,C,1,C),E.expandAndWidth.values.push(-1,-C,1,-C),w.expandAndWidth.values.push(-1,C,1,C),w.expandAndWidth.values.push(-1,-C,1,-C);let v=h.magnitudeSquared(h.subtract(O,b,SW));if(v/=h.magnitudeSquared(h.subtract(T,b,SW)),l(c)){let I=se.fromArray(c,y*4,Zre),M=se.fromArray(c,x*4,Zre),N=D.lerp(I.x,M.x,v),j=D.lerp(I.y,M.y,v),k=D.lerp(I.z,M.z,v),V=D.lerp(I.w,M.w,v);for(p=y*4;p<y*4+8;++p)E.color.values.push(c[p]);for(E.color.values.push(N,j,k,V),E.color.values.push(N,j,k,V),w.color.values.push(N,j,k,V),w.color.values.push(N,j,k,V),p=x*4;p<x*4+8;++p)w.color.values.push(c[p])}if(l(s)){let I=z.fromArray(s,y*2,Jre),M=z.fromArray(s,(d+3)*2,CFe),N=D.lerp(I.x,M.x,v);for(p=y*2;p<y*2+4;++p)E.st.values.push(s[p]);for(E.st.values.push(N,I.y),E.st.values.push(N,M.y),w.st.values.push(N,I.y),w.st.values.push(N,M.y),p=x*2;p<x*2+4;++p)w.st.values.push(s[p])}g=E.position.values.length/3-4,S.push(g,g+2,g+1),S.push(g+1,g+2,g+3),g=w.position.values.length/3-4,P.push(g,g+2,g+1),P.push(g+1,g+2,g+3)}else{let B,L;for(b.y<0?(B=f.attributes,L=f.indices):(B=u.attributes,L=u.indices),B.position.values.push(b.x,b.y,b.z),B.position.values.push(b.x,b.y,b.z),B.position.values.push(T.x,T.y,T.z),B.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+12;++p)B.prevPosition.values.push(o[p]),B.nextPosition.values.push(r[p]);for(p=d*2;p<d*2+8;++p)B.expandAndWidth.values.push(a[p]),l(s)&&B.st.values.push(s[p]);if(l(c))for(p=d*4;p<d*4+16;++p)B.color.values.push(c[p]);g=B.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}m&&(eae(f),eae(u)),wW(e,f,u)}gl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ce.intersectPlane(n,tn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING))return e;if(t.geometryType!==th.NONE)switch(t.geometryType){case th.POLYLINES:IFe(e);break;case th.TRIANGLES:Qre(e);break;case th.LINES:$re(e);break}else hFe(t),t.primitiveType===Re.TRIANGLES?Qre(e):t.primitiveType===Re.LINES&&$re(e);return e};var kn=gl;function Gw(e,t,n,i,o,r,a,s,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=a,this._internalFormat=o,this._pixelFormat=r,this._size=s,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(Gw.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});Gw.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:a}=i,s=this._context._gl,c=this._textureTarget,u=this._targetFace;s.activeTexture(s.TEXTURE0),s.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,A=this._preMultiplyAlpha,y=this._flipY,x=4;l(f)&&(x=Xe.alignmentInBytes(p,m,r)),s.pixelStorei(s.UNPACK_ALIGNMENT,x),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let b=!1;if(!this._initialized){let T;t===0&&n===0&&r===d&&a===d?(l(f)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),y&&(f=Xe.flipY(f,p,m,d,d)),T=f):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y),T=i),b=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),T=Xe.createTypedArray(p,m,d,d)),s.texImage2D(u,0,g,d,d,0,p,je.toWebGLConstant(m,this._context),T),this._initialized=!0}b||(l(f)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),y&&(f=Xe.flipY(f,p,m,r,a)),s.texSubImage2D(u,0,t,n,r,a,p,je.toWebGLConstant(m,this._context),f)):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y),s.texSubImage2D(u,0,t,n,p,je.toWebGLConstant(m,this._context),i))),s.bindTexture(c,null)};Gw.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size;let a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),a.bindTexture(s,null),this._initialized=!0};Gw.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0;let r=this._context._gl,a=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(a,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(a,null),this._initialized=!0};var kM=Gw;var Hw={DONT_CARE:ee.DONT_CARE,FASTEST:ee.FASTEST,NICEST:ee.NICEST,validate:function(e){return e===Hw.DONT_CARE||e===Hw.FASTEST||e===Hw.NICEST}};Object.freeze(Hw);var rh=Hw;var Ww={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR};Ww.validate=function(e){return e===Ww.NEAREST||e===Ww.LINEAR};Object.freeze(Ww);var ti=Ww;var d0={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR,NEAREST_MIPMAP_NEAREST:ee.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ee.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ee.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ee.LINEAR_MIPMAP_LINEAR};d0.validate=function(e){return e===d0.NEAREST||e===d0.LINEAR||e===d0.NEAREST_MIPMAP_NEAREST||e===d0.LINEAR_MIPMAP_NEAREST||e===d0.NEAREST_MIPMAP_LINEAR||e===d0.LINEAR_MIPMAP_LINEAR};Object.freeze(d0);var Vt=d0;var qw={CLAMP_TO_EDGE:ee.CLAMP_TO_EDGE,REPEAT:ee.REPEAT,MIRRORED_REPEAT:ee.MIRRORED_REPEAT,validate:function(e){return e===qw.CLAMP_TO_EDGE||e===qw.REPEAT||e===qw.MIRRORED_REPEAT}};Object.freeze(qw);var un=qw;function Yw(e){e=e??G.EMPTY_OBJECT;let{wrapR:t=un.CLAMP_TO_EDGE,wrapS:n=un.CLAMP_TO_EDGE,wrapT:i=un.CLAMP_TO_EDGE,minificationFilter:o=Vt.LINEAR,magnificationFilter:r=ti.LINEAR,maximumAnisotropy:a=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=o,this._magnificationFilter=r,this._maximumAnisotropy=a}Object.defineProperties(Yw.prototype,{wrapR:{get:function(){return this._wrapR}},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}}});Yw.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};Yw.NEAREST=Object.freeze(new Yw({wrapR:un.CLAMP_TO_EDGE,wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.NEAREST,magnificationFilter:ti.NEAREST}));var jt=Yw;function DFe(e,t){if(!e)throw new _e(t)}var rae=DFe;function PFe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),a=t.value?t.value.length:t.componentsPerAttribute,s={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:a,componentDatatype:t.componentDatatype??Y.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)s.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},s.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(s.componentsPerAttribute){case 1:s.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:s.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:s.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:s.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}s.disableVertexAttribArray=function(c){}}e.push(s)}function sae(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 ah(e){e=e??G.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,a=[],s=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)PFe(a,i[r],r,t);for(f=a.length,r=0;r<f;++r){let p=a[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Y.getSizeInBytes(p.componentDatatype);s=p.vertexBuffer.sizeInBytes/g;break}}for(r=0;r<f;++r)a[r].instanceDivisor>0&&(c=!0),l(a[r].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),sae(n,a,o),t.glBindVertexArray(null)),this._numberOfVertices=s,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=a,this._indexBuffer=o}function aae(e){return e.values.length/e.componentsPerAttribute}function RFe(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function OFe(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===Y.DOUBLE&&(e[n].componentDatatype=Y.FLOAT,e[n].values=Y.createTypedArray(Y.FLOAT,e[n].values)));let r,a=o.length;if(a>0)for(r=aae(e[o[0]]),t=1;t<a;++t){let u=aae(e[o[t]]);if(u!==r)throw new re(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return Y.getSizeInBytes(e[f].componentDatatype)-Y.getSizeInBytes(e[u].componentDatatype)});let s=0,c={};for(t=0;t<a;++t)n=o[t],i=e[n],c[n]=s,s+=RFe(i);if(s>0){let u=Y.getSizeInBytes(e[o[0]].componentDatatype),f=s%u;f!==0&&(s+=u-f);let d=r*s,p=new ArrayBuffer(d),g={};for(t=0;t<a;++t){n=o[t];let m=Y.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Y.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:s/m}}for(t=0;t<r;++t)for(let m=0;m<a;++m){n=o[m],i=e[n];let A=i.values,y=g[n],x=y.pointer,b=i.componentsPerAttribute;for(let T=0;T<b;++T)x[y.index+T]=A[t*b+T];y.index+=y.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:s}}}ah.fromGeometry=function(e){e=e??G.EMPTY_OBJECT;let t=e.context,n=e.geometry??G.EMPTY_OBJECT,i=e.bufferUsage??Oe.DYNAMIC_DRAW,o=e.attributeLocations??G.EMPTY_OBJECT,r=e.interleave??!1,a=e.vertexArrayAttributes,s,c,u,f=l(a)?a:[],d=n.attributes;if(r){let m=OFe(d);if(l(m)){u=Ke.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let A=m.offsetsInBytes,y=m.vertexSizeInBytes;for(s in d)d.hasOwnProperty(s)&&l(d[s])&&(c=d[s],l(c.values)?f.push({index:o[s],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:A[s],strideInBytes:y}):f.push({index:o[s],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(s in d)if(d.hasOwnProperty(s)&&l(d[s])){c=d[s];let m=c.componentDatatype;m===Y.DOUBLE&&(m=Y.FLOAT);let A={};u=void 0,l(c.values)&&(u=Ke.createVertexBuffer({context:t,typedArray:Y.createTypedArray(m,c.values),usage:i}),A={index:o[s],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=Ke.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),A={index:o[s],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:Ft.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(A)}let p,g=n.indices;return l(g)&&(At.computeNumberOfVertices(n)>=D.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=Ke.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ue.UNSIGNED_INT}):p=Ke.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ue.UNSIGNED_SHORT})),new ah({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(ah.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});ah.prototype.getAttribute=function(e){return this._attributes[e]};function MFe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Mt.maximumVertexAttributes,a;if(n){let s=o.length;for(a=0;a<s;++a){let c=o[a];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(a=0;a<r;++a)i[a]>0&&(t.glVertexAttribDivisor(a,0),i[a]=0)}function BFe(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)}}ah.prototype.copyAttributeFromRange=function(e,t,n,i){let o=this.getAttribute(e),r=o.vertexBuffer,a=o.componentsPerAttribute,s=t.constructor,c=n*a*s.BYTES_PER_ELEMENT,u=new s(t.buffer,t.byteOffset+c,i*a);r.copyFromArrayView(u,c)};ah.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,o=e.constructor,r=t*o.BYTES_PER_ELEMENT,a=new o(e.buffer,e.byteOffset+r,n);i.copyFromArrayView(a,r)};ah.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&MFe(this),this._hasConstantAttributes&&BFe(this,this._gl)):sae(this._gl,this._attributes,this._indexBuffer)};ah.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)}};ah.prototype.isDestroyed=function(){return!1};ah.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),fe(this)};var Fn=ah;function dr(e){e=e??G.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Xe.RGBA,pixelDatatype:o=je.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:a=!1,sampler:s=new jt}=e,c=e.preMultiplyAlpha||i===Xe.RGB||i===Xe.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=Xe.textureSizeInBytes(i,o,d,d)*6,g=Xe.toInternalFormat(i,o,t),m=t._gl,A=m.TEXTURE_CUBE_MAP,y=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=A,this._texture=y,this._pixelFormat=i,this._pixelDatatype=o,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let x=l(n);function b(T){return new kM(t,y,A,T,g,i,o,d,c,r,x)}this._positiveX=b(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=b(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=b(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=b(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=b(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=b(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=s,cae(this,s),m.activeTexture(m.TEXTURE0),m.bindTexture(A,y),a?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let T of dr.faceNames())DW(this[T],n?.[T],0);m.bindTexture(A,null)}dr.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new pa({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};dr.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*LFe(){yield dr.FaceName.POSITIVEX,yield dr.FaceName.NEGATIVEX,yield dr.FaceName.POSITIVEY,yield dr.FaceName.NEGATIVEY,yield dr.FaceName.POSITIVEZ,yield dr.FaceName.NEGATIVEZ}dr.faceNames=function(){return LFe()};function DW(e,t,n){n=n??0;let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,a=e._pixelDatatype,s=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,s,o,o,0,r,je.toWebGLConstant(a,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=Xe.alignmentInBytes(r,a,o)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=Xe.flipY(p,r,a,o,o)),d.texImage2D(i,n,s,o,o,0,r,je.toWebGLConstant(a,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,s,r,je.toWebGLConstant(a,f),t))}dr.loadFace=DW;Object.defineProperties(dr.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){cae(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}}});dr.getDirection=function(e,t){switch(e){case dr.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case dr.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case dr.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case dr.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case dr.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case dr.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function cae(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Vt.NEAREST_MIPMAP_NEAREST,Vt.NEAREST_MIPMAP_LINEAR,Vt.LINEAR_MIPMAP_NEAREST,Vt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,a=e._pixelDatatype;(a===je.FLOAT&&!r.textureFloatLinear||a===je.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Vt.NEAREST_MIPMAP_NEAREST:Vt.NEAREST,i=ti.NEAREST);let s=r._gl,c=e._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(c,e._texture),s.texParameteri(c,s.TEXTURE_MIN_FILTER,n),s.texParameteri(c,s.TEXTURE_MAG_FILTER,i),s.texParameteri(c,s.TEXTURE_WRAP_S,t.wrapS),s.texParameteri(c,s.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&s.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),s.bindTexture(c,null)}dr.prototype.loadMipmaps=function(e,t){t=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 a=e[r],s=r+1;for(let c of dr.faceNames())DW(this[c],a[c],s)}n.bindTexture(o,null),this._hasMipmap=!0};dr.prototype.generateMipmap=function(e){e=e??rh.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)};dr.createVertexArray=function(e){let t=Uc.createGeometry(Uc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Ne.POSITION_ONLY})),n=this._attributeLocations=kn.createAttributeLocations(t);return Fn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Oe.STATIC_DRAW})};dr.prototype.isDestroyed=function(){return!1};dr.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=fe(this._positiveX),this._negativeX=fe(this._negativeX),this._positiveY=fe(this._positiveY),this._negativeY=fe(this._negativeY),this._positiveZ=fe(this._positiveZ),this._negativeZ=fe(this._negativeZ),fe(this)};var oa=dr;function NFe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var _l=NFe;var PW=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},zM=PW;var UM=`/**
  95. * A built-in GLSL floating-point constant for converting radians to degrees.
  96. *
  97. * @alias czm_degreesPerRadian
  98. * @glslConstant
  99. *
  100. * @see CesiumMath.DEGREES_PER_RADIAN
  101. *
  102. * @example
  103. * // GLSL declaration
  104. * const float czm_degreesPerRadian = ...;
  105. *
  106. * // Example
  107. * float deg = czm_degreesPerRadian * rad;
  108. */
  109. const float czm_degreesPerRadian = 57.29577951308232;
  110. `;var VM=`/**
  111. * A built-in GLSL vec2 constant for defining the depth range.
  112. * This is a workaround to a bug where IE11 does not implement gl_DepthRange.
  113. *
  114. * @alias czm_depthRange
  115. * @glslConstant
  116. *
  117. * @example
  118. * // GLSL declaration
  119. * float depthRangeNear = czm_depthRange.near;
  120. * float depthRangeFar = czm_depthRange.far;
  121. *
  122. */
  123. const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
  124. `;var jM=`/**
  125. * 0.1
  126. *
  127. * @name czm_epsilon1
  128. * @glslConstant
  129. */
  130. const float czm_epsilon1 = 0.1;
  131. `;var GM=`/**
  132. * 0.01
  133. *
  134. * @name czm_epsilon2
  135. * @glslConstant
  136. */
  137. const float czm_epsilon2 = 0.01;
  138. `;var HM=`/**
  139. * 0.001
  140. *
  141. * @name czm_epsilon3
  142. * @glslConstant
  143. */
  144. const float czm_epsilon3 = 0.001;
  145. `;var WM=`/**
  146. * 0.0001
  147. *
  148. * @name czm_epsilon4
  149. * @glslConstant
  150. */
  151. const float czm_epsilon4 = 0.0001;
  152. `;var qM=`/**
  153. * 0.00001
  154. *
  155. * @name czm_epsilon5
  156. * @glslConstant
  157. */
  158. const float czm_epsilon5 = 0.00001;
  159. `;var YM=`/**
  160. * 0.000001
  161. *
  162. * @name czm_epsilon6
  163. * @glslConstant
  164. */
  165. const float czm_epsilon6 = 0.000001;
  166. `;var XM=`/**
  167. * 0.0000001
  168. *
  169. * @name czm_epsilon7
  170. * @glslConstant
  171. */
  172. const float czm_epsilon7 = 0.0000001;
  173. `;var KM=`/**
  174. * DOC_TBA
  175. *
  176. * @name czm_infinity
  177. * @glslConstant
  178. */
  179. const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp?
  180. `;var QM=`/**
  181. * A built-in GLSL floating-point constant for <code>1/pi</code>.
  182. *
  183. * @alias czm_oneOverPi
  184. * @glslConstant
  185. *
  186. * @see CesiumMath.ONE_OVER_PI
  187. *
  188. * @example
  189. * // GLSL declaration
  190. * const float czm_oneOverPi = ...;
  191. *
  192. * // Example
  193. * float pi = 1.0 / czm_oneOverPi;
  194. */
  195. const float czm_oneOverPi = 0.3183098861837907;
  196. `;var $M=`/**
  197. * A built-in GLSL floating-point constant for <code>1/2pi</code>.
  198. *
  199. * @alias czm_oneOverTwoPi
  200. * @glslConstant
  201. *
  202. * @see CesiumMath.ONE_OVER_TWO_PI
  203. *
  204. * @example
  205. * // GLSL declaration
  206. * const float czm_oneOverTwoPi = ...;
  207. *
  208. * // Example
  209. * float pi = 2.0 * czm_oneOverTwoPi;
  210. */
  211. const float czm_oneOverTwoPi = 0.15915494309189535;
  212. `;var JM=`/**
  213. * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
  214. *
  215. * @name czm_passCesium3DTile
  216. * @glslConstant
  217. *
  218. * @see czm_pass
  219. */
  220. const float czm_passCesium3DTile = 5.0;
  221. `;var ZM=`/**
  222. * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
  223. *
  224. * @name czm_passCesium3DTileClassification
  225. * @glslConstant
  226. *
  227. * @see czm_pass
  228. */
  229. const float czm_passCesium3DTileClassification = 6.0;
  230. `;var eB=`/**
  231. * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
  232. *
  233. * @name czm_passCesium3DTileClassificationIgnoreShow
  234. * @glslConstant
  235. *
  236. * @see czm_pass
  237. */
  238. const float czm_passCesium3DTileClassificationIgnoreShow = 7.0;
  239. `;var tB=`/**
  240. * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_EDGES}
  241. *
  242. * @name czm_passCesium3DTileEdges
  243. * @glslConstant
  244. *
  245. * @see czm_pass
  246. */
  247. const float czm_passCesium3DTileEdges = 4.0;
  248. `;var nB=`/**
  249. * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_EDGES_DIRECT}
  250. *
  251. * @name czm_passCesium3DTileEdgesDirect
  252. * @glslConstant
  253. *
  254. * @see czm_pass
  255. */
  256. const float czm_passCesium3DTileEdgesDirect = 12.0;
  257. `;var iB=`/**
  258. * The automatic GLSL constant for {@link Pass#CLASSIFICATION}
  259. *
  260. * @name czm_passClassification
  261. * @glslConstant
  262. *
  263. * @see czm_pass
  264. */
  265. const float czm_passClassification = 7.0;
  266. `;var oB=`/**
  267. * The automatic GLSL constant for {@link Pass#COMPUTE}
  268. *
  269. * @name czm_passCompute
  270. * @glslConstant
  271. *
  272. * @see czm_pass
  273. */
  274. const float czm_passCompute = 1.0;
  275. `;var rB=`/**
  276. * The automatic GLSL constant for {@link Pass#ENVIRONMENT}
  277. *
  278. * @name czm_passEnvironment
  279. * @glslConstant
  280. *
  281. * @see czm_pass
  282. */
  283. const float czm_passEnvironment = 0.0;
  284. `;var aB=`/**
  285. * The automatic GLSL constant for {@link Pass#GAUSSIAN_SPLATS}
  286. *
  287. * @name czm_passGaussianSplats
  288. * @glslConstant
  289. *
  290. * @see czm_pass
  291. */
  292. const float czm_passGaussianSplats = 11.0;
  293. `;var sB=`/**
  294. * The automatic GLSL constant for {@link Pass#GLOBE}
  295. *
  296. * @name czm_passGlobe
  297. * @glslConstant
  298. *
  299. * @see czm_pass
  300. */
  301. const float czm_passGlobe = 2.0;
  302. `;var cB=`/**
  303. * The automatic GLSL constant for {@link Pass#OPAQUE}
  304. *
  305. * @name czm_passOpaque
  306. * @glslConstant
  307. *
  308. * @see czm_pass
  309. */
  310. const float czm_passOpaque = 8.0;
  311. `;var lB=`/**
  312. * The automatic GLSL constant for {@link Pass#OVERLAY}
  313. *
  314. * @name czm_passOverlay
  315. * @glslConstant
  316. *
  317. * @see czm_pass
  318. */
  319. const float czm_passOverlay = 13.0;
  320. `;var uB=`/**
  321. * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
  322. *
  323. * @name czm_passTerrainClassification
  324. * @glslConstant
  325. *
  326. * @see czm_pass
  327. */
  328. const float czm_passTerrainClassification = 3.0;
  329. `;var fB=`/**
  330. * The automatic GLSL constant for {@link Pass#TRANSLUCENT}
  331. *
  332. * @name czm_passTranslucent
  333. * @glslConstant
  334. *
  335. * @see czm_pass
  336. */
  337. const float czm_passTranslucent = 9.0;
  338. `;var dB=`/**
  339. * The automatic GLSL constant for {@link Pass#VOXELS}
  340. *
  341. * @name czm_passVoxels
  342. * @glslConstant
  343. *
  344. * @see czm_pass
  345. */
  346. const float czm_passVoxels = 10.0;
  347. `;var hB=`/**
  348. * A built-in GLSL floating-point constant for <code>Math.PI</code>.
  349. *
  350. * @alias czm_pi
  351. * @glslConstant
  352. *
  353. * @see CesiumMath.PI
  354. *
  355. * @example
  356. * // GLSL declaration
  357. * const float czm_pi = ...;
  358. *
  359. * // Example
  360. * float twoPi = 2.0 * czm_pi;
  361. */
  362. const float czm_pi = 3.141592653589793;
  363. `;var mB=`/**
  364. * A built-in GLSL floating-point constant for <code>pi/4</code>.
  365. *
  366. * @alias czm_piOverFour
  367. * @glslConstant
  368. *
  369. * @see CesiumMath.PI_OVER_FOUR
  370. *
  371. * @example
  372. * // GLSL declaration
  373. * const float czm_piOverFour = ...;
  374. *
  375. * // Example
  376. * float pi = 4.0 * czm_piOverFour;
  377. */
  378. const float czm_piOverFour = 0.7853981633974483;
  379. `;var pB=`/**
  380. * A built-in GLSL floating-point constant for <code>pi/6</code>.
  381. *
  382. * @alias czm_piOverSix
  383. * @glslConstant
  384. *
  385. * @see CesiumMath.PI_OVER_SIX
  386. *
  387. * @example
  388. * // GLSL declaration
  389. * const float czm_piOverSix = ...;
  390. *
  391. * // Example
  392. * float pi = 6.0 * czm_piOverSix;
  393. */
  394. const float czm_piOverSix = 0.5235987755982988;
  395. `;var gB=`/**
  396. * A built-in GLSL floating-point constant for <code>pi/3</code>.
  397. *
  398. * @alias czm_piOverThree
  399. * @glslConstant
  400. *
  401. * @see CesiumMath.PI_OVER_THREE
  402. *
  403. * @example
  404. * // GLSL declaration
  405. * const float czm_piOverThree = ...;
  406. *
  407. * // Example
  408. * float pi = 3.0 * czm_piOverThree;
  409. */
  410. const float czm_piOverThree = 1.0471975511965976;
  411. `;var _B=`/**
  412. * A built-in GLSL floating-point constant for <code>pi/2</code>.
  413. *
  414. * @alias czm_piOverTwo
  415. * @glslConstant
  416. *
  417. * @see CesiumMath.PI_OVER_TWO
  418. *
  419. * @example
  420. * // GLSL declaration
  421. * const float czm_piOverTwo = ...;
  422. *
  423. * // Example
  424. * float pi = 2.0 * czm_piOverTwo;
  425. */
  426. const float czm_piOverTwo = 1.5707963267948966;
  427. `;var AB=`/**
  428. * A built-in GLSL floating-point constant for converting degrees to radians.
  429. *
  430. * @alias czm_radiansPerDegree
  431. * @glslConstant
  432. *
  433. * @see CesiumMath.RADIANS_PER_DEGREE
  434. *
  435. * @example
  436. * // GLSL declaration
  437. * const float czm_radiansPerDegree = ...;
  438. *
  439. * // Example
  440. * float rad = czm_radiansPerDegree * deg;
  441. */
  442. const float czm_radiansPerDegree = 0.017453292519943295;
  443. `;var yB=`/**
  444. * The constant identifier for the 2D {@link SceneMode}
  445. *
  446. * @name czm_sceneMode2D
  447. * @glslConstant
  448. * @see czm_sceneMode
  449. * @see czm_sceneModeColumbusView
  450. * @see czm_sceneMode3D
  451. * @see czm_sceneModeMorphing
  452. */
  453. const float czm_sceneMode2D = 2.0;
  454. `;var xB=`/**
  455. * The constant identifier for the 3D {@link SceneMode}
  456. *
  457. * @name czm_sceneMode3D
  458. * @glslConstant
  459. * @see czm_sceneMode
  460. * @see czm_sceneMode2D
  461. * @see czm_sceneModeColumbusView
  462. * @see czm_sceneModeMorphing
  463. */
  464. const float czm_sceneMode3D = 3.0;
  465. `;var bB=`/**
  466. * The constant identifier for the Columbus View {@link SceneMode}
  467. *
  468. * @name czm_sceneModeColumbusView
  469. * @glslConstant
  470. * @see czm_sceneMode
  471. * @see czm_sceneMode2D
  472. * @see czm_sceneMode3D
  473. * @see czm_sceneModeMorphing
  474. */
  475. const float czm_sceneModeColumbusView = 1.0;
  476. `;var TB=`/**
  477. * The constant identifier for the Morphing {@link SceneMode}
  478. *
  479. * @name czm_sceneModeMorphing
  480. * @glslConstant
  481. * @see czm_sceneMode
  482. * @see czm_sceneMode2D
  483. * @see czm_sceneModeColumbusView
  484. * @see czm_sceneMode3D
  485. */
  486. const float czm_sceneModeMorphing = 0.0;
  487. `;var CB=`/**
  488. * A built-in GLSL floating-point constant for one solar radius.
  489. *
  490. * @alias czm_solarRadius
  491. * @glslConstant
  492. *
  493. * @see CesiumMath.SOLAR_RADIUS
  494. *
  495. * @example
  496. * // GLSL declaration
  497. * const float czm_solarRadius = ...;
  498. */
  499. const float czm_solarRadius = 695500000.0;
  500. `;var EB=`/**
  501. * A built-in GLSL floating-point constant for <code>3pi/2</code>.
  502. *
  503. * @alias czm_threePiOver2
  504. * @glslConstant
  505. *
  506. * @see CesiumMath.THREE_PI_OVER_TWO
  507. *
  508. * @example
  509. * // GLSL declaration
  510. * const float czm_threePiOver2 = ...;
  511. *
  512. * // Example
  513. * float pi = (2.0 / 3.0) * czm_threePiOver2;
  514. */
  515. const float czm_threePiOver2 = 4.71238898038469;
  516. `;var vB=`/**
  517. * A built-in GLSL floating-point constant for <code>2pi</code>.
  518. *
  519. * @alias czm_twoPi
  520. * @glslConstant
  521. *
  522. * @see CesiumMath.TWO_PI
  523. *
  524. * @example
  525. * // GLSL declaration
  526. * const float czm_twoPi = ...;
  527. *
  528. * // Example
  529. * float pi = czm_twoPi / 2.0;
  530. */
  531. const float czm_twoPi = 6.283185307179586;
  532. `;var SB=`/**
  533. * The maximum latitude, in radians, both North and South, supported by a Web Mercator
  534. * (EPSG:3857) projection. Technically, the Mercator projection is defined
  535. * for any latitude up to (but not including) 90 degrees, but it makes sense
  536. * to cut it off sooner because it grows exponentially with increasing latitude.
  537. * The logic behind this particular cutoff value, which is the one used by
  538. * Google Maps, Bing Maps, and Esri, is that it makes the projection
  539. * square. That is, the rectangle is equal in the X and Y directions.
  540. *
  541. * The constant value is computed as follows:
  542. * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))
  543. *
  544. * @name czm_webMercatorMaxLatitude
  545. * @glslConstant
  546. */
  547. const float czm_webMercatorMaxLatitude = 1.4844222297453324;
  548. `;var wB=`/**
  549. * @name czm_depthRangeStruct
  550. * @glslStruct
  551. */
  552. struct czm_depthRangeStruct
  553. {
  554. float near;
  555. float far;
  556. };
  557. `;var IB=`/**
  558. * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.
  559. *
  560. * @name czm_material
  561. * @glslStruct
  562. *
  563. * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
  564. * @property {float} specular Intensity of incoming light reflecting in a single direction.
  565. * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
  566. * @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.
  567. * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
  568. * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
  569. */
  570. struct czm_material
  571. {
  572. vec3 diffuse;
  573. float specular;
  574. float shininess;
  575. vec3 normal;
  576. vec3 emission;
  577. float alpha;
  578. };
  579. `;var DB=`/**
  580. * Used as input to every material's czm_getMaterial function.
  581. *
  582. * @name czm_materialInput
  583. * @glslStruct
  584. *
  585. * @property {float} s 1D texture coordinates.
  586. * @property {vec2} st 2D texture coordinates.
  587. * @property {vec3} str 3D texture coordinates.
  588. * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.
  589. * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.
  590. * @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.
  591. * @property {float} height The height of the terrain in meters above or below the ellipsoid. Only available for globe materials.
  592. * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials.
  593. * @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.
  594. * @property {float} waterMask The value of the water mask. 0 is land, 1 is water. Only available for globe materials.
  595. */
  596. struct czm_materialInput
  597. {
  598. float s;
  599. vec2 st;
  600. vec3 str;
  601. vec3 normalEC;
  602. mat3 tangentToEyeMatrix;
  603. vec3 positionToEyeEC;
  604. float height;
  605. float slope;
  606. float aspect;
  607. float waterMask;
  608. };
  609. `;var PB=`/**
  610. * Struct for representing a material for a {@link Model}. The model
  611. * rendering pipeline will pass this struct between material, custom shaders,
  612. * and lighting stages. This is not to be confused with {@link czm_material}
  613. * which is used by the older Fabric materials system, although they are similar.
  614. * <p>
  615. * All color values (diffuse, specular, emissive) are in linear color space.
  616. * </p>
  617. *
  618. * @name czm_modelMaterial
  619. * @glslStruct
  620. *
  621. * @property {vec4} baseColor The base color of the material.
  622. * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
  623. * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
  624. * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.
  625. * @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.
  626. * @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.
  627. * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.
  628. * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
  629. */
  630. struct czm_modelMaterial {
  631. vec4 baseColor;
  632. vec3 diffuse;
  633. float alpha;
  634. vec3 specular;
  635. float roughness;
  636. vec3 normalEC;
  637. float occlusion;
  638. vec3 emissive;
  639. #ifdef USE_SPECULAR
  640. float specularWeight;
  641. #endif
  642. #ifdef USE_ANISOTROPY
  643. vec3 anisotropicT;
  644. vec3 anisotropicB;
  645. float anisotropyStrength;
  646. #endif
  647. #ifdef USE_CLEARCOAT
  648. float clearcoatFactor;
  649. float clearcoatRoughness;
  650. vec3 clearcoatNormal;
  651. // Add clearcoatF0 when KHR_materials_ior is implemented
  652. #endif
  653. };
  654. `;var RB=`/**
  655. * Struct for representing the output of a custom vertex shader.
  656. *
  657. * @name czm_modelVertexOutput
  658. * @glslStruct
  659. *
  660. * @see {@link CustomShader}
  661. * @see {@link Model}
  662. *
  663. * @property {vec3} positionMC The position of the vertex in model coordinates
  664. * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives.
  665. */
  666. struct czm_modelVertexOutput {
  667. vec3 positionMC;
  668. float pointSize;
  669. };
  670. `;var OB=`/**
  671. * DOC_TBA
  672. *
  673. * @name czm_ray
  674. * @glslStruct
  675. */
  676. struct czm_ray
  677. {
  678. vec3 origin;
  679. vec3 direction;
  680. };
  681. `;var MB=`/**
  682. * DOC_TBA
  683. *
  684. * @name czm_raySegment
  685. * @glslStruct
  686. */
  687. struct czm_raySegment
  688. {
  689. float start;
  690. float stop;
  691. };
  692. /**
  693. * DOC_TBA
  694. *
  695. * @name czm_emptyRaySegment
  696. * @glslConstant
  697. */
  698. const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);
  699. /**
  700. * DOC_TBA
  701. *
  702. * @name czm_fullRaySegment
  703. * @glslConstant
  704. */
  705. const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
  706. `;var BB=`struct czm_shadowParameters
  707. {
  708. #ifdef USE_CUBE_MAP_SHADOW
  709. vec3 texCoords;
  710. #else
  711. vec2 texCoords;
  712. #endif
  713. float depthBias;
  714. float depth;
  715. float nDotL;
  716. vec2 texelStepSize;
  717. float normalShadingSmooth;
  718. float darkness;
  719. };
  720. `;var LB=`/**
  721. * Converts an HSB color (hue, saturation, brightness) to RGB
  722. * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
  723. *
  724. * @name czm_HSBToRGB
  725. * @glslFunction
  726. *
  727. * @param {vec3} hsb The color in HSB.
  728. *
  729. * @returns {vec3} The color in RGB.
  730. *
  731. * @example
  732. * vec3 hsb = czm_RGBToHSB(rgb);
  733. * hsb.z *= 0.1;
  734. * rgb = czm_HSBToRGB(hsb);
  735. */
  736. const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
  737. vec3 czm_HSBToRGB(vec3 hsb)
  738. {
  739. vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);
  740. return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);
  741. }
  742. `;var NB=`/**
  743. * Converts an HSL color (hue, saturation, lightness) to RGB
  744. * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
  745. *
  746. * @name czm_HSLToRGB
  747. * @glslFunction
  748. *
  749. * @param {vec3} rgb The color in HSL.
  750. *
  751. * @returns {vec3} The color in RGB.
  752. *
  753. * @example
  754. * vec3 hsl = czm_RGBToHSL(rgb);
  755. * hsl.z *= 0.1;
  756. * rgb = czm_HSLToRGB(hsl);
  757. */
  758. vec3 hueToRGB(float hue)
  759. {
  760. float r = abs(hue * 6.0 - 3.0) - 1.0;
  761. float g = 2.0 - abs(hue * 6.0 - 2.0);
  762. float b = 2.0 - abs(hue * 6.0 - 4.0);
  763. return clamp(vec3(r, g, b), 0.0, 1.0);
  764. }
  765. vec3 czm_HSLToRGB(vec3 hsl)
  766. {
  767. vec3 rgb = hueToRGB(hsl.x);
  768. float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
  769. return (rgb - 0.5) * c + hsl.z;
  770. }
  771. `;var FB=`/**
  772. * Converts an RGB color to HSB (hue, saturation, brightness)
  773. * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
  774. *
  775. * @name czm_RGBToHSB
  776. * @glslFunction
  777. *
  778. * @param {vec3} rgb The color in RGB.
  779. *
  780. * @returns {vec3} The color in HSB.
  781. *
  782. * @example
  783. * vec3 hsb = czm_RGBToHSB(rgb);
  784. * hsb.z *= 0.1;
  785. * rgb = czm_HSBToRGB(hsb);
  786. */
  787. const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
  788. vec3 czm_RGBToHSB(vec3 rgb)
  789. {
  790. vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));
  791. vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));
  792. float d = q.x - min(q.w, q.y);
  793. return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);
  794. }
  795. `;var kB=`/**
  796. * Converts an RGB color to HSL (hue, saturation, lightness)
  797. * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
  798. *
  799. * @name czm_RGBToHSL
  800. * @glslFunction
  801. *
  802. * @param {vec3} rgb The color in RGB.
  803. *
  804. * @returns {vec3} The color in HSL.
  805. *
  806. * @example
  807. * vec3 hsl = czm_RGBToHSL(rgb);
  808. * hsl.z *= 0.1;
  809. * rgb = czm_HSLToRGB(hsl);
  810. */
  811. vec3 RGBtoHCV(vec3 rgb)
  812. {
  813. // Based on work by Sam Hocevar and Emil Persson
  814. vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);
  815. vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);
  816. float c = q.x - min(q.w, q.y);
  817. float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);
  818. return vec3(h, c, q.x);
  819. }
  820. vec3 czm_RGBToHSL(vec3 rgb)
  821. {
  822. vec3 hcv = RGBtoHCV(rgb);
  823. float l = hcv.z - hcv.y * 0.5;
  824. float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);
  825. return vec3(hcv.x, s, l);
  826. }
  827. `;var zB=`/**
  828. * Converts an RGB color to CIE Yxy.
  829. * <p>The conversion is described in
  830. * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
  831. * </p>
  832. *
  833. * @name czm_RGBToXYZ
  834. * @glslFunction
  835. *
  836. * @param {vec3} rgb The color in RGB.
  837. *
  838. * @returns {vec3} The color in CIE Yxy.
  839. *
  840. * @example
  841. * vec3 xyz = czm_RGBToXYZ(rgb);
  842. * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
  843. * rgb = czm_XYZToRGB(xyz);
  844. */
  845. vec3 czm_RGBToXYZ(vec3 rgb)
  846. {
  847. const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,
  848. 0.3576, 0.7152, 0.1192,
  849. 0.1805, 0.0722, 0.9505);
  850. vec3 xyz = RGB2XYZ * rgb;
  851. vec3 Yxy;
  852. Yxy.r = xyz.g;
  853. float temp = dot(vec3(1.0), xyz);
  854. Yxy.gb = xyz.rg / temp;
  855. return Yxy;
  856. }
  857. `;var UB=`/**
  858. * Converts a CIE Yxy color to RGB.
  859. * <p>The conversion is described in
  860. * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
  861. * </p>
  862. *
  863. * @name czm_XYZToRGB
  864. * @glslFunction
  865. *
  866. * @param {vec3} Yxy The color in CIE Yxy.
  867. *
  868. * @returns {vec3} The color in RGB.
  869. *
  870. * @example
  871. * vec3 xyz = czm_RGBToXYZ(rgb);
  872. * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
  873. * rgb = czm_XYZToRGB(xyz);
  874. */
  875. vec3 czm_XYZToRGB(vec3 Yxy)
  876. {
  877. const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,
  878. -1.5371, 1.8760, -0.2040,
  879. -0.4985, 0.0416, 1.0572);
  880. vec3 xyz;
  881. xyz.r = Yxy.r * Yxy.g / Yxy.b;
  882. xyz.g = Yxy.r;
  883. xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
  884. return XYZ2RGB * xyz;
  885. }
  886. `;var VB=`// See:
  887. // https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
  888. vec3 czm_acesTonemapping(vec3 color) {
  889. float g = 0.985;
  890. float a = 0.065;
  891. float b = 0.0001;
  892. float c = 0.433;
  893. float d = 0.238;
  894. color = (color * (color + a) - b) / (color * (g * color + c) + d);
  895. color = clamp(color, 0.0, 1.0);
  896. return color;
  897. }
  898. `;var jB=`/**
  899. * @private
  900. */
  901. float czm_alphaWeight(float a)
  902. {
  903. float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
  904. // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:
  905. // http://jcgt.org/published/0002/02/09/
  906. 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))));
  907. }
  908. `;var GB=`/**
  909. * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.
  910. *
  911. * @name czm_antialias
  912. * @glslFunction
  913. *
  914. * @param {vec4} color1 The color on one side of the edge.
  915. * @param {vec4} color2 The color on the other side of the edge.
  916. * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.
  917. * @param {float} dist The distance to the edge in texture coordinates.
  918. * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.
  919. * @returns {vec4} The anti-aliased color.
  920. *
  921. * @example
  922. * // GLSL declarations
  923. * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);
  924. * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);
  925. *
  926. * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space
  927. * float dist = abs(textureCoordinates.t - 0.5);
  928. * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));
  929. * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);
  930. */
  931. vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)
  932. {
  933. float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);
  934. float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);
  935. val1 = val1 * (1.0 - val2);
  936. val1 = val1 * val1 * (3.0 - (2.0 * val1));
  937. val1 = pow(val1, 0.5); //makes the transition nicer
  938. vec4 midColor = (color1 + color2) * 0.5;
  939. return mix(midColor, currentColor, val1);
  940. }
  941. vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)
  942. {
  943. return czm_antialias(color1, color2, currentColor, dist, 0.1);
  944. }
  945. `;var HB=`/**
  946. * Apply a HSB color shift to an RGB color.
  947. *
  948. * @param {vec3} rgb The color in RGB space.
  949. * @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
  950. * @param {bool} ignoreBlackPixels If true, black pixels will be unchanged. This is necessary in some shaders such as atmosphere-related effects.
  951. *
  952. * @return {vec3} The RGB color after shifting in HSB space and clamping saturation and brightness to a valid range.
  953. */
  954. vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {
  955. // Convert rgb color to hsb
  956. vec3 hsb = czm_RGBToHSB(rgb);
  957. // Perform hsb shift
  958. // Hue cycles around so no clamp is needed.
  959. hsb.x += hsbShift.x; // hue
  960. hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); // saturation
  961. // brightness
  962. //
  963. // Some shaders such as atmosphere-related effects need to leave black
  964. // pixels unchanged
  965. if (ignoreBlackPixels) {
  966. hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0;
  967. } else {
  968. hsb.z = hsb.z + hsbShift.z;
  969. }
  970. hsb.z = clamp(hsb.z, 0.0, 1.0);
  971. // Convert shifted hsb back to rgb
  972. return czm_HSBToRGB(hsb);
  973. }
  974. `;var WB=`/**
  975. * Approximately computes spherical coordinates given a normal.
  976. * Uses approximate inverse trigonometry for speed and consistency,
  977. * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.
  978. *
  979. * @name czm_approximateSphericalCoordinates
  980. * @glslFunction
  981. *
  982. * @param {vec3} normal arbitrary-length normal.
  983. *
  984. * @returns {vec2} Approximate latitude and longitude spherical coordinates.
  985. */
  986. vec2 czm_approximateSphericalCoordinates(vec3 normal) {
  987. // Project into plane with vertical for latitude
  988. float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);
  989. float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);
  990. return vec2(latitudeApproximation, longitudeApproximation);
  991. }
  992. `;var qB=`/**
  993. * Compute a rational approximation to tanh(x)
  994. *
  995. * @param {float} x A real number input
  996. * @returns {float} An approximation for tanh(x)
  997. */
  998. float czm_approximateTanh(float x) {
  999. float x2 = x * x;
  1000. return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));
  1001. }
  1002. `;var YB=`/**
  1003. * Determines if the fragment is back facing
  1004. *
  1005. * @name czm_backFacing
  1006. * @glslFunction
  1007. *
  1008. * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.
  1009. */
  1010. bool czm_backFacing()
  1011. {
  1012. // !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.
  1013. return gl_FrontFacing == false;
  1014. }
  1015. `;var XB=`/**
  1016. * Branchless ternary operator to be used when it's inexpensive to explicitly
  1017. * evaluate both possibilities for a float expression.
  1018. *
  1019. * @name czm_branchFreeTernary
  1020. * @glslFunction
  1021. *
  1022. * @param {bool} comparison A comparison statement
  1023. * @param {float} a Value to return if the comparison is true.
  1024. * @param {float} b Value to return if the comparison is false.
  1025. *
  1026. * @returns {float} equivalent of comparison ? a : b
  1027. */
  1028. float czm_branchFreeTernary(bool comparison, float a, float b) {
  1029. float useA = float(comparison);
  1030. return a * useA + b * (1.0 - useA);
  1031. }
  1032. /**
  1033. * Branchless ternary operator to be used when it's inexpensive to explicitly
  1034. * evaluate both possibilities for a vec2 expression.
  1035. *
  1036. * @name czm_branchFreeTernary
  1037. * @glslFunction
  1038. *
  1039. * @param {bool} comparison A comparison statement
  1040. * @param {vec2} a Value to return if the comparison is true.
  1041. * @param {vec2} b Value to return if the comparison is false.
  1042. *
  1043. * @returns {vec2} equivalent of comparison ? a : b
  1044. */
  1045. vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
  1046. float useA = float(comparison);
  1047. return a * useA + b * (1.0 - useA);
  1048. }
  1049. /**
  1050. * Branchless ternary operator to be used when it's inexpensive to explicitly
  1051. * evaluate both possibilities for a vec3 expression.
  1052. *
  1053. * @name czm_branchFreeTernary
  1054. * @glslFunction
  1055. *
  1056. * @param {bool} comparison A comparison statement
  1057. * @param {vec3} a Value to return if the comparison is true.
  1058. * @param {vec3} b Value to return if the comparison is false.
  1059. *
  1060. * @returns {vec3} equivalent of comparison ? a : b
  1061. */
  1062. vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
  1063. float useA = float(comparison);
  1064. return a * useA + b * (1.0 - useA);
  1065. }
  1066. /**
  1067. * Branchless ternary operator to be used when it's inexpensive to explicitly
  1068. * evaluate both possibilities for a vec4 expression.
  1069. *
  1070. * @name czm_branchFreeTernary
  1071. * @glslFunction
  1072. *
  1073. * @param {bool} comparison A comparison statement
  1074. * @param {vec3} a Value to return if the comparison is true.
  1075. * @param {vec3} b Value to return if the comparison is false.
  1076. *
  1077. * @returns {vec3} equivalent of comparison ? a : b
  1078. */
  1079. vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
  1080. float useA = float(comparison);
  1081. return a * useA + b * (1.0 - useA);
  1082. }
  1083. `;var KB=`
  1084. vec4 czm_cascadeColor(vec4 weights)
  1085. {
  1086. return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +
  1087. vec4(0.0, 1.0, 0.0, 1.0) * weights.y +
  1088. vec4(0.0, 0.0, 1.0, 1.0) * weights.z +
  1089. vec4(1.0, 0.0, 1.0, 1.0) * weights.w;
  1090. }
  1091. `;var QB=`
  1092. uniform vec4 shadowMap_cascadeDistances;
  1093. float czm_cascadeDistance(vec4 weights)
  1094. {
  1095. return dot(shadowMap_cascadeDistances, weights);
  1096. }
  1097. `;var $B=`
  1098. uniform mat4 shadowMap_cascadeMatrices[4];
  1099. mat4 czm_cascadeMatrix(vec4 weights)
  1100. {
  1101. return shadowMap_cascadeMatrices[0] * weights.x +
  1102. shadowMap_cascadeMatrices[1] * weights.y +
  1103. shadowMap_cascadeMatrices[2] * weights.z +
  1104. shadowMap_cascadeMatrices[3] * weights.w;
  1105. }
  1106. `;var JB=`
  1107. uniform vec4 shadowMap_cascadeSplits[2];
  1108. vec4 czm_cascadeWeights(float depthEye)
  1109. {
  1110. // One component is set to 1.0 and all others set to 0.0.
  1111. vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
  1112. vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
  1113. return near * far;
  1114. }
  1115. `;var ZB=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
  1116. float signedDistance = texture(clippingDistance, uv).r;
  1117. return (signedDistance - 0.5) * 2.0;
  1118. }
  1119. void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 clippingPosition, int regionIndex) {
  1120. // Position is completely outside of polygons bounds
  1121. vec2 rectUv = clippingPosition;
  1122. if (regionIndex < 0 || rectUv.x <= 0.0 || rectUv.y <= 0.0 || rectUv.x >= 1.0 || rectUv.y >= 1.0) {
  1123. #ifdef CLIPPING_INVERSE
  1124. discard;
  1125. #endif
  1126. return;
  1127. }
  1128. vec2 clippingDistanceTextureDimensions = vec2(textureSize(clippingDistance, 0));
  1129. vec2 sampleOffset = max(1.0 / clippingDistanceTextureDimensions, vec2(0.005));
  1130. float dimension = float(extentsLength);
  1131. if (extentsLength > 2) {
  1132. dimension = ceil(log2(float(extentsLength)));
  1133. }
  1134. vec2 textureOffset = vec2(mod(float(regionIndex), dimension), floor(float(regionIndex) / dimension)) / dimension;
  1135. vec2 uv = textureOffset + rectUv / dimension;
  1136. float signedDistance = getSignedDistance(uv, clippingDistance);
  1137. #ifdef CLIPPING_INVERSE
  1138. if (signedDistance > 0.0) {
  1139. discard;
  1140. }
  1141. #else
  1142. if (signedDistance < 0.0) {
  1143. discard;
  1144. }
  1145. #endif
  1146. }
  1147. `;var eL=`/**
  1148. * DOC_TBA
  1149. *
  1150. * @name czm_columbusViewMorph
  1151. * @glslFunction
  1152. */
  1153. vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
  1154. {
  1155. // Just linear for now.
  1156. // We're manually doing the equivalent of a \`mix\` here because, some GPUs
  1157. // (NVidia GeForce 3070 Ti and Intel Arc A750, to name two), \`mix\` seems to
  1158. // use an alternate formulation that introduces jitter even when \`time\` is
  1159. // 0.0 or 1.0. That is, the value of \`p\` won't be exactly \`position2D.xyz\`
  1160. // when \`time\` is 0.0 and it won't be exactly \`position3D.xyz\` when \`time\` is
  1161. // 1.0. The "textbook" formulation here, while probably a bit slower,
  1162. // does not have this problem.
  1163. vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time;
  1164. return vec4(p, 1.0);
  1165. }
  1166. `;var tL=`/**
  1167. * Compute the atmosphere color, applying Rayleigh and Mie scattering. This
  1168. * builtin uses automatic uniforms so the atmophere settings are synced with the
  1169. * state of the Scene, even in other contexts like Model.
  1170. *
  1171. * @name czm_computeAtmosphereColor
  1172. * @glslFunction
  1173. *
  1174. * @param {vec3} positionWC Position of the fragment in world coords (low precision)
  1175. * @param {vec3} lightDirection Light direction from the sun or other light source.
  1176. * @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
  1177. * @param {vec3} mieColor The Mie scattering color computed by a scattering function
  1178. * @param {float} opacity The opacity computed by a scattering function.
  1179. */
  1180. vec4 czm_computeAtmosphereColor(
  1181. vec3 positionWC,
  1182. vec3 lightDirection,
  1183. vec3 rayleighColor,
  1184. vec3 mieColor,
  1185. float opacity
  1186. ) {
  1187. // Setup the primary ray: from the camera position to the vertex position.
  1188. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  1189. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  1190. float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
  1191. float cosAngleSq = cosAngle * cosAngle;
  1192. float G = czm_atmosphereMieAnisotropy;
  1193. float GSq = G * G;
  1194. // The Rayleigh phase function.
  1195. float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
  1196. // The Mie phase function.
  1197. 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));
  1198. // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
  1199. vec3 rayleigh = rayleighPhase * rayleighColor;
  1200. vec3 mie = miePhase * mieColor;
  1201. vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
  1202. return vec4(color, opacity);
  1203. }
  1204. /**
  1205. * Compute the atmosphere color, applying Rayleigh and Mie scattering. This
  1206. * builtin uses automatic uniforms so the atmophere settings are synced with the
  1207. * state of the Scene, even in other contexts like Model.
  1208. *
  1209. * @name czm_computeAtmosphereColor
  1210. * @glslFunction
  1211. *
  1212. * @param {czm_ray} primaryRay Ray from the origin to sky fragment to in world coords (low precision)
  1213. * @param {vec3} lightDirection Light direction from the sun or other light source.
  1214. * @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
  1215. * @param {vec3} mieColor The Mie scattering color computed by a scattering function
  1216. * @param {float} opacity The opacity computed by a scattering function.
  1217. */
  1218. vec4 czm_computeAtmosphereColor(
  1219. czm_ray primaryRay,
  1220. vec3 lightDirection,
  1221. vec3 rayleighColor,
  1222. vec3 mieColor,
  1223. float opacity
  1224. ) {
  1225. vec3 direction = normalize(primaryRay.direction);
  1226. float cosAngle = dot(direction, lightDirection);
  1227. float cosAngleSq = cosAngle * cosAngle;
  1228. float G = czm_atmosphereMieAnisotropy;
  1229. float GSq = G * G;
  1230. // The Rayleigh phase function.
  1231. float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
  1232. // The Mie phase function.
  1233. 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));
  1234. // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
  1235. vec3 rayleigh = rayleighPhase * rayleighColor;
  1236. vec3 mie = miePhase * mieColor;
  1237. vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
  1238. return vec4(color, opacity);
  1239. }
  1240. `;var nL=`/**
  1241. * Compute atmosphere scattering for the ground atmosphere and fog. This method
  1242. * uses automatic uniforms so it is always synced with the scene settings.
  1243. *
  1244. * @name czm_computeGroundAtmosphereScattering
  1245. * @glslfunction
  1246. *
  1247. * @param {vec3} positionWC The position of the fragment in world coordinates.
  1248. * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
  1249. * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
  1250. * @param {vec3} mieColor The variable the Mie scattering will be written to.
  1251. * @param {float} opacity The variable the transmittance will be written to.
  1252. */
  1253. void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
  1254. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  1255. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  1256. czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
  1257. float atmosphereInnerRadius = length(positionWC);
  1258. czm_computeScattering(
  1259. primaryRay,
  1260. length(cameraToPositionWC),
  1261. lightDirection,
  1262. atmosphereInnerRadius,
  1263. rayleighColor,
  1264. mieColor,
  1265. opacity
  1266. );
  1267. }
  1268. `;var iL=`/**
  1269. * Returns a position in model coordinates relative to eye taking into
  1270. * account the current scene mode: 3D, 2D, or Columbus view.
  1271. * <p>
  1272. * This uses standard position attributes, <code>position3DHigh</code>,
  1273. * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>,
  1274. * and should be used when writing a vertex shader for an {@link Appearance}.
  1275. * </p>
  1276. *
  1277. * @name czm_computePosition
  1278. * @glslFunction
  1279. *
  1280. * @returns {vec4} The position relative to eye.
  1281. *
  1282. * @example
  1283. * vec4 p = czm_computePosition();
  1284. * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
  1285. * gl_Position = czm_modelViewProjectionRelativeToEye * p;
  1286. *
  1287. * @see czm_translateRelativeToEye
  1288. */
  1289. vec4 czm_computePosition();
  1290. `;var oL=`/**
  1291. * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
  1292. * the transmittance value for the ray. This function uses automatic uniforms
  1293. * so the atmosphere settings are always synced with the current scene.
  1294. *
  1295. * @name czm_computeScattering
  1296. * @glslfunction
  1297. *
  1298. * @param {czm_ray} primaryRay The ray from the camera to the position.
  1299. * @param {float} primaryRayLength The length of the primary ray.
  1300. * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
  1301. * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
  1302. * @param {vec3} mieColor The variable the Mie scattering will be written to.
  1303. * @param {float} opacity The variable the transmittance will be written to.
  1304. */
  1305. void czm_computeScattering(
  1306. czm_ray primaryRay,
  1307. float primaryRayLength,
  1308. vec3 lightDirection,
  1309. float atmosphereInnerRadius,
  1310. out vec3 rayleighColor,
  1311. out vec3 mieColor,
  1312. out float opacity
  1313. ) {
  1314. const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
  1315. const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
  1316. 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.
  1317. // Initialize the default scattering amounts to 0.
  1318. rayleighColor = vec3(0.0);
  1319. mieColor = vec3(0.0);
  1320. opacity = 0.0;
  1321. float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
  1322. vec3 origin = vec3(0.0);
  1323. // Calculate intersection from the camera to the outer ring of the atmosphere.
  1324. czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
  1325. // Return empty colors if no intersection with the atmosphere geometry.
  1326. if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
  1327. return;
  1328. }
  1329. // To deal with smaller values of PRIMARY_STEPS (e.g. 4)
  1330. // we implement a split strategy: sky or horizon.
  1331. // For performance reasons, instead of a if/else branch
  1332. // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
  1333. float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
  1334. // Value close to 0.0: close to the horizon
  1335. // Value close to 1.0: above in the sky
  1336. float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
  1337. // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
  1338. float start_0 = primaryRayAtmosphereIntersect.start;
  1339. primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
  1340. // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
  1341. primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
  1342. // For the number of ray steps, distinguish inside or outside atmosphere (outer space)
  1343. // (1) from outer space we have to use more ray steps to get a realistic rendering
  1344. // (2) within atmosphere we need fewer steps for faster rendering
  1345. 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
  1346. float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
  1347. 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.
  1348. 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.
  1349. // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
  1350. float rayPositionLength = primaryRayAtmosphereIntersect.start;
  1351. // (1) Outside the atmosphere: constant rayStepLength
  1352. // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
  1353. float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
  1354. float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
  1355. float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
  1356. vec3 rayleighAccumulation = vec3(0.0);
  1357. vec3 mieAccumulation = vec3(0.0);
  1358. vec2 opticalDepth = vec2(0.0);
  1359. vec2 heightScale = vec2(czm_atmosphereRayleighScaleHeight, czm_atmosphereMieScaleHeight);
  1360. // Sample positions on the primary ray.
  1361. for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
  1362. // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
  1363. // loop with non-constant condition, so it has to break early instead
  1364. if (i >= PRIMARY_STEPS) {
  1365. break;
  1366. }
  1367. // Calculate sample position along viewpoint ray.
  1368. vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
  1369. // Calculate height of sample position above ellipsoid.
  1370. float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
  1371. // Calculate and accumulate density of particles at the sample position.
  1372. vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
  1373. opticalDepth += sampleDensity;
  1374. // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
  1375. czm_ray lightRay = czm_ray(samplePosition, lightDirection);
  1376. czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
  1377. float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
  1378. float lightPositionLength = 0.0;
  1379. vec2 lightOpticalDepth = vec2(0.0);
  1380. // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
  1381. for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
  1382. // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
  1383. // loop with non-constant condition, so it has to break early instead
  1384. if (j >= LIGHT_STEPS) {
  1385. break;
  1386. }
  1387. // Calculate sample position along light ray.
  1388. vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
  1389. // Calculate height of the light sample position above ellipsoid.
  1390. float lightHeight = length(lightPosition) - atmosphereInnerRadius;
  1391. // Calculate density of photons at the light sample position.
  1392. lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
  1393. // Increment distance on light ray.
  1394. lightPositionLength += lightStepLength;
  1395. }
  1396. // Compute attenuation via the primary ray and the light ray.
  1397. vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
  1398. // Accumulate the scattering.
  1399. rayleighAccumulation += sampleDensity.x * attenuation;
  1400. mieAccumulation += sampleDensity.y * attenuation;
  1401. // Increment distance on primary ray.
  1402. rayPositionLength += (rayStepLength += rayStepLengthIncrease);
  1403. }
  1404. // Compute the scattering amount.
  1405. rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;
  1406. mieColor = czm_atmosphereMieCoefficient * mieAccumulation;
  1407. // Compute the transmittance i.e. how much light is passing through the atmosphere.
  1408. opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));
  1409. }
  1410. `;var rL=`/**
  1411. * Applies a 2D texture transformation matrix to texture coordinates.
  1412. * This function applies translation, rotation, and scaling transformations
  1413. * as specified by the KHR_texture_transform glTF extension.
  1414. *
  1415. * @name czm_computeTextureTransform
  1416. * @glslFunction
  1417. *
  1418. * @param {vec2} texCoord The texture coordinates to transform.
  1419. * @param {mat3} textureTransform The 3x3 transformation matrix.
  1420. *
  1421. * @returns {vec2} The transformed texture coordinates.
  1422. *
  1423. * @example
  1424. * // GLSL declaration
  1425. * vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform);
  1426. *
  1427. * // Apply texture transform to UV coordinates
  1428. * vec2 transformedUV = czm_computeTextureTransform(uv, u_textureTransform);
  1429. */
  1430. vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform)
  1431. {
  1432. return vec2(textureTransform * vec3(texCoord, 1.0));
  1433. }`;var aL=`/**
  1434. * @private
  1435. */
  1436. vec2 cordic(float angle)
  1437. {
  1438. // Scale the vector by the appropriate factor for the 24 iterations to follow.
  1439. vec2 vector = vec2(6.0725293500888267e-1, 0.0);
  1440. // Iteration 1
  1441. float sense = (angle < 0.0) ? -1.0 : 1.0;
  1442. // float factor = sense * 1.0; // 2^-0
  1443. mat2 rotation = mat2(1.0, sense, -sense, 1.0);
  1444. vector = rotation * vector;
  1445. angle -= sense * 7.8539816339744828e-1; // atan(2^-0)
  1446. // Iteration 2
  1447. sense = (angle < 0.0) ? -1.0 : 1.0;
  1448. float factor = sense * 5.0e-1; // 2^-1
  1449. rotation[0][1] = factor;
  1450. rotation[1][0] = -factor;
  1451. vector = rotation * vector;
  1452. angle -= sense * 4.6364760900080609e-1; // atan(2^-1)
  1453. // Iteration 3
  1454. sense = (angle < 0.0) ? -1.0 : 1.0;
  1455. factor = sense * 2.5e-1; // 2^-2
  1456. rotation[0][1] = factor;
  1457. rotation[1][0] = -factor;
  1458. vector = rotation * vector;
  1459. angle -= sense * 2.4497866312686414e-1; // atan(2^-2)
  1460. // Iteration 4
  1461. sense = (angle < 0.0) ? -1.0 : 1.0;
  1462. factor = sense * 1.25e-1; // 2^-3
  1463. rotation[0][1] = factor;
  1464. rotation[1][0] = -factor;
  1465. vector = rotation * vector;
  1466. angle -= sense * 1.2435499454676144e-1; // atan(2^-3)
  1467. // Iteration 5
  1468. sense = (angle < 0.0) ? -1.0 : 1.0;
  1469. factor = sense * 6.25e-2; // 2^-4
  1470. rotation[0][1] = factor;
  1471. rotation[1][0] = -factor;
  1472. vector = rotation * vector;
  1473. angle -= sense * 6.2418809995957350e-2; // atan(2^-4)
  1474. // Iteration 6
  1475. sense = (angle < 0.0) ? -1.0 : 1.0;
  1476. factor = sense * 3.125e-2; // 2^-5
  1477. rotation[0][1] = factor;
  1478. rotation[1][0] = -factor;
  1479. vector = rotation * vector;
  1480. angle -= sense * 3.1239833430268277e-2; // atan(2^-5)
  1481. // Iteration 7
  1482. sense = (angle < 0.0) ? -1.0 : 1.0;
  1483. factor = sense * 1.5625e-2; // 2^-6
  1484. rotation[0][1] = factor;
  1485. rotation[1][0] = -factor;
  1486. vector = rotation * vector;
  1487. angle -= sense * 1.5623728620476831e-2; // atan(2^-6)
  1488. // Iteration 8
  1489. sense = (angle < 0.0) ? -1.0 : 1.0;
  1490. factor = sense * 7.8125e-3; // 2^-7
  1491. rotation[0][1] = factor;
  1492. rotation[1][0] = -factor;
  1493. vector = rotation * vector;
  1494. angle -= sense * 7.8123410601011111e-3; // atan(2^-7)
  1495. // Iteration 9
  1496. sense = (angle < 0.0) ? -1.0 : 1.0;
  1497. factor = sense * 3.90625e-3; // 2^-8
  1498. rotation[0][1] = factor;
  1499. rotation[1][0] = -factor;
  1500. vector = rotation * vector;
  1501. angle -= sense * 3.9062301319669718e-3; // atan(2^-8)
  1502. // Iteration 10
  1503. sense = (angle < 0.0) ? -1.0 : 1.0;
  1504. factor = sense * 1.953125e-3; // 2^-9
  1505. rotation[0][1] = factor;
  1506. rotation[1][0] = -factor;
  1507. vector = rotation * vector;
  1508. angle -= sense * 1.9531225164788188e-3; // atan(2^-9)
  1509. // Iteration 11
  1510. sense = (angle < 0.0) ? -1.0 : 1.0;
  1511. factor = sense * 9.765625e-4; // 2^-10
  1512. rotation[0][1] = factor;
  1513. rotation[1][0] = -factor;
  1514. vector = rotation * vector;
  1515. angle -= sense * 9.7656218955931946e-4; // atan(2^-10)
  1516. // Iteration 12
  1517. sense = (angle < 0.0) ? -1.0 : 1.0;
  1518. factor = sense * 4.8828125e-4; // 2^-11
  1519. rotation[0][1] = factor;
  1520. rotation[1][0] = -factor;
  1521. vector = rotation * vector;
  1522. angle -= sense * 4.8828121119489829e-4; // atan(2^-11)
  1523. // Iteration 13
  1524. sense = (angle < 0.0) ? -1.0 : 1.0;
  1525. factor = sense * 2.44140625e-4; // 2^-12
  1526. rotation[0][1] = factor;
  1527. rotation[1][0] = -factor;
  1528. vector = rotation * vector;
  1529. angle -= sense * 2.4414062014936177e-4; // atan(2^-12)
  1530. // Iteration 14
  1531. sense = (angle < 0.0) ? -1.0 : 1.0;
  1532. factor = sense * 1.220703125e-4; // 2^-13
  1533. rotation[0][1] = factor;
  1534. rotation[1][0] = -factor;
  1535. vector = rotation * vector;
  1536. angle -= sense * 1.2207031189367021e-4; // atan(2^-13)
  1537. // Iteration 15
  1538. sense = (angle < 0.0) ? -1.0 : 1.0;
  1539. factor = sense * 6.103515625e-5; // 2^-14
  1540. rotation[0][1] = factor;
  1541. rotation[1][0] = -factor;
  1542. vector = rotation * vector;
  1543. angle -= sense * 6.1035156174208773e-5; // atan(2^-14)
  1544. // Iteration 16
  1545. sense = (angle < 0.0) ? -1.0 : 1.0;
  1546. factor = sense * 3.0517578125e-5; // 2^-15
  1547. rotation[0][1] = factor;
  1548. rotation[1][0] = -factor;
  1549. vector = rotation * vector;
  1550. angle -= sense * 3.0517578115526096e-5; // atan(2^-15)
  1551. // Iteration 17
  1552. sense = (angle < 0.0) ? -1.0 : 1.0;
  1553. factor = sense * 1.52587890625e-5; // 2^-16
  1554. rotation[0][1] = factor;
  1555. rotation[1][0] = -factor;
  1556. vector = rotation * vector;
  1557. angle -= sense * 1.5258789061315762e-5; // atan(2^-16)
  1558. // Iteration 18
  1559. sense = (angle < 0.0) ? -1.0 : 1.0;
  1560. factor = sense * 7.62939453125e-6; // 2^-17
  1561. rotation[0][1] = factor;
  1562. rotation[1][0] = -factor;
  1563. vector = rotation * vector;
  1564. angle -= sense * 7.6293945311019700e-6; // atan(2^-17)
  1565. // Iteration 19
  1566. sense = (angle < 0.0) ? -1.0 : 1.0;
  1567. factor = sense * 3.814697265625e-6; // 2^-18
  1568. rotation[0][1] = factor;
  1569. rotation[1][0] = -factor;
  1570. vector = rotation * vector;
  1571. angle -= sense * 3.8146972656064961e-6; // atan(2^-18)
  1572. // Iteration 20
  1573. sense = (angle < 0.0) ? -1.0 : 1.0;
  1574. factor = sense * 1.9073486328125e-6; // 2^-19
  1575. rotation[0][1] = factor;
  1576. rotation[1][0] = -factor;
  1577. vector = rotation * vector;
  1578. angle -= sense * 1.9073486328101870e-6; // atan(2^-19)
  1579. // Iteration 21
  1580. sense = (angle < 0.0) ? -1.0 : 1.0;
  1581. factor = sense * 9.5367431640625e-7; // 2^-20
  1582. rotation[0][1] = factor;
  1583. rotation[1][0] = -factor;
  1584. vector = rotation * vector;
  1585. angle -= sense * 9.5367431640596084e-7; // atan(2^-20)
  1586. // Iteration 22
  1587. sense = (angle < 0.0) ? -1.0 : 1.0;
  1588. factor = sense * 4.76837158203125e-7; // 2^-21
  1589. rotation[0][1] = factor;
  1590. rotation[1][0] = -factor;
  1591. vector = rotation * vector;
  1592. angle -= sense * 4.7683715820308884e-7; // atan(2^-21)
  1593. // Iteration 23
  1594. sense = (angle < 0.0) ? -1.0 : 1.0;
  1595. factor = sense * 2.384185791015625e-7; // 2^-22
  1596. rotation[0][1] = factor;
  1597. rotation[1][0] = -factor;
  1598. vector = rotation * vector;
  1599. angle -= sense * 2.3841857910155797e-7; // atan(2^-22)
  1600. // Iteration 24
  1601. sense = (angle < 0.0) ? -1.0 : 1.0;
  1602. factor = sense * 1.1920928955078125e-7; // 2^-23
  1603. rotation[0][1] = factor;
  1604. rotation[1][0] = -factor;
  1605. vector = rotation * vector;
  1606. // angle -= sense * 1.1920928955078068e-7; // atan(2^-23)
  1607. return vector;
  1608. }
  1609. /**
  1610. * Computes the cosine and sine of the provided angle using the CORDIC algorithm.
  1611. *
  1612. * @name czm_cosineAndSine
  1613. * @glslFunction
  1614. *
  1615. * @param {float} angle The angle in radians.
  1616. *
  1617. * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).
  1618. *
  1619. * @example
  1620. * vec2 v = czm_cosineAndSine(czm_piOverSix);
  1621. * float cosine = v.x;
  1622. * float sine = v.y;
  1623. */
  1624. vec2 czm_cosineAndSine(float angle)
  1625. {
  1626. if (angle < -czm_piOverTwo || angle > czm_piOverTwo)
  1627. {
  1628. if (angle < 0.0)
  1629. {
  1630. return -cordic(angle + czm_pi);
  1631. }
  1632. else
  1633. {
  1634. return -cordic(angle - czm_pi);
  1635. }
  1636. }
  1637. else
  1638. {
  1639. return cordic(angle);
  1640. }
  1641. }
  1642. `;var sL=`/**
  1643. * Decodes RGB values packed into a single float at 8-bit precision. Encoded
  1644. * representation is equivalent to 0xFFFFFF in JavaScript.
  1645. *
  1646. * @name czm_decodeRGB8
  1647. * @glslFunction
  1648. *
  1649. * @param {float} encoded Float-encoded RGB values.
  1650. * @returns {vec4} Decoded RGB values.
  1651. */
  1652. vec4 czm_decodeRGB8(float encoded) {
  1653. const float SHIFT_RIGHT16 = 1.0 / 65536.0;
  1654. const float SHIFT_RIGHT8 = 1.0 / 256.0;
  1655. const float SHIFT_LEFT16 = 65536.0;
  1656. const float SHIFT_LEFT8 = 256.0;
  1657. vec4 color = vec4(255.0);
  1658. color.r = floor(encoded * SHIFT_RIGHT16);
  1659. color.g = floor((encoded - color.r * SHIFT_LEFT16) * SHIFT_RIGHT8);
  1660. color.b = floor(encoded - color.r * SHIFT_LEFT16 - color.g * SHIFT_LEFT8);
  1661. return color / 255.0;
  1662. }
  1663. `;var cL=`/**
  1664. * Decompresses texture coordinates that were packed into a single float.
  1665. *
  1666. * @name czm_decompressTextureCoordinates
  1667. * @glslFunction
  1668. *
  1669. * @param {float} encoded The compressed texture coordinates.
  1670. * @returns {vec2} The decompressed texture coordinates.
  1671. */
  1672. vec2 czm_decompressTextureCoordinates(float encoded)
  1673. {
  1674. float temp = encoded / 4096.0;
  1675. float xZeroTo4095 = floor(temp);
  1676. float stx = xZeroTo4095 / 4095.0;
  1677. float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;
  1678. return vec2(stx, sty);
  1679. }
  1680. `;var lL=`// emulated noperspective
  1681. #if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
  1682. out float v_WindowZ;
  1683. #endif
  1684. /**
  1685. * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.
  1686. * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes,
  1687. * capping the shadow volume. More information here:
  1688. * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.
  1689. *
  1690. * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring
  1691. * no geometry gets clipped by setting the clip space z value to 0.0 and then
  1692. * sending the unaltered screen space z value (using emulated noperspective
  1693. * interpolation) to the frag shader where it is clamped to [0,1] and then
  1694. * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:
  1695. * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.
  1696. *
  1697. * When GL_EXT_frag_depth is not available, which is the case on some mobile
  1698. * devices, we must attempt to fix this only in the vertex shader.
  1699. * The approach is to clamp the z value to the far plane, which closes the
  1700. * shadow volume but also distorts the geometry, so there can still be artifacts
  1701. * on frustum seams.
  1702. *
  1703. * @name czm_depthClamp
  1704. * @glslFunction
  1705. *
  1706. * @param {vec4} coords The vertex in clip coordinates.
  1707. * @returns {vec4} The modified vertex.
  1708. *
  1709. * @example
  1710. * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));
  1711. *
  1712. * @see czm_writeDepthClamp
  1713. */
  1714. vec4 czm_depthClamp(vec4 coords)
  1715. {
  1716. #ifndef LOG_DEPTH
  1717. #if __VERSION__ == 300 || defined(GL_EXT_frag_depth)
  1718. v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;
  1719. coords.z = 0.0;
  1720. #else
  1721. coords.z = min(coords.z, coords.w);
  1722. #endif
  1723. #endif
  1724. return coords;
  1725. }
  1726. `;var uL=`/**
  1727. * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system
  1728. * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the
  1729. * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.
  1730. * <br /><br />
  1731. * The ellipsoid is assumed to be centered at the model coordinate's origin.
  1732. *
  1733. * @name czm_eastNorthUpToEyeCoordinates
  1734. * @glslFunction
  1735. *
  1736. * @param {vec3} positionMC The position on the ellipsoid in model coordinates.
  1737. * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.
  1738. *
  1739. * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.
  1740. *
  1741. * @example
  1742. * // Transform a vector defined in the east-north-up coordinate
  1743. * // system, (0, 0, 1) which is the surface normal, to eye
  1744. * // coordinates.
  1745. * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
  1746. * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);
  1747. */
  1748. mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
  1749. {
  1750. vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates
  1751. vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordinates
  1752. vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates
  1753. return mat3(
  1754. tangentEC.x, tangentEC.y, tangentEC.z,
  1755. bitangentEC.x, bitangentEC.y, bitangentEC.z,
  1756. normalEC.x, normalEC.y, normalEC.z);
  1757. }
  1758. `;var fL=`/**
  1759. * DOC_TBA
  1760. *
  1761. * @name czm_ellipsoidContainsPoint
  1762. * @glslFunction
  1763. *
  1764. */
  1765. bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)
  1766. {
  1767. vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;
  1768. return (dot(scaled, scaled) <= 1.0);
  1769. }
  1770. `;var dL=`/**
  1771. * Approximate uv coordinates based on the ellipsoid normal.
  1772. *
  1773. * @name czm_ellipsoidTextureCoordinates
  1774. * @glslFunction
  1775. */
  1776. vec2 czm_ellipsoidTextureCoordinates(vec3 normal)
  1777. {
  1778. return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
  1779. }
  1780. `;var hL=`/**
  1781. * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>
  1782. * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs
  1783. * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,
  1784. * <code>vec3</code>s, or <code>vec4</code>s.
  1785. *
  1786. * @name czm_equalsEpsilon
  1787. * @glslFunction
  1788. *
  1789. * @param {} left The first vector.
  1790. * @param {} right The second vector.
  1791. * @param {float} epsilon The epsilon to use for equality testing.
  1792. * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.
  1793. *
  1794. * @example
  1795. * // GLSL declarations
  1796. * bool czm_equalsEpsilon(float left, float right, float epsilon);
  1797. * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);
  1798. * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);
  1799. * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);
  1800. */
  1801. bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {
  1802. return all(lessThanEqual(abs(left - right), vec4(epsilon)));
  1803. }
  1804. bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {
  1805. return all(lessThanEqual(abs(left - right), vec3(epsilon)));
  1806. }
  1807. bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {
  1808. return all(lessThanEqual(abs(left - right), vec2(epsilon)));
  1809. }
  1810. bool czm_equalsEpsilon(float left, float right, float epsilon) {
  1811. return (abs(left - right) <= epsilon);
  1812. }
  1813. `;var mL=`/**
  1814. * DOC_TBA
  1815. *
  1816. * @name czm_eyeOffset
  1817. * @glslFunction
  1818. *
  1819. * @param {vec4} positionEC DOC_TBA.
  1820. * @param {vec3} eyeOffset DOC_TBA.
  1821. *
  1822. * @returns {vec4} DOC_TBA.
  1823. */
  1824. vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
  1825. {
  1826. // This equation is approximate in x and y.
  1827. vec4 p = positionEC;
  1828. vec4 zEyeOffset = normalize(p) * eyeOffset.z;
  1829. p.xy += eyeOffset.xy + zEyeOffset.xy;
  1830. p.z += zEyeOffset.z;
  1831. return p;
  1832. }
  1833. `;var pL=`/**
  1834. * Transforms a position from eye to window coordinates. The transformation
  1835. * from eye to clip coordinates is done using {@link czm_projection}.
  1836. * The transform from normalized device coordinates to window coordinates is
  1837. * done using {@link czm_viewportTransformation}, which assumes a depth range
  1838. * of <code>near = 0</code> and <code>far = 1</code>.
  1839. * <br /><br />
  1840. * This transform is useful when there is a need to manipulate window coordinates
  1841. * in a vertex shader as done by {@link BillboardCollection}.
  1842. *
  1843. * @name czm_eyeToWindowCoordinates
  1844. * @glslFunction
  1845. *
  1846. * @param {vec4} position The position in eye coordinates to transform.
  1847. *
  1848. * @returns {vec4} The transformed position in window coordinates.
  1849. *
  1850. * @see czm_modelToWindowCoordinates
  1851. * @see czm_projection
  1852. * @see czm_viewportTransformation
  1853. * @see BillboardCollection
  1854. *
  1855. * @example
  1856. * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
  1857. */
  1858. vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
  1859. {
  1860. vec4 q = czm_projection * positionEC; // clip coordinates
  1861. q.xyz /= q.w; // normalized device coordinates
  1862. q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
  1863. return q;
  1864. }
  1865. `;var gL=`/**
  1866. * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.
  1867. *
  1868. * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on
  1869. * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
  1870. * Adapted from ShaderFastLibs under MIT License.
  1871. *
  1872. * Chosen for the following characteristics over range [0, 1]:
  1873. * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)
  1874. * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)
  1875. *
  1876. * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);
  1877. * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.
  1878. *
  1879. * @name czm_fastApproximateAtan
  1880. * @glslFunction
  1881. *
  1882. * @param {float} x Value between 0 and 1 inclusive.
  1883. *
  1884. * @returns {float} Approximation of atan(x)
  1885. */
  1886. float czm_fastApproximateAtan(float x) {
  1887. return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
  1888. }
  1889. /**
  1890. * Approximation of atan2.
  1891. *
  1892. * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html
  1893. * However, we replaced their atan curve with Michael Drobot's (see above).
  1894. *
  1895. * @name czm_fastApproximateAtan
  1896. * @glslFunction
  1897. *
  1898. * @param {float} x Value between -1 and 1 inclusive.
  1899. * @param {float} y Value between -1 and 1 inclusive.
  1900. *
  1901. * @returns {float} Approximation of atan2(x, y)
  1902. */
  1903. float czm_fastApproximateAtan(float x, float y) {
  1904. // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.
  1905. // So range-reduce using abs and by flipping whether x or y is on top.
  1906. float t = abs(x); // t used as swap and atan result.
  1907. float opposite = abs(y);
  1908. float adjacent = max(t, opposite);
  1909. opposite = min(t, opposite);
  1910. t = czm_fastApproximateAtan(opposite / adjacent);
  1911. // Undo range reduction
  1912. t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
  1913. t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
  1914. t = czm_branchFreeTernary(y < 0.0, -t, t);
  1915. return t;
  1916. }
  1917. `;var _L=`/**
  1918. * Gets the color with fog at a distance from the camera.
  1919. *
  1920. * @name czm_fog
  1921. * @glslFunction
  1922. *
  1923. * @param {float} distanceToCamera The distance to the camera in meters.
  1924. * @param {vec3} color The original color.
  1925. * @param {vec3} fogColor The color of the fog.
  1926. *
  1927. * @returns {vec3} The color adjusted for fog at the distance from the camera.
  1928. */
  1929. vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)
  1930. {
  1931. float scalar = distanceToCamera * czm_fogDensity;
  1932. float fog = 1.0 - exp(-(scalar * scalar));
  1933. return mix(color, fogColor, fog);
  1934. }
  1935. /**
  1936. * Gets the color with fog at a distance from the camera.
  1937. *
  1938. * @name czm_fog
  1939. * @glslFunction
  1940. *
  1941. * @param {float} distanceToCamera The distance to the camera in meters.
  1942. * @param {vec3} color The original color.
  1943. * @param {vec3} fogColor The color of the fog.
  1944. * @param {float} fogModifierConstant A constant to modify the appearance of fog.
  1945. *
  1946. * @returns {vec3} The color adjusted for fog at the distance from the camera.
  1947. */
  1948. vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)
  1949. {
  1950. float scalar = distanceToCamera * czm_fogDensity;
  1951. float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));
  1952. return mix(color, fogColor, fog);
  1953. }
  1954. `;var AL=`/**
  1955. * Converts a color from RGB space to linear space.
  1956. *
  1957. * @name czm_gammaCorrect
  1958. * @glslFunction
  1959. *
  1960. * @param {vec3} color The color in RGB space.
  1961. * @returns {vec3} The color in linear space.
  1962. */
  1963. vec3 czm_gammaCorrect(vec3 color) {
  1964. #ifdef HDR
  1965. color = pow(color, vec3(czm_gamma));
  1966. #endif
  1967. return color;
  1968. }
  1969. vec4 czm_gammaCorrect(vec4 color) {
  1970. #ifdef HDR
  1971. color.rgb = pow(color.rgb, vec3(czm_gamma));
  1972. #endif
  1973. return color;
  1974. }
  1975. `;var yL=`/**
  1976. * DOC_TBA
  1977. *
  1978. * @name czm_geodeticSurfaceNormal
  1979. * @glslFunction
  1980. *
  1981. * @param {vec3} positionOnEllipsoid DOC_TBA
  1982. * @param {vec3} ellipsoidCenter DOC_TBA
  1983. * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA
  1984. *
  1985. * @returns {vec3} DOC_TBA.
  1986. */
  1987. vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
  1988. {
  1989. return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
  1990. }
  1991. `;var xL=`/**
  1992. * An czm_material with default values. Every material's czm_getMaterial
  1993. * should use this default material as a base for the material it returns.
  1994. * The default normal value is given by materialInput.normalEC.
  1995. *
  1996. * @name czm_getDefaultMaterial
  1997. * @glslFunction
  1998. *
  1999. * @param {czm_materialInput} input The input used to construct the default material.
  2000. *
  2001. * @returns {czm_material} The default material.
  2002. *
  2003. * @see czm_materialInput
  2004. * @see czm_material
  2005. * @see czm_getMaterial
  2006. */
  2007. czm_material czm_getDefaultMaterial(czm_materialInput materialInput)
  2008. {
  2009. czm_material material;
  2010. material.diffuse = vec3(0.0);
  2011. material.specular = 0.0;
  2012. material.shininess = 1.0;
  2013. material.normal = materialInput.normalEC;
  2014. material.emission = vec3(0.0);
  2015. material.alpha = 1.0;
  2016. return material;
  2017. }
  2018. `;var bL=`/**
  2019. * Select which direction vector to use for dynamic atmosphere lighting based on an enum value
  2020. *
  2021. * @name czm_getDynamicAtmosphereLightDirection
  2022. * @glslfunction
  2023. * @see DynamicAtmosphereLightingType.js
  2024. *
  2025. * @param {vec3} positionWC the position of the vertex/fragment in world coordinates. This is normalized and returned when dynamic lighting is turned off.
  2026. * @param {float} lightEnum The enum value for selecting between light sources.
  2027. * @return {vec3} The normalized light direction vector. Depending on the enum value, it is either positionWC, czm_lightDirectionWC or czm_sunDirectionWC
  2028. */
  2029. vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) {
  2030. const float NONE = 0.0;
  2031. const float SCENE_LIGHT = 1.0;
  2032. const float SUNLIGHT = 2.0;
  2033. vec3 lightDirection =
  2034. positionWC * float(lightEnum == NONE) +
  2035. czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) +
  2036. czm_sunDirectionWC * float(lightEnum == SUNLIGHT);
  2037. return normalize(lightDirection);
  2038. }
  2039. `;var TL=`/**
  2040. * Calculates the intensity of diffusely reflected light.
  2041. *
  2042. * @name czm_getLambertDiffuse
  2043. * @glslFunction
  2044. *
  2045. * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
  2046. * @param {vec3} normalEC The surface normal in eye coordinates.
  2047. *
  2048. * @returns {float} The intensity of the diffuse reflection.
  2049. *
  2050. * @see czm_phong
  2051. *
  2052. * @example
  2053. * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
  2054. * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
  2055. * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
  2056. */
  2057. float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
  2058. {
  2059. return max(dot(lightDirectionEC, normalEC), 0.0);
  2060. }
  2061. `;var CL=`/**
  2062. * Calculates the specular intensity of reflected light.
  2063. *
  2064. * @name czm_getSpecular
  2065. * @glslFunction
  2066. *
  2067. * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
  2068. * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.
  2069. * @param {vec3} normalEC The surface normal in eye coordinates.
  2070. * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
  2071. *
  2072. * @returns {float} The intensity of the specular highlight.
  2073. *
  2074. * @see czm_phong
  2075. *
  2076. * @example
  2077. * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
  2078. * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
  2079. * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
  2080. */
  2081. float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
  2082. {
  2083. vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
  2084. float specular = max(dot(toReflectedLight, toEyeEC), 0.0);
  2085. // pow has undefined behavior if both parameters <= 0.
  2086. // Prevent this by making sure shininess is at least czm_epsilon2.
  2087. return pow(specular, max(shininess, czm_epsilon2));
  2088. }
  2089. `;var EL=`/**
  2090. * @private
  2091. */
  2092. vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
  2093. {
  2094. float cosAngle = cos(angleInRadians);
  2095. float sinAngle = sin(angleInRadians);
  2096. // time dependent sampling directions
  2097. vec2 s0 = vec2(1.0/17.0, 0.0);
  2098. vec2 s1 = vec2(-1.0/29.0, 0.0);
  2099. vec2 s2 = vec2(1.0/101.0, 1.0/59.0);
  2100. vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);
  2101. // rotate sampling direction by specified angle
  2102. s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));
  2103. s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));
  2104. s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));
  2105. s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));
  2106. vec2 uv0 = (uv/103.0) + (time * s0);
  2107. vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);
  2108. vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);
  2109. vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);
  2110. uv0 = fract(uv0);
  2111. uv1 = fract(uv1);
  2112. uv2 = fract(uv2);
  2113. uv3 = fract(uv3);
  2114. vec4 noise = (texture(normalMap, uv0)) +
  2115. (texture(normalMap, uv1)) +
  2116. (texture(normalMap, uv2)) +
  2117. (texture(normalMap, uv3));
  2118. // average and scale to between -1 and 1
  2119. return ((noise / 4.0) - 0.5) * 2.0;
  2120. }
  2121. `;var vL=`/**
  2122. * Adjusts the hue of a color.
  2123. *
  2124. * @name czm_hue
  2125. * @glslFunction
  2126. *
  2127. * @param {vec3} rgb The color.
  2128. * @param {float} adjustment The amount to adjust the hue of the color in radians.
  2129. *
  2130. * @returns {float} The color with the hue adjusted.
  2131. *
  2132. * @example
  2133. * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)
  2134. */
  2135. vec3 czm_hue(vec3 rgb, float adjustment)
  2136. {
  2137. const mat3 toYIQ = mat3(0.299, 0.587, 0.114,
  2138. 0.595716, -0.274453, -0.321263,
  2139. 0.211456, -0.522591, 0.311135);
  2140. const mat3 toRGB = mat3(1.0, 0.9563, 0.6210,
  2141. 1.0, -0.2721, -0.6474,
  2142. 1.0, -1.107, 1.7046);
  2143. vec3 yiq = toYIQ * rgb;
  2144. float hue = atan(yiq.z, yiq.y) + adjustment;
  2145. float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);
  2146. vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));
  2147. return toRGB * color;
  2148. }
  2149. `;var SL=`/**
  2150. * Converts a color in linear space to RGB space.
  2151. *
  2152. * @name czm_inverseGamma
  2153. * @glslFunction
  2154. *
  2155. * @param {vec3} color The color in linear space.
  2156. * @returns {vec3} The color in RGB space.
  2157. */
  2158. vec3 czm_inverseGamma(vec3 color) {
  2159. return pow(color, vec3(1.0 / czm_gamma));
  2160. }
  2161. `;var wL=`/**
  2162. * Determines if a time interval is empty.
  2163. *
  2164. * @name czm_isEmpty
  2165. * @glslFunction
  2166. *
  2167. * @param {czm_raySegment} interval The interval to test.
  2168. *
  2169. * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
  2170. *
  2171. * @example
  2172. * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
  2173. * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
  2174. * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
  2175. */
  2176. bool czm_isEmpty(czm_raySegment interval)
  2177. {
  2178. return (interval.stop < 0.0);
  2179. }
  2180. `;var IL=`/**
  2181. * Determines if a time interval is empty.
  2182. *
  2183. * @name czm_isFull
  2184. * @glslFunction
  2185. *
  2186. * @param {czm_raySegment} interval The interval to test.
  2187. *
  2188. * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
  2189. *
  2190. * @example
  2191. * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
  2192. * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
  2193. * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
  2194. */
  2195. bool czm_isFull(czm_raySegment interval)
  2196. {
  2197. return (interval.start == 0.0 && interval.stop == czm_infinity);
  2198. }
  2199. `;var DL=`/**
  2200. * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.
  2201. *
  2202. * @name czm_latitudeToWebMercatorFraction
  2203. * @glslFunction
  2204. *
  2205. * @param {float} latitude The geodetic latitude, in radians.
  2206. * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.
  2207. * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.
  2208. *
  2209. * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern
  2210. * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return
  2211. * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection.
  2212. */
  2213. float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)
  2214. {
  2215. float sinLatitude = sin(latitude);
  2216. float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));
  2217. return (mercatorY - southMercatorY) * oneOverMercatorHeight;
  2218. }
  2219. `;var PL=`/**
  2220. * Computes distance from an point in 2D to a line in 2D.
  2221. *
  2222. * @name czm_lineDistance
  2223. * @glslFunction
  2224. *
  2225. * param {vec2} point1 A point along the line.
  2226. * param {vec2} point2 A point along the line.
  2227. * param {vec2} point A point that may or may not be on the line.
  2228. * returns {float} The distance from the point to the line.
  2229. */
  2230. float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {
  2231. 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);
  2232. }
  2233. `;var RL=`/**
  2234. * Converts a linear RGB color to an sRGB color.
  2235. *
  2236. * @param {vec3|vec4} linearIn The color in linear color space.
  2237. * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.
  2238. */
  2239. vec3 czm_linearToSrgb(vec3 linearIn)
  2240. {
  2241. return pow(linearIn, vec3(1.0/2.2));
  2242. }
  2243. vec4 czm_linearToSrgb(vec4 linearIn)
  2244. {
  2245. vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
  2246. return vec4(srgbOut, linearIn.a);
  2247. }
  2248. `;var OL=`/**
  2249. * Computes the luminance of a color.
  2250. *
  2251. * @name czm_luminance
  2252. * @glslFunction
  2253. *
  2254. * @param {vec3} rgb The color.
  2255. *
  2256. * @returns {float} The luminance.
  2257. *
  2258. * @example
  2259. * float light = czm_luminance(vec3(0.0)); // 0.0
  2260. * float dark = czm_luminance(vec3(1.0)); // ~1.0
  2261. */
  2262. float czm_luminance(vec3 rgb)
  2263. {
  2264. // Algorithm from Chapter 10 of Graphics Shaders.
  2265. const vec3 W = vec3(0.2125, 0.7154, 0.0721);
  2266. return dot(rgb, W);
  2267. }
  2268. `;var ML=`/**
  2269. * Find the maximum component of a vector.
  2270. *
  2271. * @name czm_maximumComponent
  2272. * @glslFunction
  2273. *
  2274. * @param {vec2|vec3|vec4} v The input vector.
  2275. * @returns {float} The value of the largest component.
  2276. */
  2277. float czm_maximumComponent(vec2 v)
  2278. {
  2279. return max(v.x, v.y);
  2280. }
  2281. float czm_maximumComponent(vec3 v)
  2282. {
  2283. return max(max(v.x, v.y), v.z);
  2284. }
  2285. float czm_maximumComponent(vec4 v)
  2286. {
  2287. return max(max(max(v.x, v.y), v.z), v.w);
  2288. }
  2289. `;var BL=`/**
  2290. * Computes the size of a pixel in meters at a distance from the eye.
  2291. * <p>
  2292. * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.
  2293. * </p>
  2294. * @name czm_metersPerPixel
  2295. * @glslFunction
  2296. *
  2297. * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
  2298. * @param {float} pixelRatio The scaling factor from pixel space to coordinate space
  2299. *
  2300. * @returns {float} The meters per pixel at positionEC.
  2301. */
  2302. float czm_metersPerPixel(vec4 positionEC, float pixelRatio)
  2303. {
  2304. float width = czm_viewport.z;
  2305. float height = czm_viewport.w;
  2306. float pixelWidth;
  2307. float pixelHeight;
  2308. float top = czm_frustumPlanes.x;
  2309. float bottom = czm_frustumPlanes.y;
  2310. float left = czm_frustumPlanes.z;
  2311. float right = czm_frustumPlanes.w;
  2312. if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)
  2313. {
  2314. float frustumWidth = right - left;
  2315. float frustumHeight = top - bottom;
  2316. pixelWidth = frustumWidth / width;
  2317. pixelHeight = frustumHeight / height;
  2318. }
  2319. else
  2320. {
  2321. float distanceToPixel = -positionEC.z;
  2322. float inverseNear = 1.0 / czm_currentFrustum.x;
  2323. float tanTheta = top * inverseNear;
  2324. pixelHeight = 2.0 * distanceToPixel * tanTheta / height;
  2325. tanTheta = right * inverseNear;
  2326. pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
  2327. }
  2328. return max(pixelWidth, pixelHeight) * pixelRatio;
  2329. }
  2330. /**
  2331. * Computes the size of a pixel in meters at a distance from the eye.
  2332. * <p>
  2333. * Use this version when scaling by pixel ratio.
  2334. * </p>
  2335. * @name czm_metersPerPixel
  2336. * @glslFunction
  2337. *
  2338. * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
  2339. *
  2340. * @returns {float} The meters per pixel at positionEC.
  2341. */
  2342. float czm_metersPerPixel(vec4 positionEC)
  2343. {
  2344. return czm_metersPerPixel(positionEC, czm_pixelRatio);
  2345. }
  2346. `;var LL=`/**
  2347. * Transforms a position from model to window coordinates. The transformation
  2348. * from model to clip coordinates is done using {@link czm_modelViewProjection}.
  2349. * The transform from normalized device coordinates to window coordinates is
  2350. * done using {@link czm_viewportTransformation}, which assumes a depth range
  2351. * of <code>near = 0</code> and <code>far = 1</code>.
  2352. * <br /><br />
  2353. * This transform is useful when there is a need to manipulate window coordinates
  2354. * in a vertex shader as done by {@link BillboardCollection}.
  2355. * <br /><br />
  2356. * This function should not be confused with {@link czm_viewportOrthographic},
  2357. * which is an orthographic projection matrix that transforms from window
  2358. * coordinates to clip coordinates.
  2359. *
  2360. * @name czm_modelToWindowCoordinates
  2361. * @glslFunction
  2362. *
  2363. * @param {vec4} position The position in model coordinates to transform.
  2364. *
  2365. * @returns {vec4} The transformed position in window coordinates.
  2366. *
  2367. * @see czm_eyeToWindowCoordinates
  2368. * @see czm_modelViewProjection
  2369. * @see czm_viewportTransformation
  2370. * @see czm_viewportOrthographic
  2371. * @see BillboardCollection
  2372. *
  2373. * @example
  2374. * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);
  2375. */
  2376. vec4 czm_modelToWindowCoordinates(vec4 position)
  2377. {
  2378. vec4 positionEC = czm_modelView * position;
  2379. vec4 q = czm_projection * positionEC;
  2380. q.xyz /= q.w; // normalized device coordinates
  2381. q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
  2382. return q;
  2383. }
  2384. `;var NL=`/**
  2385. * DOC_TBA
  2386. *
  2387. * @name czm_multiplyWithColorBalance
  2388. * @glslFunction
  2389. */
  2390. vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
  2391. {
  2392. // Algorithm from Chapter 10 of Graphics Shaders.
  2393. const vec3 W = vec3(0.2125, 0.7154, 0.0721);
  2394. vec3 target = left * right;
  2395. float leftLuminance = dot(left, W);
  2396. float rightLuminance = dot(right, W);
  2397. float targetLuminance = dot(target, W);
  2398. return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;
  2399. }
  2400. `;var FL=`/**
  2401. * Computes a value that scales with distance. The scaling is clamped at the near and
  2402. * far distances, and does not extrapolate. This function works with the
  2403. * {@link NearFarScalar} JavaScript class.
  2404. *
  2405. * @name czm_nearFarScalar
  2406. * @glslFunction
  2407. *
  2408. * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).
  2409. * @param {float} cameraDistSq The square of the current distance from the camera.
  2410. *
  2411. * @returns {float} The value at this distance.
  2412. */
  2413. float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)
  2414. {
  2415. float valueAtMin = nearFarScalar.y;
  2416. float valueAtMax = nearFarScalar.w;
  2417. float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;
  2418. float farDistanceSq = nearFarScalar.z * nearFarScalar.z;
  2419. float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);
  2420. t = pow(clamp(t, 0.0, 1.0), 0.2);
  2421. return mix(valueAtMin, valueAtMax, t);
  2422. }
  2423. `;var kL=` /**
  2424. * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
  2425. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  2426. * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  2427. *
  2428. * @name czm_octDecode
  2429. * @param {vec2} encoded The oct-encoded, unit-length vector
  2430. * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
  2431. * @returns {vec3} The decoded and normalized vector
  2432. */
  2433. vec3 czm_octDecode(vec2 encoded, float range)
  2434. {
  2435. if (encoded.x == 0.0 && encoded.y == 0.0) {
  2436. return vec3(0.0, 0.0, 0.0);
  2437. }
  2438. encoded = encoded / range * 2.0 - 1.0;
  2439. vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
  2440. if (v.z < 0.0)
  2441. {
  2442. v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
  2443. }
  2444. return normalize(v);
  2445. }
  2446. /**
  2447. * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
  2448. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  2449. * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  2450. *
  2451. * @name czm_octDecode
  2452. * @param {vec2} encoded The oct-encoded, unit-length vector
  2453. * @returns {vec3} The decoded and normalized vector
  2454. */
  2455. vec3 czm_octDecode(vec2 encoded)
  2456. {
  2457. return czm_octDecode(encoded, 255.0);
  2458. }
  2459. /**
  2460. * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.
  2461. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  2462. * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  2463. *
  2464. * @name czm_octDecode
  2465. * @param {float} encoded The oct-encoded, unit-length vector
  2466. * @returns {vec3} The decoded and normalized vector
  2467. */
  2468. vec3 czm_octDecode(float encoded)
  2469. {
  2470. float temp = encoded / 256.0;
  2471. float x = floor(temp);
  2472. float y = (temp - x) * 256.0;
  2473. return czm_octDecode(vec2(x, y));
  2474. }
  2475. /**
  2476. * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.
  2477. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  2478. * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  2479. *
  2480. * @name czm_octDecode
  2481. * @param {vec2} encoded The packed oct-encoded, unit-length vectors.
  2482. * @param {vec3} vector1 One decoded and normalized vector.
  2483. * @param {vec3} vector2 One decoded and normalized vector.
  2484. * @param {vec3} vector3 One decoded and normalized vector.
  2485. */
  2486. void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
  2487. {
  2488. float temp = encoded.x / 65536.0;
  2489. float x = floor(temp);
  2490. float encodedFloat1 = (temp - x) * 65536.0;
  2491. temp = encoded.y / 65536.0;
  2492. float y = floor(temp);
  2493. float encodedFloat2 = (temp - y) * 65536.0;
  2494. vector1 = czm_octDecode(encodedFloat1);
  2495. vector2 = czm_octDecode(encodedFloat2);
  2496. vector3 = czm_octDecode(vec2(x, y));
  2497. }
  2498. `;var zL=`/**
  2499. * Packs a depth value into a vec4 that can be represented by unsigned bytes.
  2500. *
  2501. * @name czm_packDepth
  2502. * @glslFunction
  2503. *
  2504. * @param {float} depth The floating-point depth.
  2505. * @returns {vec4} The packed depth.
  2506. */
  2507. vec4 czm_packDepth(float depth)
  2508. {
  2509. // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
  2510. // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
  2511. vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;
  2512. enc = fract(enc);
  2513. enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
  2514. return enc;
  2515. }
  2516. `;var UL=`vec3 lambertianDiffuse(vec3 diffuseColor)
  2517. {
  2518. return diffuseColor / czm_pi;
  2519. }
  2520. vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
  2521. {
  2522. float versine = 1.0 - VdotH;
  2523. // pow(versine, 5.0) is slow. See https://stackoverflow.com/a/68793086/10082269
  2524. float versineSquared = versine * versine;
  2525. return f0 + (f90 - f0) * versineSquared * versineSquared * versine;
  2526. }
  2527. #ifdef USE_ANISOTROPY
  2528. /**
  2529. * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
  2530. * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
  2531. * @param {vec3} lightDirection The direction from the fragment to the light source, transformed to tangent-bitangent-normal coordinates
  2532. * @param {vec3} viewDirection The direction from the fragment to the camera, transformed to tangent-bitangent-normal coordinates
  2533. */
  2534. float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection)
  2535. {
  2536. vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0);
  2537. float GGXV = lightDirection.z * length(roughnessScale * viewDirection);
  2538. float GGXL = viewDirection.z * length(roughnessScale * lightDirection);
  2539. float v = 0.5 / (GGXV + GGXL);
  2540. return clamp(v, 0.0, 1.0);
  2541. }
  2542. /**
  2543. * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
  2544. * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
  2545. * @param {vec3} halfwayDirection The unit vector halfway between light and view directions, transformed to tangent-bitangent-normal coordinates
  2546. */
  2547. float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection)
  2548. {
  2549. float roughnessSquared = bitangentRoughness * tangentialRoughness;
  2550. vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared);
  2551. float w2 = roughnessSquared / dot(f, f);
  2552. return roughnessSquared * w2 * w2 / czm_pi;
  2553. }
  2554. #endif
  2555. /**
  2556. * Estimate the geometric self-shadowing of the microfacets in a surface,
  2557. * using the Smith Joint GGX visibility function.
  2558. * Note: Vis = G / (4 * NdotL * NdotV)
  2559. * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
  2560. * see Real-Time Rendering. Page 331 to 336.
  2561. * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
  2562. *
  2563. * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
  2564. * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
  2565. * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
  2566. */
  2567. float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
  2568. {
  2569. float alphaRoughnessSq = alphaRoughness * alphaRoughness;
  2570. float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
  2571. float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
  2572. float GGX = GGXV + GGXL;
  2573. if (GGX > 0.0)
  2574. {
  2575. return 0.5 / GGX;
  2576. }
  2577. return 0.0;
  2578. }
  2579. /**
  2580. * Estimate the fraction of the microfacets in a surface that are aligned with
  2581. * the halfway vector, which is aligned halfway between the directions from
  2582. * the fragment to the camera and from the fragment to the light source.
  2583. *
  2584. * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
  2585. * @param {float} NdotH The cosine of the angle between the surface normal and the halfway vector.
  2586. * @return {float} The fraction of microfacets aligned to the halfway vector.
  2587. */
  2588. float GGX(float alphaRoughness, float NdotH)
  2589. {
  2590. float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
  2591. float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0;
  2592. return alphaRoughnessSquared / (czm_pi * f * f);
  2593. }
  2594. /**
  2595. * Compute the strength of the specular reflection due to direct lighting.
  2596. *
  2597. * @param {vec3} normal The surface normal.
  2598. * @param {vec3} lightDirection The unit vector pointing from the fragment to the light source.
  2599. * @param {vec3} viewDirection The unit vector pointing from the fragment to the camera.
  2600. * @param {vec3} halfwayDirection The unit vector pointing from the fragment to halfway between the light source and the camera.
  2601. * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
  2602. * @return {float} The strength of the specular reflection.
  2603. */
  2604. float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness)
  2605. {
  2606. float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0);
  2607. float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
  2608. float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
  2609. float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0);
  2610. float D = GGX(alphaRoughness, NdotH);
  2611. return G * D;
  2612. }
  2613. /**
  2614. * Compute the diffuse and specular contributions using physically based
  2615. * rendering. This function only handles direct lighting.
  2616. * <p>
  2617. * This function only handles the lighting calculations. Metallic/roughness
  2618. * and specular/glossy must be handled separately. See {@MaterialStageFS}
  2619. * </p>
  2620. *
  2621. * @name czm_pbrLighting
  2622. * @glslFunction
  2623. *
  2624. * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position
  2625. * @param {vec3} normalEC The surface normal in eye coordinates
  2626. * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
  2627. * @param {czm_modelMaterial} The material properties.
  2628. * @return {vec3} The computed HDR color
  2629. */
  2630. vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material)
  2631. {
  2632. vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC);
  2633. float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0);
  2634. float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0);
  2635. vec3 f0 = material.specular;
  2636. float reflectance = czm_maximumComponent(f0);
  2637. // Typical dielectrics will have reflectance 0.04, so f90 will be 1.0.
  2638. // In this case, at grazing angle, all incident energy is reflected.
  2639. vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
  2640. vec3 F = fresnelSchlick2(f0, f90, VdotH);
  2641. #if defined(USE_SPECULAR)
  2642. F *= material.specularWeight;
  2643. #endif
  2644. float alphaRoughness = material.roughness * material.roughness;
  2645. #ifdef USE_ANISOTROPY
  2646. mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC);
  2647. vec3 lightDirection = lightDirectionEC * tbn;
  2648. vec3 viewDirection = viewDirectionEC * tbn;
  2649. vec3 halfwayDirection = halfwayDirectionEC * tbn;
  2650. float anisotropyStrength = material.anisotropyStrength;
  2651. float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength);
  2652. float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0);
  2653. float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection);
  2654. float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection);
  2655. vec3 specularContribution = F * G * D;
  2656. #else
  2657. float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness);
  2658. vec3 specularContribution = F * specularStrength;
  2659. #endif
  2660. vec3 diffuseColor = material.diffuse;
  2661. // F here represents the specular contribution
  2662. vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);
  2663. // Lo = (diffuse + specular) * Li * NdotL
  2664. return (diffuseContribution + specularContribution) * NdotL;
  2665. }
  2666. `;var VL=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral
  2667. // Input color is non-negative and resides in the Linear Rec. 709 color space.
  2668. // Output color is also Linear Rec. 709, but in the [0, 1] range.
  2669. vec3 czm_pbrNeutralTonemapping(vec3 color) {
  2670. const float startCompression = 0.8 - 0.04;
  2671. const float desaturation = 0.15;
  2672. float x = min(color.r, min(color.g, color.b));
  2673. float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04);
  2674. color -= offset;
  2675. float peak = max(color.r, max(color.g, color.b));
  2676. if (peak < startCompression) return color;
  2677. const float d = 1.0 - startCompression;
  2678. float newPeak = 1.0 - d * d / (peak + d - startCompression);
  2679. color *= newPeak / peak;
  2680. float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);
  2681. return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g);
  2682. }
  2683. `;var jL=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)
  2684. {
  2685. return czm_getLambertDiffuse(lightDirectionEC, material.normal);
  2686. }
  2687. float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)
  2688. {
  2689. return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);
  2690. }
  2691. /**
  2692. * Computes a color using the Phong lighting model.
  2693. *
  2694. * @name czm_phong
  2695. * @glslFunction
  2696. *
  2697. * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.
  2698. * @param {czm_material} material The fragment's material.
  2699. *
  2700. * @returns {vec4} The computed color.
  2701. *
  2702. * @example
  2703. * vec3 positionToEyeEC = // ...
  2704. * czm_material material = // ...
  2705. * vec3 lightDirectionEC = // ...
  2706. * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);
  2707. *
  2708. * @see czm_getMaterial
  2709. */
  2710. vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
  2711. {
  2712. // Diffuse from directional light sources at eye (for top-down)
  2713. float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
  2714. if (czm_sceneMode == czm_sceneMode3D) {
  2715. // (and horizon views in 3D)
  2716. diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
  2717. }
  2718. float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
  2719. // Temporary workaround for adding ambient.
  2720. vec3 materialDiffuse = material.diffuse * 0.5;
  2721. vec3 ambient = materialDiffuse;
  2722. vec3 color = ambient + material.emission;
  2723. color += materialDiffuse * diffuse * czm_lightColor;
  2724. color += material.specular * specular * czm_lightColor;
  2725. return vec4(color, material.alpha);
  2726. }
  2727. vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
  2728. {
  2729. float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);
  2730. float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
  2731. vec3 ambient = vec3(0.0);
  2732. vec3 color = ambient + material.emission;
  2733. color += material.diffuse * diffuse * czm_lightColor;
  2734. color += material.specular * specular * czm_lightColor;
  2735. return vec4(color, material.alpha);
  2736. }
  2737. `;var GL=`/**
  2738. * Computes distance from a point to a plane.
  2739. *
  2740. * @name czm_planeDistance
  2741. * @glslFunction
  2742. *
  2743. * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js
  2744. * param {vec3} point A point in the same space as the plane.
  2745. * returns {float} The distance from the point to the plane.
  2746. */
  2747. float czm_planeDistance(vec4 plane, vec3 point) {
  2748. return (dot(plane.xyz, point) + plane.w);
  2749. }
  2750. /**
  2751. * Computes distance from a point to a plane.
  2752. *
  2753. * @name czm_planeDistance
  2754. * @glslFunction
  2755. *
  2756. * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js
  2757. * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js
  2758. * param {vec3} point A point in the same space as the plane.
  2759. * returns {float} The distance from the point to the plane.
  2760. */
  2761. float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
  2762. return (dot(planeNormal, point) + planeDistance);
  2763. }
  2764. `;var HL=`/**
  2765. * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero.
  2766. *
  2767. * @name czm_pointAlongRay
  2768. * @glslFunction
  2769. *
  2770. * @param {czm_ray} ray The ray to compute the point along.
  2771. * @param {float} time The time along the ray.
  2772. *
  2773. * @returns {vec3} The point along the ray at the given time.
  2774. *
  2775. * @example
  2776. * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction
  2777. * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)
  2778. */
  2779. vec3 czm_pointAlongRay(czm_ray ray, float time)
  2780. {
  2781. return ray.origin + (time * ray.direction);
  2782. }
  2783. `;var WL=`/**
  2784. * DOC_TBA
  2785. *
  2786. * @name czm_rayEllipsoidIntersectionInterval
  2787. * @glslFunction
  2788. */
  2789. czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
  2790. {
  2791. // ray and ellipsoid center in eye coordinates. radii in model coordinates.
  2792. vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;
  2793. vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;
  2794. q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;
  2795. float q2 = dot(q, q);
  2796. float qw = dot(q, w);
  2797. if (q2 > 1.0) // Outside ellipsoid.
  2798. {
  2799. if (qw >= 0.0) // Looking outward or tangent (0 intersections).
  2800. {
  2801. return czm_emptyRaySegment;
  2802. }
  2803. else // qw < 0.0.
  2804. {
  2805. float qw2 = qw * qw;
  2806. float difference = q2 - 1.0; // Positively valued.
  2807. float w2 = dot(w, w);
  2808. float product = w2 * difference;
  2809. if (qw2 < product) // Imaginary roots (0 intersections).
  2810. {
  2811. return czm_emptyRaySegment;
  2812. }
  2813. else if (qw2 > product) // Distinct roots (2 intersections).
  2814. {
  2815. float discriminant = qw * qw - product;
  2816. float temp = -qw + sqrt(discriminant); // Avoid cancellation.
  2817. float root0 = temp / w2;
  2818. float root1 = difference / temp;
  2819. if (root0 < root1)
  2820. {
  2821. czm_raySegment i = czm_raySegment(root0, root1);
  2822. return i;
  2823. }
  2824. else
  2825. {
  2826. czm_raySegment i = czm_raySegment(root1, root0);
  2827. return i;
  2828. }
  2829. }
  2830. else // qw2 == product. Repeated roots (2 intersections).
  2831. {
  2832. float root = sqrt(difference / w2);
  2833. czm_raySegment i = czm_raySegment(root, root);
  2834. return i;
  2835. }
  2836. }
  2837. }
  2838. else if (q2 < 1.0) // Inside ellipsoid (2 intersections).
  2839. {
  2840. float difference = q2 - 1.0; // Negatively valued.
  2841. float w2 = dot(w, w);
  2842. float product = w2 * difference; // Negatively valued.
  2843. float discriminant = qw * qw - product;
  2844. float temp = -qw + sqrt(discriminant); // Positively valued.
  2845. czm_raySegment i = czm_raySegment(0.0, temp / w2);
  2846. return i;
  2847. }
  2848. else // q2 == 1.0. On ellipsoid.
  2849. {
  2850. if (qw < 0.0) // Looking inward.
  2851. {
  2852. float w2 = dot(w, w);
  2853. czm_raySegment i = czm_raySegment(0.0, -qw / w2);
  2854. return i;
  2855. }
  2856. else // qw >= 0.0. Looking outward or tangent.
  2857. {
  2858. return czm_emptyRaySegment;
  2859. }
  2860. }
  2861. }
  2862. `;var qL=`/**
  2863. * Compute the intersection interval of a ray with a sphere.
  2864. *
  2865. * @name czm_raySphereIntersectionInterval
  2866. * @glslFunction
  2867. *
  2868. * @param {czm_ray} ray The ray.
  2869. * @param {vec3} center The center of the sphere.
  2870. * @param {float} radius The radius of the sphere.
  2871. * @return {czm_raySegment} The intersection interval of the ray with the sphere.
  2872. */
  2873. czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)
  2874. {
  2875. vec3 o = ray.origin;
  2876. vec3 d = ray.direction;
  2877. vec3 oc = o - center;
  2878. float a = dot(d, d);
  2879. float b = 2.0 * dot(d, oc);
  2880. float c = dot(oc, oc) - (radius * radius);
  2881. float det = (b * b) - (4.0 * a * c);
  2882. if (det < 0.0) {
  2883. return czm_emptyRaySegment;
  2884. }
  2885. float sqrtDet = sqrt(det);
  2886. float t0 = (-b - sqrtDet) / (2.0 * a);
  2887. float t1 = (-b + sqrtDet) / (2.0 * a);
  2888. czm_raySegment result = czm_raySegment(t0, t1);
  2889. return result;
  2890. }
  2891. `;var YL=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
  2892. {
  2893. return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
  2894. }
  2895. `;var XL=`/**
  2896. * Reads a value previously transformed with {@link czm_writeNonPerspective}
  2897. * by dividing it by \`w\`, the value used in the perspective divide.
  2898. * This function is intended to be called in a fragment shader to access a
  2899. * \`varying\` that should not be subject to perspective interpolation.
  2900. * For example, screen-space texture coordinates. The value should have been
  2901. * previously written in the vertex shader with a call to
  2902. * {@link czm_writeNonPerspective}.
  2903. *
  2904. * @name czm_readNonPerspective
  2905. * @glslFunction
  2906. *
  2907. * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.
  2908. * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`.
  2909. * @returns {float|vec2|vec3|vec4} The usable value.
  2910. */
  2911. float czm_readNonPerspective(float value, float oneOverW) {
  2912. return value * oneOverW;
  2913. }
  2914. vec2 czm_readNonPerspective(vec2 value, float oneOverW) {
  2915. return value * oneOverW;
  2916. }
  2917. vec3 czm_readNonPerspective(vec3 value, float oneOverW) {
  2918. return value * oneOverW;
  2919. }
  2920. vec4 czm_readNonPerspective(vec4 value, float oneOverW) {
  2921. return value * oneOverW;
  2922. }
  2923. `;var KL=`float czm_reverseLogDepth(float logZ)
  2924. {
  2925. #ifdef LOG_DEPTH
  2926. float near = czm_currentFrustum.x;
  2927. float far = czm_currentFrustum.y;
  2928. float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;
  2929. float depthFromNear = exp2(log2Depth) - 1.0;
  2930. return far * (1.0 - near / (depthFromNear + near)) / (far - near);
  2931. #endif
  2932. return logZ;
  2933. }
  2934. `;var QL=`/**
  2935. * Round a floating point value. This function exists because round() doesn't
  2936. * exist in GLSL 1.00.
  2937. *
  2938. * @param {float|vec2|vec3|vec4} value The value to round
  2939. * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.
  2940. */
  2941. float czm_round(float value) {
  2942. return floor(value + 0.5);
  2943. }
  2944. vec2 czm_round(vec2 value) {
  2945. return floor(value + 0.5);
  2946. }
  2947. vec3 czm_round(vec3 value) {
  2948. return floor(value + 0.5);
  2949. }
  2950. vec4 czm_round(vec4 value) {
  2951. return floor(value + 0.5);
  2952. }
  2953. `;var $L=`/**
  2954. * Adjusts the saturation of a color.
  2955. *
  2956. * @name czm_saturation
  2957. * @glslFunction
  2958. *
  2959. * @param {vec3} rgb The color.
  2960. * @param {float} adjustment The amount to adjust the saturation of the color.
  2961. *
  2962. * @returns {float} The color with the saturation adjusted.
  2963. *
  2964. * @example
  2965. * vec3 greyScale = czm_saturation(color, 0.0);
  2966. * vec3 doubleSaturation = czm_saturation(color, 2.0);
  2967. */
  2968. vec3 czm_saturation(vec3 rgb, float adjustment)
  2969. {
  2970. // Algorithm from Chapter 16 of OpenGL Shading Language
  2971. const vec3 W = vec3(0.2125, 0.7154, 0.0721);
  2972. vec3 intensity = vec3(dot(rgb, W));
  2973. return mix(intensity, rgb, adjustment);
  2974. }
  2975. `;var JL=`
  2976. float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)
  2977. {
  2978. return czm_unpackDepth(czm_textureCube(shadowMap, d));
  2979. }
  2980. float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)
  2981. {
  2982. #ifdef USE_SHADOW_DEPTH_TEXTURE
  2983. return texture(shadowMap, uv).r;
  2984. #else
  2985. return czm_unpackDepth(texture(shadowMap, uv));
  2986. #endif
  2987. }
  2988. float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
  2989. {
  2990. return step(depth, czm_sampleShadowMap(shadowMap, uv));
  2991. }
  2992. float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
  2993. {
  2994. return step(depth, czm_sampleShadowMap(shadowMap, uv));
  2995. }
  2996. `;var ZL=`
  2997. float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)
  2998. {
  2999. #ifdef USE_NORMAL_SHADING
  3000. #ifdef USE_NORMAL_SHADING_SMOOTH
  3001. float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);
  3002. #else
  3003. float strength = step(0.0, nDotL);
  3004. #endif
  3005. visibility *= strength;
  3006. #endif
  3007. visibility = max(visibility, darkness);
  3008. return visibility;
  3009. }
  3010. #ifdef USE_CUBE_MAP_SHADOW
  3011. float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)
  3012. {
  3013. float depthBias = shadowParameters.depthBias;
  3014. float depth = shadowParameters.depth;
  3015. float nDotL = shadowParameters.nDotL;
  3016. float normalShadingSmooth = shadowParameters.normalShadingSmooth;
  3017. float darkness = shadowParameters.darkness;
  3018. vec3 uvw = shadowParameters.texCoords;
  3019. depth -= depthBias;
  3020. float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);
  3021. return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
  3022. }
  3023. #else
  3024. float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)
  3025. {
  3026. float depthBias = shadowParameters.depthBias;
  3027. float depth = shadowParameters.depth;
  3028. float nDotL = shadowParameters.nDotL;
  3029. float normalShadingSmooth = shadowParameters.normalShadingSmooth;
  3030. float darkness = shadowParameters.darkness;
  3031. vec2 uv = shadowParameters.texCoords;
  3032. depth -= depthBias;
  3033. #ifdef USE_SOFT_SHADOWS
  3034. vec2 texelStepSize = shadowParameters.texelStepSize;
  3035. float radius = 1.0;
  3036. float dx0 = -texelStepSize.x * radius;
  3037. float dy0 = -texelStepSize.y * radius;
  3038. float dx1 = texelStepSize.x * radius;
  3039. float dy1 = texelStepSize.y * radius;
  3040. float visibility = (
  3041. czm_shadowDepthCompare(shadowMap, uv, depth) +
  3042. czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +
  3043. czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +
  3044. czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +
  3045. czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +
  3046. czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +
  3047. czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +
  3048. czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +
  3049. czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)
  3050. ) * (1.0 / 9.0);
  3051. #else
  3052. float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);
  3053. #endif
  3054. return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
  3055. }
  3056. #endif
  3057. `;var eN=`/**
  3058. * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL
  3059. * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.
  3060. *
  3061. * @name czm_signNotZero
  3062. * @glslFunction
  3063. *
  3064. * @param {} value The value for which to determine the sign.
  3065. * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.
  3066. */
  3067. float czm_signNotZero(float value)
  3068. {
  3069. return value >= 0.0 ? 1.0 : -1.0;
  3070. }
  3071. vec2 czm_signNotZero(vec2 value)
  3072. {
  3073. return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));
  3074. }
  3075. vec3 czm_signNotZero(vec3 value)
  3076. {
  3077. return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));
  3078. }
  3079. vec4 czm_signNotZero(vec4 value)
  3080. {
  3081. return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));
  3082. }
  3083. `;var tN=`/**
  3084. * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.
  3085. * <p>
  3086. * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].
  3087. * </p>
  3088. *
  3089. * @name czm_sphericalHarmonics
  3090. * @glslFunction
  3091. *
  3092. * @param {vec3} normal The normalized direction.
  3093. * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.
  3094. * @returns {vec3} The color at the direction.
  3095. *
  3096. * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf
  3097. */
  3098. vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])
  3099. {
  3100. vec3 L00 = coefficients[0];
  3101. vec3 L1_1 = coefficients[1];
  3102. vec3 L10 = coefficients[2];
  3103. vec3 L11 = coefficients[3];
  3104. vec3 L2_2 = coefficients[4];
  3105. vec3 L2_1 = coefficients[5];
  3106. vec3 L20 = coefficients[6];
  3107. vec3 L21 = coefficients[7];
  3108. vec3 L22 = coefficients[8];
  3109. float x = normal.x;
  3110. float y = normal.y;
  3111. float z = normal.z;
  3112. vec3 L =
  3113. L00
  3114. + L1_1 * y
  3115. + L10 * z
  3116. + L11 * x
  3117. + L2_2 * (y * x)
  3118. + L2_1 * (y * z)
  3119. + L20 * (3.0 * z * z - 1.0)
  3120. + L21 * (z * x)
  3121. + L22 * (x * x - y * y);
  3122. return max(L, vec3(0.0));
  3123. }
  3124. `;var nN=`/**
  3125. * Converts an sRGB color to a linear RGB color.
  3126. *
  3127. * @param {vec3|vec4} srgbIn The color in sRGB space
  3128. * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.
  3129. */
  3130. vec3 czm_srgbToLinear(vec3 srgbIn)
  3131. {
  3132. return pow(srgbIn, vec3(2.2));
  3133. }
  3134. vec4 czm_srgbToLinear(vec4 srgbIn)
  3135. {
  3136. vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
  3137. return vec4(linearOut, srgbIn.a);
  3138. }
  3139. `;var iN=`/**
  3140. * Creates a matrix that transforms vectors from tangent space to eye space.
  3141. *
  3142. * @name czm_tangentToEyeSpaceMatrix
  3143. * @glslFunction
  3144. *
  3145. * @param {vec3} normalEC The normal vector in eye coordinates.
  3146. * @param {vec3} tangentEC The tangent vector in eye coordinates.
  3147. * @param {vec3} bitangentEC The bitangent vector in eye coordinates.
  3148. *
  3149. * @returns {mat3} The matrix that transforms from tangent space to eye space.
  3150. *
  3151. * @example
  3152. * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);
  3153. * vec3 normal = tangentToEye * texture(normalMap, st).xyz;
  3154. */
  3155. mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)
  3156. {
  3157. vec3 normal = normalize(normalEC);
  3158. vec3 tangent = normalize(tangentEC);
  3159. vec3 bitangent = normalize(bitangentEC);
  3160. return mat3(tangent.x , tangent.y , tangent.z,
  3161. bitangent.x, bitangent.y, bitangent.z,
  3162. normal.x , normal.y , normal.z);
  3163. }
  3164. `;var oN=`/**
  3165. * A wrapper around the texture (WebGL2) / textureCube (WebGL1)
  3166. * function to allow for WebGL 1 support.
  3167. *
  3168. * @name czm_textureCube
  3169. * @glslFunction
  3170. *
  3171. * @param {samplerCube} sampler The sampler.
  3172. * @param {vec3} p The coordinate at which to sample the texture.
  3173. */
  3174. vec4 czm_textureCube(samplerCube sampler, vec3 p) {
  3175. #if __VERSION__ == 300
  3176. return texture(sampler, p);
  3177. #else
  3178. return textureCube(sampler, p);
  3179. #endif
  3180. }
  3181. /**
  3182. * A wrapper around the textureLod (WebGL2) / textureCube (WebGL1)
  3183. * function to allow for WebGL 1 support in fragment shaders.
  3184. *
  3185. * @name czm_textureCubeLod
  3186. * @glslFunction
  3187. *
  3188. * @param {samplerCube} sampler The sampler.
  3189. * @param {vec3} p The coordinate at which to sample the texture.
  3190. * @param {float} lod The mipmap level from which to sample.
  3191. */
  3192. vec4 czm_textureCube(samplerCube sampler, vec3 p, float lod) {
  3193. #if __VERSION__ == 300
  3194. return textureLod(sampler, p, lod);
  3195. #elif defined(GL_EXT_shader_texture_lod)
  3196. return textureCubeLodEXT(sampler, p, lod);
  3197. #endif
  3198. }`;var rN=`/**
  3199. * Transforms a plane.
  3200. *
  3201. * @name czm_transformPlane
  3202. * @glslFunction
  3203. *
  3204. * @param {vec4} plane The plane in Hessian Normal Form.
  3205. * @param {mat4} transform The inverse-transpose of a transformation matrix.
  3206. */
  3207. vec4 czm_transformPlane(vec4 plane, mat4 transform) {
  3208. vec4 transformedPlane = transform * plane;
  3209. // Convert the transformed plane to Hessian Normal Form
  3210. float normalMagnitude = length(transformedPlane.xyz);
  3211. return transformedPlane / normalMagnitude;
  3212. }
  3213. `;var aN=`/**
  3214. * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},
  3215. * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to
  3216. * be relative to the eye. As shown in the example, the position can then be transformed in eye
  3217. * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},
  3218. * respectively.
  3219. * <p>
  3220. * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as
  3221. * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
  3222. * </p>
  3223. *
  3224. * @name czm_translateRelativeToEye
  3225. * @glslFunction
  3226. *
  3227. * @param {vec3} high The position's high bits.
  3228. * @param {vec3} low The position's low bits.
  3229. * @returns {vec3} The position translated to be relative to the camera's position.
  3230. *
  3231. * @example
  3232. * in vec3 positionHigh;
  3233. * in vec3 positionLow;
  3234. *
  3235. * void main()
  3236. * {
  3237. * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  3238. * gl_Position = czm_modelViewProjectionRelativeToEye * p;
  3239. * }
  3240. *
  3241. * @see czm_modelViewRelativeToEye
  3242. * @see czm_modelViewProjectionRelativeToEye
  3243. * @see czm_computePosition
  3244. * @see EncodedCartesian3
  3245. */
  3246. vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
  3247. {
  3248. vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
  3249. // This check handles the case when NaN values have gotten into \`highDifference\`.
  3250. // Such a thing could happen on devices running iOS.
  3251. if (length(highDifference) == 0.0) {
  3252. highDifference = vec3(0);
  3253. }
  3254. vec3 lowDifference = low - czm_encodedCameraPositionMCLow;
  3255. return vec4(highDifference + lowDifference, 1.0);
  3256. }
  3257. `;var sN=`/**
  3258. * @private
  3259. */
  3260. vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
  3261. {
  3262. // Diffuse from directional light sources at eye (for top-down and horizon views)
  3263. float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);
  3264. if (czm_sceneMode == czm_sceneMode3D) {
  3265. // (and horizon views in 3D)
  3266. diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
  3267. }
  3268. diffuse = clamp(diffuse, 0.0, 1.0);
  3269. float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);
  3270. // Temporary workaround for adding ambient.
  3271. vec3 materialDiffuse = material.diffuse * 0.5;
  3272. vec3 ambient = materialDiffuse;
  3273. vec3 color = ambient + material.emission;
  3274. color += materialDiffuse * diffuse * czm_lightColor;
  3275. color += material.specular * specular * czm_lightColor;
  3276. return vec4(color, material.alpha);
  3277. }
  3278. `;var cN=`/**
  3279. * Returns the transpose of the matrix. The input <code>matrix</code> can be
  3280. * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.
  3281. *
  3282. * @name czm_transpose
  3283. * @glslFunction
  3284. *
  3285. * @param {} matrix The matrix to transpose.
  3286. *
  3287. * @returns {} The transposed matrix.
  3288. *
  3289. * @example
  3290. * // GLSL declarations
  3291. * mat2 czm_transpose(mat2 matrix);
  3292. * mat3 czm_transpose(mat3 matrix);
  3293. * mat4 czm_transpose(mat4 matrix);
  3294. *
  3295. * // Transpose a 3x3 rotation matrix to find its inverse.
  3296. * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(
  3297. * positionMC, normalEC);
  3298. * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);
  3299. */
  3300. mat2 czm_transpose(mat2 matrix)
  3301. {
  3302. return mat2(
  3303. matrix[0][0], matrix[1][0],
  3304. matrix[0][1], matrix[1][1]);
  3305. }
  3306. mat3 czm_transpose(mat3 matrix)
  3307. {
  3308. return mat3(
  3309. matrix[0][0], matrix[1][0], matrix[2][0],
  3310. matrix[0][1], matrix[1][1], matrix[2][1],
  3311. matrix[0][2], matrix[1][2], matrix[2][2]);
  3312. }
  3313. mat4 czm_transpose(mat4 matrix)
  3314. {
  3315. return mat4(
  3316. matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],
  3317. matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],
  3318. matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],
  3319. matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);
  3320. }
  3321. `;var lN=`vec2 getLookupUv(vec2 dimensions, int i) {
  3322. int pixY = i / int(dimensions.x);
  3323. int pixX = i - (pixY * int(dimensions.x));
  3324. float pixelWidth = 1.0 / dimensions.x;
  3325. float pixelHeight = 1.0 / dimensions.y;
  3326. float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
  3327. float v = (float(pixY) + 0.5) * pixelHeight;
  3328. return vec2(u, v);
  3329. }
  3330. vec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) {
  3331. vec2 textureDimensions = vec2(textureSize(extentsTexture, 0));
  3332. return texture(extentsTexture, getLookupUv(textureDimensions, index));
  3333. }`;var uN=`/**
  3334. * Unpacks a vec4 depth value to a float in [0, 1) range.
  3335. *
  3336. * @name czm_unpackDepth
  3337. * @glslFunction
  3338. *
  3339. * @param {vec4} packedDepth The packed depth.
  3340. *
  3341. * @returns {float} The floating-point depth in [0, 1) range.
  3342. */
  3343. float czm_unpackDepth(vec4 packedDepth)
  3344. {
  3345. // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
  3346. // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
  3347. return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
  3348. }
  3349. `;var fN=`/**
  3350. * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.
  3351. *
  3352. * @name czm_unpackFloat
  3353. * @glslFunction
  3354. *
  3355. * @param {vec4} packedFloat The packed float.
  3356. *
  3357. * @returns {float} The floating-point depth in arbitrary range.
  3358. */
  3359. float czm_unpackFloat(vec4 packedFloat)
  3360. {
  3361. // Convert to [0.0, 255.0] and round to integer
  3362. packedFloat = floor(packedFloat * 255.0 + 0.5);
  3363. float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;
  3364. float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;
  3365. if (exponent == -127.0)
  3366. {
  3367. return 0.0;
  3368. }
  3369. float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);
  3370. float result = sign * exp2(exponent - 23.0) * mantissa;
  3371. return result;
  3372. }
  3373. `;var dN=`/**
  3374. * Useful for reinterpreting texture data as higher-precision values.
  3375. * Only works correctly in WebGL 2, which supports the uint type and bitwise operations.
  3376. *
  3377. * @param {float|vec2|vec3|vec4} 1-4 values from a texture lookup (RGBA channels), normalized to [0.0, 1.0].
  3378. * @return {uint} Raw bits as an unsigned integer.
  3379. */
  3380. uint czm_unpackTexture(float packedValue) {
  3381. float rounded = czm_round(packedValue * 255.0);
  3382. return uint(rounded);
  3383. }
  3384. uint czm_unpackTexture(vec2 packedValue) {
  3385. vec2 rounded = czm_round(packedValue * 255.0);
  3386. uint byte0 = uint(rounded.x);
  3387. uint byte1 = uint(rounded.y);
  3388. return byte0 | (byte1 << 8);
  3389. }
  3390. uint czm_unpackTexture(vec3 packedValue) {
  3391. vec3 rounded = czm_round(packedValue * 255.0);
  3392. uint byte0 = uint(rounded.x);
  3393. uint byte1 = uint(rounded.y);
  3394. uint byte2 = uint(rounded.z);
  3395. return byte0 | (byte1 << 8) | (byte2 << 16);
  3396. }
  3397. uint czm_unpackTexture(vec4 packedValue) {
  3398. vec4 rounded = czm_round(packedValue * 255.0);
  3399. uint byte0 = uint(rounded.x);
  3400. uint byte1 = uint(rounded.y);
  3401. uint byte2 = uint(rounded.z);
  3402. uint byte3 = uint(rounded.w);
  3403. return byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24);
  3404. }
  3405. `;var hN=`/**
  3406. * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,
  3407. * so the return value is an int.
  3408. * <p>
  3409. * There are also precision limitations in WebGL 1. highp int is still limited
  3410. * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.
  3411. * </p>
  3412. *
  3413. * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.
  3414. *
  3415. * @return {int} The unpacked value.
  3416. */
  3417. int czm_unpackUint(float packedValue) {
  3418. float rounded = czm_round(packedValue * 255.0);
  3419. return int(rounded);
  3420. }
  3421. int czm_unpackUint(vec2 packedValue) {
  3422. vec2 rounded = czm_round(packedValue * 255.0);
  3423. return int(dot(rounded, vec2(1.0, 256.0)));
  3424. }
  3425. int czm_unpackUint(vec3 packedValue) {
  3426. vec3 rounded = czm_round(packedValue * 255.0);
  3427. return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));
  3428. }
  3429. int czm_unpackUint(vec4 packedValue) {
  3430. vec4 rounded = czm_round(packedValue * 255.0);
  3431. return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));
  3432. }
  3433. `;var mN=`/**
  3434. * Transform metadata values following the EXT_structural_metadata spec
  3435. * by multiplying by scale and adding the offset. Operations are always
  3436. * performed component-wise, even for matrices.
  3437. *
  3438. * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add
  3439. * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply
  3440. * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.
  3441. *
  3442. * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.
  3443. */
  3444. float czm_valueTransform(float offset, float scale, float value) {
  3445. return scale * value + offset;
  3446. }
  3447. vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {
  3448. return scale * value + offset;
  3449. }
  3450. vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {
  3451. return scale * value + offset;
  3452. }
  3453. vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {
  3454. return scale * value + offset;
  3455. }
  3456. mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {
  3457. return matrixCompMult(scale, value) + offset;
  3458. }
  3459. mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {
  3460. return matrixCompMult(scale, value) + offset;
  3461. }
  3462. mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {
  3463. return matrixCompMult(scale, value) + offset;
  3464. }
  3465. `;var pN=`#ifdef LOG_DEPTH
  3466. // 1.0 at the near plane, increasing linearly from there.
  3467. out float v_depthFromNearPlusOne;
  3468. #ifdef SHADOW_MAP
  3469. out vec3 v_logPositionEC;
  3470. #endif
  3471. #endif
  3472. vec4 czm_updatePositionDepth(vec4 coords) {
  3473. #if defined(LOG_DEPTH)
  3474. #ifdef SHADOW_MAP
  3475. vec3 logPositionEC = (czm_inverseProjection * coords).xyz;
  3476. v_logPositionEC = logPositionEC;
  3477. #endif
  3478. // With the very high far/near ratios used with the logarithmic depth
  3479. // buffer, floating point rounding errors can cause linear depth values
  3480. // to end up on the wrong side of the far plane, even for vertices that
  3481. // are really nowhere near it. Since we always write a correct logarithmic
  3482. // depth value in the fragment shader anyway, we just need to make sure
  3483. // such errors don't cause the primitive to be clipped entirely before
  3484. // we even get to the fragment shader.
  3485. coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
  3486. #endif
  3487. return coords;
  3488. }
  3489. /**
  3490. * Writes the logarithmic depth to gl_Position using the already computed gl_Position.
  3491. *
  3492. * @name czm_vertexLogDepth
  3493. * @glslFunction
  3494. */
  3495. void czm_vertexLogDepth()
  3496. {
  3497. #ifdef LOG_DEPTH
  3498. v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
  3499. gl_Position = czm_updatePositionDepth(gl_Position);
  3500. #endif
  3501. }
  3502. /**
  3503. * Writes the logarithmic depth to gl_Position using the provided clip coordinates.
  3504. * <p>
  3505. * An example use case for this function would be moving the vertex in window coordinates
  3506. * before converting back to clip coordinates. Use the original vertex clip coordinates.
  3507. * </p>
  3508. * @name czm_vertexLogDepth
  3509. * @glslFunction
  3510. *
  3511. * @param {vec4} clipCoords The vertex in clip coordinates.
  3512. *
  3513. * @example
  3514. * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));
  3515. */
  3516. void czm_vertexLogDepth(vec4 clipCoords)
  3517. {
  3518. #ifdef LOG_DEPTH
  3519. v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
  3520. czm_updatePositionDepth(clipCoords);
  3521. #endif
  3522. }
  3523. `;var gN=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
  3524. {
  3525. // Reconstruct NDC coordinates
  3526. float x = 2.0 * screenCoordinate.x - 1.0;
  3527. float y = 2.0 * screenCoordinate.y - 1.0;
  3528. float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
  3529. vec4 q = vec4(x, y, z, 1.0);
  3530. // Reverse the perspective division to obtain clip coordinates.
  3531. q /= screenCoordinate.w;
  3532. // Reverse the projection transformation to obtain eye coordinates.
  3533. if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s
  3534. {
  3535. q = czm_inverseProjection * q;
  3536. }
  3537. else
  3538. {
  3539. float top = czm_frustumPlanes.x;
  3540. float bottom = czm_frustumPlanes.y;
  3541. float left = czm_frustumPlanes.z;
  3542. float right = czm_frustumPlanes.w;
  3543. float near = czm_currentFrustum.x;
  3544. float far = czm_currentFrustum.y;
  3545. q.x = (q.x * (right - left) + left + right) * 0.5;
  3546. q.y = (q.y * (top - bottom) + bottom + top) * 0.5;
  3547. q.z = (q.z * (near - far) - near - far) * 0.5;
  3548. q.w = 1.0;
  3549. }
  3550. return q;
  3551. }
  3552. /**
  3553. * Transforms a position from window to eye coordinates.
  3554. * The transform from window to normalized device coordinates is done using components
  3555. * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating
  3556. * the inverse of <code>czm_viewportTransformation</code>. The transformation from
  3557. * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,
  3558. * which is expected to be the scalar used in the perspective divide. The transformation
  3559. * from clip to eye coordinates is done using {@link czm_inverseProjection}.
  3560. *
  3561. * @name czm_windowToEyeCoordinates
  3562. * @glslFunction
  3563. *
  3564. * @param {vec4} fragmentCoordinate The position in window coordinates to transform.
  3565. *
  3566. * @returns {vec4} The transformed position in eye coordinates.
  3567. *
  3568. * @see czm_modelToWindowCoordinates
  3569. * @see czm_eyeToWindowCoordinates
  3570. * @see czm_inverseProjection
  3571. * @see czm_viewport
  3572. * @see czm_viewportTransformation
  3573. *
  3574. * @example
  3575. * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);
  3576. */
  3577. vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)
  3578. {
  3579. vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;
  3580. return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));
  3581. }
  3582. vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)
  3583. {
  3584. // See reverseLogDepth.glsl. This is separate to re-use the pow.
  3585. #if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)
  3586. float near = czm_currentFrustum.x;
  3587. float far = czm_currentFrustum.y;
  3588. float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;
  3589. float depthFromNear = exp2(log2Depth) - 1.0;
  3590. float depthFromCamera = depthFromNear + near;
  3591. vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);
  3592. vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
  3593. eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision
  3594. #else
  3595. vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
  3596. vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
  3597. #endif
  3598. return eyeCoordinate;
  3599. }
  3600. /**
  3601. * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.
  3602. * This function produces more accurate results for window positions with log depth than
  3603. * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version
  3604. * of czm_windowToEyeCoordinates.
  3605. *
  3606. * @name czm_windowToEyeCoordinates
  3607. * @glslFunction
  3608. *
  3609. * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.
  3610. * @param {float} depthOrLogDepth A depth or log depth for the fragment.
  3611. *
  3612. * @see czm_modelToWindowCoordinates
  3613. * @see czm_eyeToWindowCoordinates
  3614. * @see czm_inverseProjection
  3615. * @see czm_viewport
  3616. * @see czm_viewportTransformation
  3617. *
  3618. * @returns {vec4} The transformed position in eye coordinates.
  3619. */
  3620. vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
  3621. {
  3622. vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
  3623. return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
  3624. }
  3625. `;var _N=`// emulated noperspective
  3626. #if !defined(LOG_DEPTH)
  3627. in float v_WindowZ;
  3628. #endif
  3629. /**
  3630. * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane
  3631. * by writing the fragment's depth. See czm_depthClamp for more details.
  3632. *
  3633. * @name czm_writeDepthClamp
  3634. * @glslFunction
  3635. *
  3636. * @example
  3637. * out_FragColor = color;
  3638. * czm_writeDepthClamp();
  3639. *
  3640. * @see czm_depthClamp
  3641. */
  3642. void czm_writeDepthClamp()
  3643. {
  3644. #if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
  3645. gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);
  3646. #endif
  3647. }
  3648. `;var AN=`#ifdef LOG_DEPTH
  3649. in float v_depthFromNearPlusOne;
  3650. #ifdef POLYGON_OFFSET
  3651. uniform vec2 u_polygonOffset;
  3652. #endif
  3653. #endif
  3654. /**
  3655. * Writes the fragment depth to the logarithmic depth buffer.
  3656. * <p>
  3657. * Use this when the vertex shader does not call {@link czm_vertexLogDepth}, for example, when
  3658. * ray-casting geometry using a full screen quad.
  3659. * </p>
  3660. * @name czm_writeLogDepth
  3661. * @glslFunction
  3662. *
  3663. * @param {float} depth The depth coordinate, where 1.0 is on the near plane and
  3664. * depth increases in eye-space units from there
  3665. *
  3666. * @example
  3667. * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);
  3668. */
  3669. void czm_writeLogDepth(float depth)
  3670. {
  3671. #if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
  3672. // Discard the vertex if it's not between the near and far planes.
  3673. // We allow a bit of epsilon on the near plane comparison because a 1.0
  3674. // from the vertex shader (indicating the vertex should be _on_ the near
  3675. // plane) will not necessarily come here as exactly 1.0.
  3676. if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
  3677. discard;
  3678. }
  3679. #ifdef POLYGON_OFFSET
  3680. // Polygon offset: m * factor + r * units
  3681. float factor = u_polygonOffset[0];
  3682. float units = u_polygonOffset[1];
  3683. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  3684. // This factor doesn't work in IE 10
  3685. if (factor != 0.0) {
  3686. // m = sqrt(dZdX^2 + dZdY^2);
  3687. float x = dFdx(depth);
  3688. float y = dFdy(depth);
  3689. float m = sqrt(x * x + y * y);
  3690. // Apply the factor before computing the log depth.
  3691. depth += m * factor;
  3692. }
  3693. #endif
  3694. #endif
  3695. gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;
  3696. #ifdef POLYGON_OFFSET
  3697. // Apply the units after the log depth.
  3698. gl_FragDepth += czm_epsilon7 * units;
  3699. #endif
  3700. #endif
  3701. }
  3702. /**
  3703. * Writes the fragment depth to the logarithmic depth buffer.
  3704. * <p>
  3705. * Use this when the vertex shader calls {@link czm_vertexLogDepth}.
  3706. * </p>
  3707. *
  3708. * @name czm_writeLogDepth
  3709. * @glslFunction
  3710. */
  3711. void czm_writeLogDepth() {
  3712. #ifdef LOG_DEPTH
  3713. czm_writeLogDepth(v_depthFromNearPlusOne);
  3714. #endif
  3715. }
  3716. `;var yN=`/**
  3717. * Transforms a value for non-perspective interpolation by multiplying
  3718. * it by w, the value used in the perspective divide. This function is
  3719. * intended to be called in a vertex shader to compute the value of a
  3720. * \`varying\` that should not be subject to perspective interpolation.
  3721. * For example, screen-space texture coordinates. The fragment shader
  3722. * must call {@link czm_readNonPerspective} to retrieve the final
  3723. * non-perspective value.
  3724. *
  3725. * @name czm_writeNonPerspective
  3726. * @glslFunction
  3727. *
  3728. * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.
  3729. * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`.
  3730. * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the
  3731. * fragment shader with {@link czm_readNonPerspective}.
  3732. */
  3733. float czm_writeNonPerspective(float value, float w) {
  3734. return value * w;
  3735. }
  3736. vec2 czm_writeNonPerspective(vec2 value, float w) {
  3737. return value * w;
  3738. }
  3739. vec3 czm_writeNonPerspective(vec3 value, float w) {
  3740. return value * w;
  3741. }
  3742. vec4 czm_writeNonPerspective(vec4 value, float w) {
  3743. return value * w;
  3744. }
  3745. `;var XT={czm_degreesPerRadian:UM,czm_depthRange:VM,czm_epsilon1:jM,czm_epsilon2:GM,czm_epsilon3:HM,czm_epsilon4:WM,czm_epsilon5:qM,czm_epsilon6:YM,czm_epsilon7:XM,czm_infinity:KM,czm_oneOverPi:QM,czm_oneOverTwoPi:$M,czm_passCesium3DTile:JM,czm_passCesium3DTileClassification:ZM,czm_passCesium3DTileClassificationIgnoreShow:eB,czm_passCesium3DTileEdges:tB,czm_passCesium3DTileEdgesDirect:nB,czm_passClassification:iB,czm_passCompute:oB,czm_passEnvironment:rB,czm_passGaussianSplats:aB,czm_passGlobe:sB,czm_passOpaque:cB,czm_passOverlay:lB,czm_passTerrainClassification:uB,czm_passTranslucent:fB,czm_passVoxels:dB,czm_pi:hB,czm_piOverFour:mB,czm_piOverSix:pB,czm_piOverThree:gB,czm_piOverTwo:_B,czm_radiansPerDegree:AB,czm_sceneMode2D:yB,czm_sceneMode3D:xB,czm_sceneModeColumbusView:bB,czm_sceneModeMorphing:TB,czm_solarRadius:CB,czm_threePiOver2:EB,czm_twoPi:vB,czm_webMercatorMaxLatitude:SB,czm_depthRangeStruct:wB,czm_material:IB,czm_materialInput:DB,czm_modelMaterial:PB,czm_modelVertexOutput:RB,czm_ray:OB,czm_raySegment:MB,czm_shadowParameters:BB,czm_HSBToRGB:LB,czm_HSLToRGB:NB,czm_RGBToHSB:FB,czm_RGBToHSL:kB,czm_RGBToXYZ:zB,czm_XYZToRGB:UB,czm_acesTonemapping:VB,czm_alphaWeight:jB,czm_antialias:GB,czm_applyHSBShift:HB,czm_approximateSphericalCoordinates:WB,czm_approximateTanh:qB,czm_backFacing:YB,czm_branchFreeTernary:XB,czm_cascadeColor:KB,czm_cascadeDistance:QB,czm_cascadeMatrix:$B,czm_cascadeWeights:JB,czm_clipPolygons:ZB,czm_columbusViewMorph:eL,czm_computeAtmosphereColor:tL,czm_computeGroundAtmosphereScattering:nL,czm_computePosition:iL,czm_computeScattering:oL,czm_computeTextureTransform:rL,czm_cosineAndSine:aL,czm_decodeRGB8:sL,czm_decompressTextureCoordinates:cL,czm_depthClamp:lL,czm_eastNorthUpToEyeCoordinates:uL,czm_ellipsoidContainsPoint:fL,czm_ellipsoidTextureCoordinates:dL,czm_equalsEpsilon:hL,czm_eyeOffset:mL,czm_eyeToWindowCoordinates:pL,czm_fastApproximateAtan:gL,czm_fog:_L,czm_gammaCorrect:AL,czm_geodeticSurfaceNormal:yL,czm_getDefaultMaterial:xL,czm_getDynamicAtmosphereLightDirection:bL,czm_getLambertDiffuse:TL,czm_getSpecular:CL,czm_getWaterNoise:EL,czm_hue:vL,czm_inverseGamma:SL,czm_isEmpty:wL,czm_isFull:IL,czm_latitudeToWebMercatorFraction:DL,czm_lineDistance:PL,czm_linearToSrgb:RL,czm_luminance:OL,czm_maximumComponent:ML,czm_metersPerPixel:BL,czm_modelToWindowCoordinates:LL,czm_multiplyWithColorBalance:NL,czm_nearFarScalar:FL,czm_octDecode:kL,czm_packDepth:zL,czm_pbrLighting:UL,czm_pbrNeutralTonemapping:VL,czm_phong:jL,czm_planeDistance:GL,czm_pointAlongRay:HL,czm_rayEllipsoidIntersectionInterval:WL,czm_raySphereIntersectionInterval:qL,czm_readDepth:YL,czm_readNonPerspective:XL,czm_reverseLogDepth:KL,czm_round:QL,czm_saturation:$L,czm_shadowDepthCompare:JL,czm_shadowVisibility:ZL,czm_signNotZero:eN,czm_sphericalHarmonics:tN,czm_srgbToLinear:nN,czm_tangentToEyeSpaceMatrix:iN,czm_textureCube:oN,czm_transformPlane:rN,czm_translateRelativeToEye:aN,czm_translucentPhong:sN,czm_transpose:cN,czm_unpackClippingExtents:lN,czm_unpackDepth:uN,czm_unpackFloat:fN,czm_unpackTexture:dN,czm_unpackUint:hN,czm_valueTransform:mN,czm_vertexLogDepth:pN,czm_windowToEyeCoordinates:gN,czm_writeDepthClamp:_N,czm_writeLogDepth:AN,czm_writeNonPerspective:yN};function FFe(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,`
  3746. varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable
  3747. ${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
  3748. ${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod
  3749. #extension GL_EXT_shader_texture_lod : enable
  3750. #endif
  3751. ${n}`,n=`#ifdef GL_OES_standard_derivatives
  3752. #extension GL_OES_standard_derivatives : enable
  3753. #endif
  3754. ${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
  3755. ${n}`,n}var xN=FFe;function lae(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+=`
  3756. `;return i})}function uae(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=lae(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function fae(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&&Ts._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=uae(i,Ts._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),fae(o,t)}}))}function kFe(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 a=o.dependsOn[r],s=a.requiredBy.indexOf(o);a.requiredBy.splice(s,1),a.requiredBy.length===0&&t.push(a)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function zFe(e){let t=[],n=uae("main",e,t);fae(n,t),kFe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
  3757. `;return i.replace(n.glslSource,"")}function dae(e,t,n){let i="",o=e.sources;if(l(o))for(let g=0;g<o.length;++g)i+=`
  3758. #line 0
  3759. ${o[g]}`;i=lae(i);let r;i=i.replace(/#version\s+(.*?)\n/gm,function(g,m){return r=m,`
  3760. `});let a=[];i=i.replace(/#extension.*\n/gm,function(g){return a.push(g),`
  3761. `}),i=i.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let s=e.pickColorQualifier;l(s)&&(i=Ts.createPickFragmentShaderSource(i,s));let c="",u=a.length;for(let g=0;g<u;g++)c+=a[g];t&&(c+=`
  3762. #ifdef GL_FRAGMENT_PRECISION_HIGH
  3763. precision highp float;
  3764. precision highp int;
  3765. #else
  3766. precision mediump float;
  3767. precision mediump int;
  3768. #define highp mediump
  3769. #endif
  3770. `),n.webgl2&&(c+=`precision highp sampler3D;
  3771. `);let f=e.defines;if(l(f))for(let g=0,m=f.length;g<m;++g){let A=f[g];A.length!==0&&(c+=`#define ${A}
  3772. `)}n.textureFloatLinear&&(c+=`#define OES_texture_float_linear
  3773. `),n.floatingPointTexture&&(c+=`#define OES_texture_float
  3774. `);let d="";e.includeBuiltIns&&(d=zFe(i)),c+=`
  3775. #line 0
  3776. `;let p=d+i;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(p)&&!/czm_out_FragColor/g.test(p)&&/out_FragColor/g.test(p)&&(c+=`layout(location = 0) out vec4 out_FragColor;
  3777. `),c+=d,c+=i,n.webgl2?c=`#version 300 es
  3778. ${c}`:c=xN(c,t),c}function Ts(e){e=e??G.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=e.includeBuiltIns??!0}Ts.prototype.clone=function(){return new Ts({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Ts.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Ts.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(`
  3779. `);return`${t}:${n}:${i}:${o}`};Ts.prototype.createCombinedVertexShader=function(e){return dae(this,!1,e)};Ts.prototype.createCombinedFragmentShader=function(e){return dae(this,!0,e)};Ts._czmBuiltinsAndUniforms={};for(let e in XT)XT.hasOwnProperty(e)&&(Ts._czmBuiltinsAndUniforms[e]=XT[e]);for(let e in Gg)if(Gg.hasOwnProperty(e)){let t=Gg[e];typeof t.getDeclaration=="function"&&(Ts._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Ts.createPickVertexShaderSource=function(e){return`${Ts.replaceMain(e,"czm_old_main")}
  3780. in vec4 pickColor;
  3781. out vec4 czm_pickColor;
  3782. void main()
  3783. {
  3784. czm_old_main();
  3785. czm_pickColor = pickColor;
  3786. }`};Ts.createPickFragmentShaderSource=function(e,t){let n=Ts.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor;
  3787. void main()
  3788. {
  3789. czm_old_main();
  3790. if (out_FragColor.a == 0.0) {
  3791. discard;
  3792. }
  3793. out_FragColor = czm_pickColor;
  3794. }`;return`${n}
  3795. ${i}`};function UFe(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 hae(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 mae(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(hae(e,o))return o}}var VFe=["v_normalEC","v_normal"];Ts.findNormalVarying=function(e){return hae(e,"#ifdef HAS_NORMALS")?UFe(e,"HAS_NORMALS")?"v_normalEC":void 0:mae(e,VFe)};var jFe=["v_positionEC"];Ts.findPositionVarying=function(e){return mae(e,jFe)};var He=Ts;function sh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(sh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});sh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function GFe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}sh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new He({sources:[t]})),typeof n=="string"&&(n=new He({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),a=l(i)?GFe(i):"",s=`${o}:${r}:${a}`,c;if(l(this._shaders[s]))c=this._shaders[s],delete this._shadersToRelease[s];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:s,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[s]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};sh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){RW(this,r);let a=i.derivedKeywords.indexOf(t);a>-1&&i.derivedKeywords.splice(a,1)}return this.createDerivedShaderProgram(e,t,n)};sh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};sh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,a=n.fragmentShaderSource,s=n.attributeLocations;typeof r=="string"&&(r=new He({sources:[r]})),typeof a=="string"&&(a=new He({sources:[a]}));let c=this._context,u=r.createCombinedVertexShader(c),f=a.createCombinedFragmentShader(c),d=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:a,fragmentShaderText:f,attributeLocations:s}),p={cache:this,shaderProgram:d,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[o]=p,d};function RW(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,a=e._shaders[r];RW(e,a)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}sh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];RW(this,n),--this._numberOfShaders}this._shadersToRelease={}};sh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};sh.prototype.isDestroyed=function(){return!1};sh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return fe(this)};var bN=sh;function ch(e){e=e??G.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Xe.RGBA,pixelDatatype:o=je.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:a=!1,sampler:s=new jt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===Xe.RGB||i===Xe.LUMINANCE,d=Xe.toInternalFormat(i,o,t),p=Xe.isCompressedFormat(d),g=t._gl,m=p?Xe.compressedTextureSizeInBytes(i,c,u):Xe.textureSizeInBytes(i,o,c,u);this._id=e.id??Hn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._dimensions=new z(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=s,Aae(this,s),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(a?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?Xe.isCompressedFormat(d)?HFe(this,n):pae(this,n):l(n.framebuffer)?qFe(this,n):gae(this,n),this._initialized=!0):_ae(this),g.bindTexture(this._textureTarget,null)}function HFe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:a,height:s}=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,a,s,0,t.arrayBufferView),l(t.mipLevels)){let c=a,u=s;for(let f=0;f<t.mipLevels.length;++f)c=TN(c),u=TN(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function pae(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:a,height:s,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=Xe.alignmentInBytes(c,u,a);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=Xe.flipY(p,c,u,a,s)),i.texImage2D(o,0,r,a,s,0,c,je.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=a,m=s;for(let A=0;A<t.mipLevels.length;++A)g=TN(g),m=TN(m),i.texImage2D(o,A+1,r,g,m,0,c,je.toWebGLConstant(u,n),t.mipLevels[A])}}function WFe(e,t,n,i,o,r){let a=e._context,s=a._gl,{pixelFormat:c,pixelDatatype:u}=e,f=Xe.alignmentInBytes(c,u,o);s.pixelStorei(s.UNPACK_ALIGNMENT,f),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=Xe.flipY(t,c,u,o,r)),s.texSubImage2D(e._textureTarget,0,n,i,o,r,c,je.toWebGLConstant(u,a),t)}function qFe(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 gae(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,je.toWebGLConstant(e.pixelDatatype,n),t)}function YFe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,je.toWebGLConstant(e.pixelDatatype,o),t)}function TN(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function _ae(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,je.toWebGLConstant(e._pixelDatatype,t),null)}ch.create=function(e){return new ch(e)};ch.fromFramebuffer=function(e){e=e??G.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=Xe.RGB,framebufferXOffset:i=0,framebufferYOffset:o=0,width:r=t.drawingBufferWidth,height:a=t.drawingBufferHeight,framebuffer:s}=e;return new ch({context:t,width:r,height:a,pixelFormat:n,source:{framebuffer:l(s)?s:t.defaultFramebuffer,xOffset:i,yOffset:o,width:r,height:a}})};Object.defineProperties(ch.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Aae(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 Aae(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Vt.NEAREST_MIPMAP_NEAREST,Vt.NEAREST_MIPMAP_LINEAR,Vt.LINEAR_MIPMAP_NEAREST,Vt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,a=e._pixelFormat,s=e._pixelDatatype;(s===je.FLOAT&&!r.textureFloatLinear||s===je.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Vt.NEAREST_MIPMAP_NEAREST:Vt.NEAREST,i=ti.NEAREST),r.webgl2&&Xe.isDepthFormat(a)&&(n=Vt.NEAREST,i=ti.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}ch.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?pae(this,i):gae(this,i),f=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_ae(this)),this._initialized=!0),f||(l(i.arrayBufferView)?WFe(this,i.arrayBufferView,t,n,c,u):YFe(this,i,t,n)),a.bindTexture(s,null)};ch.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height;let a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(s,0,e,t,n,i,o,r),a.bindTexture(s,null),this._initialized=!0};ch.prototype.generateMipmap=function(e){e=e??rh.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)};ch.prototype.isDestroyed=function(){return!1};ch.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),fe(this)};var Dt=ch;function Uy(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Uy.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Uy.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Uy.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};Uy.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={}};Uy.prototype.isDestroyed=function(){return!1};Uy.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return fe(this)};var CN=Uy;function Gf(e){this.planes=e??[]}var Xw=[new h,new h,new h];h.clone(h.UNIT_X,Xw[0]);h.clone(h.UNIT_Y,Xw[1]);h.clone(h.UNIT_Z,Xw[2]);var Zg=new h,XFe=new h,yae=new tn(new h(1,0,0),0);Gf.fromBoundingSphere=function(e,t){l(t)||(t=new Gf);let n=Xw.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,a=0;for(let s=0;s<n;++s){let c=Xw[s],u=i[a],f=i[a+1];l(u)||(u=i[a]=new se),l(f)||(f=i[a+1]=new se),h.multiplyByScalar(c,-r,Zg),h.add(o,Zg,Zg),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,Zg),h.multiplyByScalar(c,r,Zg),h.add(o,Zg,Zg),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,XFe),Zg),a+=2}return t};Gf.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(tn.fromCartesian4(t[i],yae));if(r===qt.OUTSIDE)return qt.OUTSIDE;r===qt.INTERSECTING&&(n=!0)}return n?qt.INTERSECTING:qt.INSIDE};Gf.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Gf.MASK_OUTSIDE||t===Gf.MASK_INSIDE)return t;let n=Gf.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let a=o<31?1<<o:0;if(o<31&&(t&a)===0)continue;let s=e.intersectPlane(tn.fromCartesian4(i[o],yae));if(s===qt.OUTSIDE)return Gf.MASK_OUTSIDE;s===qt.INTERSECTING&&(n|=a)}return n};Gf.MASK_OUTSIDE=4294967295;Gf.MASK_INSIDE=0;Gf.MASK_INDETERMINATE=2147483647;var is=Gf;function Em(e){e=e??G.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new is,this._orthographicMatrix=new R}function xae(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=R.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Em.prototype,{projectionMatrix:{get:function(){return xae(this),this._orthographicMatrix}}});var KFe=new h,QFe=new h,$Fe=new h,OW=new h;Em.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,a=this.right,s=this.left,c=this.near,u=this.far,f=h.cross(t,n,KFe);h.normalize(f,f);let d=QFe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=$Fe;h.multiplyByScalar(f,s,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,a,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,OW),p),h.multiplyByScalar(n,r,p),h.add(d,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(d,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,OW),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,d),h.multiplyByScalar(t,u,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,OW),p),this._cullingVolume};Em.prototype.getPixelDimensions=function(e,t,n,i,o){xae(this);let r=this.right-this.left,a=this.top-this.bottom,s=i*r/e,c=i*a/t;return o.x=s,o.y=c,o};Em.prototype.clone=function(e){return l(e)||(e=new Em),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};Em.prototype.equals=function(e){return l(e)&&e instanceof Em&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Em.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Em&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var ga=Em;function Zl(e){e=e??G.EMPTY_OBJECT,this._offCenterFrustum=new ga,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}Zl.packedLength=4;Zl.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Zl.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Zl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function e_(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(Zl.prototype,{projectionMatrix:{get:function(){return e_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return e_(this),this._offCenterFrustum}}});Zl.prototype.computeCullingVolume=function(e,t,n){return e_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Zl.prototype.getPixelDimensions=function(e,t,n,i,o){return e_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Zl.prototype.clone=function(e){return l(e)||(e=new Zl),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};Zl.prototype.equals=function(e){return!l(e)||!(e instanceof Zl)?!1:(e_(this),e_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Zl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Zl)?!1:(e_(this),e_(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var fn=Zl;var MW={};function JFe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var ZFe=32.184,e2e=2451545;function zae(e,t){t=Q.addSeconds(e,ZFe,t);let n=Q.totalDays(t)-e2e;return t=Q.addSeconds(t,JFe(n),t),t}var EN=new Q(2451545,0,ei.TAI),t2e=1e3,Hf=D.RADIANS_PER_DEGREE,qu=D.RADIANS_PER_ARCSECOND,dc=14959787e4,bae=new $;function Uae(e,t,n,i,o,r,a){n<0&&(n=-n,o+=D.PI);let s=e*(1-t),c=i-o,u=o,f=i2e(r-i,t),d=n2e(t,0);c2e(c,n,u,bae);let p=s*(1+t),g=Math.cos(f),m=Math.sin(f),A=1+t*g,y=p/A;return l(a)?(a.x=y*g,a.y=y*m,a.z=0):a=new h(y*g,y*m,0),$.multiplyByVector(bae,a,a)}function n2e(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function i2e(e,t){let n=a2e(e,t);return s2e(n,t)}var o2e=50,r2e=D.EPSILON8;function a2e(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.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<o2e&&Math.abs(o-i)>r2e;++r){o=i;let a=o-t*Math.sin(o)-e,s=1-t*Math.cos(o);i=o-a/s}return o=i+n*D.TWO_PI,o}function s2e(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=D.zeroToTwoPi(r),e<0&&(r-=D.TWO_PI),r+=n*D.TWO_PI,r}function c2e(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),a=Math.cos(t),s=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*a,i[1]=u*o+c*r*a,i[2]=r*s,i[3]=-c*r-u*o*a,i[4]=-u*r+c*o*a,i[5]=o*s,i[6]=u*s,i[7]=-c*s,i[8]=a):i=new $(c*o-u*r*a,-c*r-u*o*a,u*s,u*o+c*r*a,-u*r+c*o*a,-c*s,r*s,o*s,a),i}var l2e=1.0000010178*dc,u2e=100.46645683*Hf,f2e=129597742283429e-5*qu,Tae=16002,Cae=21863,Eae=32004,vae=10931,Sae=14529,wae=16368,Iae=15318,Dae=32794,d2e=64*1e-7*dc,h2e=-152*1e-7*dc,m2e=62*1e-7*dc,p2e=-8*1e-7*dc,g2e=32*1e-7*dc,_2e=-41*1e-7*dc,A2e=19*1e-7*dc,y2e=-11*1e-7*dc,x2e=-150*1e-7*dc,b2e=-46*1e-7*dc,T2e=68*1e-7*dc,C2e=54*1e-7*dc,E2e=14*1e-7*dc,v2e=24*1e-7*dc,S2e=-28*1e-7*dc,w2e=22*1e-7*dc,Pae=10,Rae=16002,Oae=21863,Mae=10931,Bae=1473,Lae=32004,Nae=4387,Fae=73,I2e=-325*1e-7,D2e=-322*1e-7,P2e=-79*1e-7,R2e=232*1e-7,O2e=-52*1e-7,M2e=97*1e-7,B2e=55*1e-7,L2e=-41*1e-7,N2e=-105*1e-7,F2e=-137*1e-7,k2e=258*1e-7,z2e=35*1e-7,U2e=-116*1e-7,V2e=-88*1e-7,j2e=-112*1e-7,G2e=-80*1e-7,KT=new Q(0,0,ei.TAI);function H2e(e,t){zae(e,KT);let i=(KT.dayNumber-EN.dayNumber+(KT.secondsOfDay-EN.secondsOfDay)/oi.SECONDS_PER_DAY)/(oi.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=l2e+d2e*Math.cos(Tae*o)+x2e*Math.sin(Tae*o)+h2e*Math.cos(Cae*o)+b2e*Math.sin(Cae*o)+m2e*Math.cos(Eae*o)+T2e*Math.sin(Eae*o)+p2e*Math.cos(vae*o)+C2e*Math.sin(vae*o)+g2e*Math.cos(Sae*o)+E2e*Math.sin(Sae*o)+_2e*Math.cos(wae*o)+v2e*Math.sin(wae*o)+A2e*Math.cos(Iae*o)+S2e*Math.sin(Iae*o)+y2e*Math.cos(Dae*o)+w2e*Math.sin(Dae*o),a=u2e+f2e*i+I2e*Math.cos(Pae*o)+N2e*Math.sin(Pae*o)+D2e*Math.cos(Rae*o)+F2e*Math.sin(Rae*o)+P2e*Math.cos(Oae*o)+k2e*Math.sin(Oae*o)+R2e*Math.cos(Mae*o)+z2e*Math.sin(Mae*o)+O2e*Math.cos(Bae*o)+U2e*Math.sin(Bae*o)+M2e*Math.cos(Lae*o)+V2e*Math.sin(Lae*o)+B2e*Math.cos(Nae*o)+j2e*Math.sin(Nae*o)+L2e*Math.cos(Fae*o)+G2e*Math.sin(Fae*o),s=.0167086342-.0004203654*i,c=102.93734808*Hf+11612.3529*qu*i,u=469.97289*qu*i,f=174.87317577*Hf-8679.27034*qu*i;return Uae(r,s,u,c,f,a,t)}function Vae(e,t){zae(e,KT);let i=(KT.dayNumber-EN.dayNumber+(KT.secondsOfDay-EN.secondsOfDay)/oi.SECONDS_PER_DAY)/oi.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,a=r*i,s=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Hf,f=-8e-5*i+.02966*o-42e-6*r-13e-8*a,d=83.35324312*Hf,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*a,g=125.04455501*Hf,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*a,A=218.31664563*Hf,y=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*a,x=297.85019547*Hf+qu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*a),b=93.27209062*Hf+qu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*a),T=134.96340251*Hf+qu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*a),E=357.52910918*Hf+qu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*a),S=310.17137918*Hf-qu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*a),w=2*x,P=4*x,O=6*x,B=2*T,L=3*T,_=4*T,C=2*b;s+=3400.4*Math.cos(w)-635.6*Math.cos(w-T)-235.6*Math.cos(T)+218.1*Math.cos(w-E)+181*Math.cos(w+T),c+=.014216*Math.cos(w-T)+.008551*Math.cos(w-B)-.001383*Math.cos(T)+.001356*Math.cos(w+T)-.001147*Math.cos(P-L)-914e-6*Math.cos(P-B)+869e-6*Math.cos(w-E-T)-627e-6*Math.cos(w)-394e-6*Math.cos(P-_)+282e-6*Math.cos(w-E-B)-279e-6*Math.cos(x-T)-236e-6*Math.cos(B)+231e-6*Math.cos(P)+229e-6*Math.cos(O-_)-201e-6*Math.cos(B-C),f+=486.26*Math.cos(w-C)-40.13*Math.cos(w)+37.51*Math.cos(C)+25.73*Math.cos(B-C)+19.97*Math.cos(w-E-C),p+=-55609*Math.sin(w-T)-34711*Math.sin(w-B)-9792*Math.sin(T)+9385*Math.sin(P-L)+7505*Math.sin(P-B)+5318*Math.sin(w+T)+3484*Math.sin(P-_)-3417*Math.sin(w-E-T)-2530*Math.sin(O-_)-2376*Math.sin(w)-2075*Math.sin(w-L)-1883*Math.sin(B)-1736*Math.sin(O-5*T)+1626*Math.sin(E)-1370*Math.sin(O-L),m+=-5392*Math.sin(w-C)-540*Math.sin(E)-441*Math.sin(w)+423*Math.sin(C)-288*Math.sin(B-C),y+=-3332.9*Math.sin(w)+1197.4*Math.sin(w-T)-662.5*Math.sin(E)+396.3*Math.sin(T)-218*Math.sin(w-E);let v=2*S,I=3*S;f+=46.997*Math.cos(S)*i-.614*Math.cos(w-C+S)*i+.614*Math.cos(w-C-S)*i-.0297*Math.cos(v)*o-.0335*Math.cos(S)*o+.0012*Math.cos(w-C+v)*o-16e-5*Math.cos(S)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(v)*r;let M=2.116*Math.sin(S)*i-.111*Math.sin(w-C-S)*i-.0015*Math.sin(S)*o;p+=M,y+=M,m+=-520.77*Math.sin(S)*i+13.66*Math.sin(w-C+S)*i+1.12*Math.sin(w-S)*i-1.06*Math.sin(C-S)*i+.66*Math.sin(v)*o+.371*Math.sin(S)*o-.035*Math.sin(w-C+v)*o-.015*Math.sin(w-C+S)*o+.0014*Math.sin(S)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(v)*r,s*=t2e;let N=u+f*qu,j=d+p*qu,k=A+y*qu,V=g+m*qu;return Uae(s,c,N,j,V,k,t)}var kae=.012300034,W2e=kae/(kae+1)*-1;function q2e(e,t){return t=Vae(e,t),h.multiplyByScalar(t,W2e,t)}var jae=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),Kw=new h;MW.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),l(t)||(t=new h),Kw=H2e(e,Kw),t=h.negate(Kw,t),q2e(e,Kw),h.subtract(t,Kw,t),$.multiplyByVector(jae,t,t),t};MW.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),t=Vae(e,t),$.multiplyByVector(jae,t,t),t};var Vy=MW;var Qw={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};Qw.getMorphTime=function(e){return e===Qw.SCENE3D?1:e===Qw.MORPHING?void 0:0};Object.freeze(Qw);var ie=Qw;function Y2e(e){e=e??G.EMPTY_OBJECT,this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??2}var t_=Y2e;function QT(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Je,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=R.clone(R.IDENTITY),this._viewportTransformation=R.clone(R.IDENTITY),this._model=R.clone(R.IDENTITY),this._view=R.clone(R.IDENTITY),this._inverseView=R.clone(R.IDENTITY),this._projection=R.clone(R.IDENTITY),this._infiniteProjection=R.clone(R.IDENTITY),this._entireFrustum=new z,this._currentFrustum=new z,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(R.IDENTITY),this._view3DDirty=!0,this._view3D=new R,this._inverseView3DDirty=!0,this._inverseView3D=new R,this._inverseModelDirty=!0,this._inverseModel=new R,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new R,this._modelViewDirty=!0,this._modelView=new R,this._modelView3DDirty=!0,this._modelView3D=new R,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new R,this._inverseModelViewDirty=!0,this._inverseModelView=new R,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new R,this._viewProjectionDirty=!0,this._viewProjection=new R,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new R,this._modelViewProjectionDirty=!0,this._modelViewProjection=new R,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new R,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new R,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new R,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 Tn,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 z,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new z,this._modelToEnu=new R,this._enuToModel=new R,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new U,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(QT.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Je.equals(e,this._viewport)){Je.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 Hae(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Hae(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){R.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,R.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,R.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return LW(this),this._view3D}},viewRotation:{get:function(){return LW(this),this._viewRotation}},viewRotation3D:{get:function(){return LW(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Yae(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Yae(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return oke(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return rke(this),this._modelView}},modelView3D:{get:function(){return ake(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return dke(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return ske(this),this._inverseModelView}},inverseModelView3D:{get:function(){return cke(this),this._inverseModelView3D}},viewProjection:{get:function(){return lke(this),this._viewProjection}},inverseViewProjection:{get:function(){return uke(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return fke(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return hke(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return mke(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return pke(this),this._modelViewInfiniteProjection}},normal:{get:function(){return gke(this),this._normal}},normal3D:{get:function(){return _ke(this),this._normal3D}},inverseNormal:{get:function(){return Ake(this),this._inverseNormal}},inverseNormal3D:{get:function(){return yke(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 qae(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return qae(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 this._ellipsoid??te.default}}});function X2e(e,t){R.clone(t,e._view),R.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 K2e(e,t){R.clone(t,e._inverseView),R.getMatrix3(t,e._inverseViewRotation)}function Q2e(e,t){R.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function $2e(e,t){R.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Gae=new h,J2e=new R;function Z2e(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,Gae)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Gae)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=pt.eastNorthUpToFixedFrame(i,n,J2e);e._enuToModel=R.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=R.inverseTransformation(e._enuToModel,e._modelToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var BW=new $,eke=new de;function tke(e,t){pt.computeIcrfToCentralBodyFixedMatrix(t.time,BW);let n=Vy.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(BW,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Vy.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(BW,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,eke);i.project(r,e._sunPositionColumbusView)}QT.prototype.updateCamera=function(e){X2e(this,e.viewMatrix),K2e(this,e.inverseViewMatrix),Z2e(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ie.SCENE2D&&e.frustum instanceof fn};QT.prototype.updateFrustum=function(e){Q2e(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&$2e(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.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};QT.prototype.updatePass=function(e){this._pass=e};var nke=[],ike=new t_;QT.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===ie.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),tke(this,e);let n=e.light??ike;n instanceof t_?(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 a=e.brdfLutGenerator,s=l(a)?a.colorTexture:void 0;this._brdfLut=s,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??nke,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=pt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,U.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Hae(e){if(e._viewportDirty){let t=e._viewport;R.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),R.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function oke(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ie.SCENE2D&&e._mode!==ie.MORPHING&&!e._orthographicIn3D?R.inverse(e._projection,e._inverseProjection):R.clone(R.ZERO,e._inverseProjection))}function rke(e){e._modelViewDirty&&(e._modelViewDirty=!1,R.multiplyTransformation(e._view,e._model,e._modelView))}function ake(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,R.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function ske(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,R.inverse(e.modelView,e._inverseModelView))}function cke(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,R.inverse(e.modelView3D,e._inverseModelView3D))}function lke(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,R.multiply(e._projection,e._view,e._viewProjection))}function uke(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,R.inverse(e.viewProjection,e._inverseViewProjection))}function fke(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,R.multiply(e._projection,e.modelView,e._modelViewProjection))}function dke(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 hke(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,R.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function mke(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,R.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function pke(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,R.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function gke(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;R.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function _ke(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;R.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function Ake(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;R.getMatrix3(e.modelView,t),$.transpose(t,t)}}function yke(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;R.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Wae=new h;function qae(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,R.multiplyByPoint(e.inverseModel,e._cameraPosition,Wae),Tn.fromCartesian(Wae,e._encodedCameraPositionMC))}var xke=new h,bke=new h,Tke=new h,Cke=new h,Eke=new de,vke=new h,Ske=new R;function wke(e,t,n,i,o,r,a,s){let c=xke;c.x=e.y,c.y=e.z,c.z=e.x;let u=bke;u.x=n.y,u.y=n.z,u.z=n.x;let f=Tke;f.x=i.y,f.y=i.z,f.z=i.x;let d=Cke;d.x=t.y,d.y=t.z,d.z=t.x,r===ie.SCENE2D&&(c.z=o*.5);let p=a.unproject(c,Eke);p.longitude=D.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=D.clamp(p.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let g=a.ellipsoid,m=g.cartographicToCartesian(p,vke),A=pt.eastNorthUpToFixedFrame(m,g,Ske);return R.multiplyByPointAsVector(A,u,u),R.multiplyByPointAsVector(A,f,f),R.multiplyByPointAsVector(A,d,d),l(s)||(s=new R),s[0]=u.x,s[1]=f.x,s[2]=-d.x,s[3]=0,s[4]=u.y,s[5]=f.y,s[6]=-d.y,s[7]=0,s[8]=u.z,s[9]=f.z,s[10]=-d.z,s[11]=0,s[12]=-h.dot(u,m),s[13]=-h.dot(f,m),s[14]=h.dot(d,m),s[15]=1,s}function LW(e){e._view3DDirty&&(e._mode===ie.SCENE3D?R.clone(e._view,e._view3D):wke(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),R.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Yae(e){e._inverseView3DDirty&&(R.inverseTransformation(e.view3D,e._inverseView3D),R.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var vN=QT;function eu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let a=l(n)?n(e,o):Ike(e,o,i),c=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=c,this._id=Hn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new bN(this),this._textureCache=new CN;let u=a;this._stencilBits=u.getParameter(u.STENCIL_BITS),Mt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Mt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Mt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Mt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Mt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Mt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Mt._maximum3DTextureSize=u.getParameter(u.MAX_3D_TEXTURE_SIZE),Mt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Mt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Mt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Mt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Mt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Mt._minimumAliasedLineWidth=f[0],Mt._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Mt._minimumAliasedPointSize=d[0],Mt._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Mt._maximumViewportWidth=p[0],Mt._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Mt._highpFloatSupported=g.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Mt._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Ur(u,["OES_standard_derivatives"]),this._blendMinmax=!!Ur(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Ur(u,["OES_element_index_uint"]),this._depthTexture=!!Ur(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Ur(u,["EXT_frag_depth"]),this._debugShaders=Ur(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Ur(u,["OES_texture_float"]),this._textureHalfFloat=!!Ur(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Ur(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Ur(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Ur(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Ur(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Ur(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Ur(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Ur(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Ur(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Ur(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Ur(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Ur(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Ur(u,["EXT_texture_compression_bptc"]),Hu.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=r?Ur(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,Mt._maximumTextureFilterAnisotropy=l(A)?u.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let y,x,b,T,E,S,w,P,O,B;if(c){let v=this;y=function(){return v._gl.createVertexArray()},x=function(I){v._gl.bindVertexArray(I)},b=function(I){v._gl.deleteVertexArray(I)},T=function(I,M,N,j,k){u.drawElementsInstanced(I,M,N,j,k)},E=function(I,M,N,j){u.drawArraysInstanced(I,M,N,j)},S=function(I,M){u.vertexAttribDivisor(I,M)},w=function(I){u.drawBuffers(I)}}else P=Ur(u,["OES_vertex_array_object"]),l(P)&&(y=function(){return P.createVertexArrayOES()},x=function(v){P.bindVertexArrayOES(v)},b=function(v){P.deleteVertexArrayOES(v)}),O=Ur(u,["ANGLE_instanced_arrays"]),l(O)&&(T=function(v,I,M,N,j){O.drawElementsInstancedANGLE(v,I,M,N,j)},E=function(v,I,M,N){O.drawArraysInstancedANGLE(v,I,M,N)},S=function(v,I){O.vertexAttribDivisorANGLE(v,I)}),B=Ur(u,["WEBGL_draw_buffers"]),l(B)&&(w=function(v){B.drawBuffersWEBGL(v)});this.glCreateVertexArray=y,this.glBindVertexArray=x,this.glDeleteVertexArray=b,this.glDrawElementsInstanced=T,this.glDrawArraysInstanced=E,this.glVertexAttribDivisor=S,this.glDrawBuffers=w,this._vertexArrayObject=!!P,this._instancedArrays=!!O,this._drawBuffers=!!B,Mt._maximumDrawBuffers=this.drawBuffers?u.getParameter(ee.MAX_DRAW_BUFFERS):1,Mt._maximumColorAttachments=this.drawBuffers?u.getParameter(ee.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new U(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let L=new vN,_=new _l(this),C=Ve.fromCache();this._defaultPassState=_,this._defaultRenderState=C,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=L,this._currentRenderState=C,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let v=0;v<Mt._maximumVertexAttributes;v++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ve.apply(u,C,_)}function Ike(e,t,n){if(typeof WebGLRenderingContext>"u")throw new re("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 re("The browser supports WebGL, but initialization failed.");return r}function Dke(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 Pke(e,t,n,i){let o=`${Dke(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function Rke(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new re(Pke(e,t,n,i))}function Oke(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 Mke(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,Oke(e,o,t))}return i}function Ur(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var Bke={};Object.defineProperties(eu.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=Mke(this._originalGLContext,e?Rke:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Dt({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 Dt({context:this,pixelFormat:Xe.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 Dt({context:this,pixelFormat:Xe.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 oa({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 Bke}}});function Xae(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var NW;typeof WebGLRenderingContext<"u"&&(NW=[ee.BACK]);function SN(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=NW;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var Lke=new si;eu.prototype.clear=function(e,t){e=e??Lke,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,a=e.stencil;l(o)&&(U.equals(this._clearColor,o)||(U.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(a)&&(a!==this._clearStencil&&(this._clearStencil=a,n.clearStencil(a)),i|=n.STENCIL_BUFFER_BIT);let s=e.renderState??this._defaultRenderState;Xae(this,s,t,!0);let c=e.framebuffer??t.framebuffer;SN(this,c),n.clear(i)};function Nke(e,t,n,i,o){SN(e,t),Xae(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function Fke(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,a=t._offset,s=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??R.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(a=a*u.bytesPerIndex,l(s)?s=Math.min(s,u.numberOfIndices):s=u.numberOfIndices,c===0?e._gl.drawElements(o,s,u.indexDatatype,a):e.glDrawElementsInstanced(o,s,u.indexDatatype,a,c)):(l(s)?s=Math.min(s,r.numberOfVertices):s=r.numberOfVertices,c===0?e._gl.drawArrays(o,a,s):e.glDrawArraysInstanced(o,a,s,c)),r._unBind()}eu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,Nke(this,o,t,n,r),Fke(this,e,n,i)};eu.prototype.beginFrame=function(){};eu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=NW;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)};eu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??G.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,a=e.framebuffer;if(!this._webgl2)throw new _e("A WebGL 2 context is required to read pixels using a PBO.");let s=je.UNSIGNED_BYTE,c=Xe.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=Ke.createPixelBuffer({context:this,sizeInBytes:Xe.textureSizeInBytes(c,s,o,r),usage:Oe.DYNAMIC_READ});return SN(this,a),u._bind(),t.readPixels(n,i,o,r,c,je.toWebGLConstant(s,this),0),u._unBind(),u};eu.prototype.readPixels=function(e){let t=this._gl;e=e??G.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,a=e.framebuffer,s=je.UNSIGNED_BYTE,c=Xe.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=Xe.createTypedArray(c,s,o,r);return SN(this,a),t.readPixels(n,i,o,r,Xe.RGBA,je.toWebGLConstant(s,this),u),u};var Kae={position:0,textureCoordinates:1};eu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new At({attributes:{position:new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Re.TRIANGLES});e=Fn.fromGeometry({context:this,geometry:t,attributeLocations:Kae,bufferUsage:Oe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};eu.prototype.createViewportQuadCommand=function(e,t){return t=t??G.EMPTY_OBJECT,new tt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Re.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:UT,fragmentShaderSource:e,attributeLocations:Kae}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};eu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};eu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new re("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new zM(this._pickObjects,t,U.fromRgba(t))};eu.prototype.isDestroyed=function(){return!1};eu.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(),fe(this)};var $T=eu;function JT(e){e=e??G.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:a,depthStencilTexture:s,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new _e("Both color renderbuffer and texture attachments must be provided.");if(l(a)!==l(s))throw new _e("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new pa({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:a,destroyAttachments:c}),this._colorFramebuffer=new pa({context:t,colorTextures:r,depthStencilTexture:s,destroyAttachments:c})}JT.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};JT.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};JT.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)};JT.prototype.isDestroyed=function(){return!1};JT.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),fe(this)};var wN=JT;var Al={RGBA4:ee.RGBA4,RGBA8:ee.RGBA8,RGBA16F:ee.RGBA16F,RGBA32F:ee.RGBA32F,RGB5_A1:ee.RGB5_A1,RGB565:ee.RGB565,DEPTH_COMPONENT16:ee.DEPTH_COMPONENT16,STENCIL_INDEX8:ee.STENCIL_INDEX8,DEPTH_STENCIL:ee.DEPTH_STENCIL,DEPTH24_STENCIL8:ee.DEPTH24_STENCIL8,validate:function(e){return e===Al.RGBA4||e===Al.RGBA8||e===Al.RGBA16F||e===Al.RGBA32F||e===Al.RGB5_A1||e===Al.RGB565||e===Al.DEPTH_COMPONENT16||e===Al.STENCIL_INDEX8||e===Al.DEPTH_STENCIL||e===Al.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ee.FLOAT?Al.RGBA32F:e===ee.HALF_FLOAT_OES?Al.RGBA16F:Al.RGBA8}};Object.freeze(Al);var tu=Al;function $w(e){e=e??G.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Mt.maximumRenderbufferSize,o=e.format??tu.RGBA4,r=l(e.width)?e.width:t.drawingBufferWidth,a=l(e.height)?e.height:t.drawingBufferHeight,s=e.numSamples??1;this._gl=n,this._format=o,this._width=r,this._height=a,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),s>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,s,o,r,a):n.renderbufferStorage(n.RENDERBUFFER,o,r,a),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties($w.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});$w.prototype._getRenderbuffer=function(){return this._renderbuffer};$w.prototype.isDestroyed=function(){return!1};$w.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),fe(this)};var Wf=$w;function os(e){e=e??G.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=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(os.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}}});os.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,a=this._numSamples!==n,s=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||a||s||!c||this._color&&!l(this._colorTextures[0])};os.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??je.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??Xe.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 a=0;a<this._colorAttachmentsLength;++a)if(this._colorTextures[a]=new Dt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:jt.NEAREST}),this._numSamples>1){let s=tu.getColorFormat(o);this._colorRenderbuffers[a]=new Wf({context:e,width:t,height:n,format:s,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Dt({context:e,width:t,height:n,pixelFormat:Xe.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Wf({context:e,width:t,height:n,format:tu.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Wf({context:e,width:t,height:n,format:tu.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Dt({context:e,width:t,height:n,pixelFormat:Xe.DEPTH_COMPONENT,pixelDatatype:je.UNSIGNED_INT,sampler:jt.NEAREST}):this._depthRenderbuffer=new Wf({context:e,width:t,height:n,format:tu.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new wN({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 pa({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};os.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};os.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};os.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};os.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};os.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};os.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};os.prototype.getDepthTexture=function(){return this._depthTexture};os.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};os.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};os.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};os.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};os.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};os.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};os.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};os.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};os.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 bi=os;var n_={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};n_.includesVertexShader=function(e){return(e&n_.VERTEX)!==0};n_.includesFragmentShader=function(e){return(e&n_.FRAGMENT)!==0};n_.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};n_.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(n_);var he=n_;function FW(e){this.name=e,this.fields=[]}FW.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};FW.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var IN=FW;function kW(e){this.signature=e,this.body=[]}kW.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}`)};kW.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var DN=kW;function kke(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let o=0;o<n;o++)e[i+o]=t[o]}var Jn=kke;function yl(){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(yl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});yl.prototype.addDefine=function(e,t,n){n=n??he.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),he.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),he.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};yl.prototype.addStruct=function(e,t,n){this._structs[e]=new IN(t),he.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};yl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};yl.prototype.addFunction=function(e,t,n){this._functions[e]=new DN(t),he.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};yl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};yl.prototype.addUniform=function(e,t,n){n=n??he.BOTH;let i=`uniform ${e} ${t};`;he.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),he.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};yl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};yl.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+=Uke(e),i};yl.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}`)};yl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Jn(t,e):t.push(e)};yl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Jn(t,e):t.push(e)};yl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=zke(this),i=Vke(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
  3796. `),r=new He({defines:this._vertexShaderParts.defineLines,sources:[o]}),a=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
  3797. `),s=new He({defines:this._fragmentShaderParts.defineLines,sources:[a]});return Qt.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:this._attributeLocations})};yl.prototype.clone=function(){return qe(this,!0)};function zke(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,a,s;for(i=0;i<o.length;i++)r=o[i],a=e._structs[r],s=a.generateGlslLines(),Jn(t,s);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],a=e._structs[r],s=a.generateGlslLines(),Jn(n,s);return{vertexLines:t,fragmentLines:n}}function Uke(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function Vke(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,a,s;for(i=0;i<o.length;i++)r=o[i],a=e._functions[r],s=a.generateGlslLines(),Jn(t,s);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],a=e._functions[r],s=a.generateGlslLines(),Jn(n,s);return{vertexLines:t,fragmentLines:n}}var i_=yl;function PN(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new $T(this._canvas,qe(e?.contextOptions)),this._canvases=[]}PN.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,o=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},r=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},a=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return o;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return r;case"endFrame":return a;default:return Reflect.get(c,u,f)}}})};PN.prototype.destroy=function(){this._context.destroy(),fe(this)};PN.prototype.isDestroyed=function(){return!1};var RN=PN;function jy(e){e=e??G.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new _e("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(ee.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}jy.create=function(e){return new jy(e)};jy.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ee.SYNC_STATUS)};jy.prototype.isDestroyed=function(){return!1};jy.prototype.destroy=function(){return this._gl.deleteSync(this._sync),fe(this)};jy.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(o,r,a){return()=>{n.getStatus()===ee.SIGNALED?o():a<=0?r(new re("Wait for signal timeout")):e(i(o,r,a-1))}}return new Promise((o,r)=>{e(i(o,r,t))})};var ON=jy;function o_(e){e=e??G.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Xe.RGBA,pixelDatatype:o=je.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:a=!1,sampler:s=new jt}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new _e("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===Xe.RGB||i===Xe.LUMINANCE,p=Xe.toInternalFormat(i,o,t),g=Xe.isCompressedFormat(p),m=t._gl,A=Xe.texture3DSizeInBytes(i,o,c,u,f);if(this._id=e.id??Hn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=A,this._preMultiplyAlpha=d,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=s,Jae(this,s),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(a?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new _e("For Texture3D, options.source.arrayBufferView must be defined");Qae(this,n),this._initialized=!0}else $ae(this);m.bindTexture(this._textureTarget,null)}function Qae(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:a,height:s,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=Xe.alignmentInBytes(u,f,a);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:g}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(o,m,r,a,s,c),i.texSubImage3D(o,0,0,0,0,a,s,c,u,je.toWebGLConstant(f,n),g),m>1){let A=a,y=s,x=c;for(let b=0;b<t.mipLevels.length;++b)A=zW(A),y=zW(y),x=zW(x),i.texSubImage3D(o,b+1,0,0,0,A,y,x,u,je.toWebGLConstant(f,n),t.mipLevels[b])}}o_.prototype.copyFrom=function(e){e=e??G.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:o=0}=e,a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture);let{width:c,height:u,depth:f}=t,d=!1;this._initialized||(n===0&&i===0&&o===0&&c===this._width&&u===this._height&&f===this._depth?(Qae(this,t),d=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),$ae(this)),this._initialized=!0),d||jke(this,t.arrayBufferView,n,i,o,c,u,f),a.bindTexture(s,null)};function jke(e,t,n,i,o,r,a,s){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:d}=e,p=Xe.alignmentInBytes(f,d,r);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,o,r,a,s,f,je.toWebGLConstant(d,c),t)}function zW(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function $ae(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,je.toWebGLConstant(e._pixelDatatype,t),null)}o_.create=function(e){return new o_(e)};Object.defineProperties(o_.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Jae(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}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Jae(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Vt.NEAREST_MIPMAP_NEAREST,Vt.NEAREST_MIPMAP_LINEAR,Vt.LINEAR_MIPMAP_NEAREST,Vt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,a=e._pixelFormat,s=e._pixelDatatype;(s===je.FLOAT&&!r.textureFloatLinear||s===je.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Vt.NEAREST_MIPMAP_NEAREST:Vt.NEAREST,i=ti.NEAREST),Xe.isDepthFormat(a)&&(n=Vt.NEAREST,i=ti.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}o_.prototype.generateMipmap=function(e){e=e??rh.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)};o_.prototype.isDestroyed=function(){return!1};o_.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),fe(this)};var MN=o_;function Jw({x:e,y:t,width:n,height:i}){this.rectangle=new Je(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function UW({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new Jw({x:n,y:n,width:e-2*n,height:t-2*n})}UW.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};UW.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,o=i.width,r=i.height,a=o-t,s=r-n;if(a<0||s<0)return;if(a===0&&s===0)return e;let c=this._borderPadding;if(a>s){e.childNode1=new Jw({x:i.x,y:i.y,width:t,height:r});let f=a-c;return f>0&&(e.childNode2=new Jw({x:i.x+t+c,y:i.y,width:f,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new Jw({x:i.x,y:i.y,width:o,height:n});let u=s-c;return u>0&&(e.childNode2=new Jw({x:i.x,y:i.y+n+c,width:o,height:u})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var Zw=UW;var Zae=16;function xl(e){e=e??G.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new z(Zae,Zae);this._pixelFormat=e.pixelFormat??Xe.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Hn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(xl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});xl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new Je),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,a=i.width,s=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/o,t.y=u/r,t.width=a/o,t.height=s/r,t};xl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,a=new Dt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),s=e._gl,c=a._textureTarget,u=this._texture,f=new pa({context:e,colorTextures:[u],destroyAttachments:!1});s.activeTexture(s.TEXTURE0),s.bindTexture(c,a._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let g=0;g<d.length;++g){let m=i[g],A=d[g];if(!l(m)||!l(A)||l(p.get(g)))continue;let{x:y,y:x,width:b,height:T}=m;s.copyTexSubImage2D(c,0,y,x,A.x,A.y,b,T)}return s.bindTexture(c,null),a._initialized=!0,f._unBind(),f.destroy(),a};xl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture,a=r.width,s=r.height,c=this._subRegions,u=i.map((y,x)=>new ese({index:x,image:y})).filter((y,x)=>l(y.image)&&!l(c.get(x))),f=0,d=0,p=0;for(let y=t;y<o.length;++y){let{width:x,height:b}=o[y].image;f=Math.max(f,x),d=Math.max(d,b),p+=x*b,u.push(o[y])}for(a=D.nextPowerOfTwo(Math.max(f,a)),s=D.nextPowerOfTwo(Math.max(d,s));p>=a*s;)a>s?s*=2:a*=2;u.sort(({image:y},{image:x})=>x.height*x.width-y.height*y.width);let g=new Array(this._nextIndex);for(let y of this._subRegions.keys())l(c.get(y))&&(g[y]=i[y]);let m,A=!1;for(;!A;){m=new Zw({height:s,width:a,borderPadding:n});let y;for(y=0;y<u.length;++y){let{index:x,image:b}=u[y];if(!l(b))continue;let T=m.pack(x,b);if(!l(T)){a>s?s*=2:a*=2;break}g[x]=T.rectangle}A=y===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,a,s,g),r.destroy(),this._rectangles=g,this._guid=Hn()};xl.prototype.getImageIndex=function(e){return this._indexById.get(e)};xl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let o=this._texture,r=this._rectangles[e];try{o.copyFrom({source:t,xOffset:r.x,yOffset:r.y}),l(n)&&n(e)}catch(a){if(l(i)){i(a);return}}};function ese({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}xl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new ese({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};xl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let o=t[n],{image:r,index:a}=o,s=this._texturePacker.pack(a,r);if(!l(s)){try{this._resize(e,n)}catch(c){i=c,l(o.reject)&&o.reject(i)}break}this._rectangles[a]=s.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];l(o)&&o(-1)}return t.length=0,!1}for(let o=0;o<t.length;++o)this._copyImageToTexture(t[o]);return t.length=0,!0};xl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,o=this._sampler,r=this._borderWidthInPixels;this._texture=new Dt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new Zw({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function Gke(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}xl.prototype.addImage=function(e,t,n,i){let o=this._indexPromiseById.get(e),r=this._indexById.get(e);return l(o)?o:l(r)?r:(r=this._nextIndex++,this._indexById.set(e,r),o=(async()=>{let s=await Gke(t,e);if(this.isDestroyed()||!l(s))return this._indexPromiseById.delete(e),-1;l(n)&&(s.width=n),l(i)&&(s.height=i);let c=await this._addImage(r,s);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,o),o)};xl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[o,r]of this._subRegions.entries())if(n===r&&this._rectangles[o].equals(t))return i?i.then(s=>s===-1?-1:o):o};xl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new re(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(r=>{if(r===-1)return-1;let a=this._rectangles[r];return i}))};xl.prototype.isDestroyed=function(){return!1};xl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),fe(this)};var ZT=xl;function Cs(e,t,n,i){let o=Cs._verifyAttributes(t);n=n??0;let r=[],a={},s,c,u=o.length;for(let d=0;d<u;++d){let p=o[d];if(p.vertexBuffer){r.push(p);continue}c=p.usage,s=a[c],l(s)||(s=a[c]=[]),s.push(p)}function f(d,p){return Y.getSizeInBytes(p.componentDatatype)-Y.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in a)if(a.hasOwnProperty(c)){s=a[c],s.sort(f);let d=Cs._vertexSizeInBytes(s),p=s[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Cs._createArrayViews(s,d)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Cs._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:o.index??i,enabled:o.enabled??!0,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype??Y.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Oe.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};Cs._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let a=0;a<n;++a){let s=e[a];t+=s.componentsPerAttribute*Y.getSizeInBytes(s.componentDatatype)}let i=n>0?Y.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Cs._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r],s=a.componentDatatype;n.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:s,normalize:a.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Y.getSizeInBytes(s),view:void 0}),i+=a.componentsPerAttribute*Y.getSizeInBytes(s)}return n};Cs.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];Cs._resize(o,this._size),Cs._appendWriters(this.writers,o)}VW(this)};Cs._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),a=new Uint8Array(e.arrayBuffer),s=a.length;for(let c=0;c<s;++c)r[c]=a[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let a=i[r];a.view=Y.createArrayBufferView(a.componentDatatype,n,a.offsetInBytes)}e.arrayBuffer=n}};var Hke=[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 a=i*n;t[a]=o,t[a+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,a){let s=i*n;t[s]=o,t[s+1]=r,t[s+2]=a,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,a,s){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=a,t[c+3]=s,e.needsCommit=!0}}];Cs._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]=Hke[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Cs.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=Wke(this,i)||t;if(t||!l(this.va)){VW(this);let a=this.va=[],s=D.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/s):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let d=u*(i.vertexSizeInBytes*s);Cs._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),a.push({va:new Fn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?s:this._size%s)})}}};function Wke(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=Ke.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Cs._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let a=0;a<r;++a){let s=o[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Cs.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)qke(n[i],e,t)};function qke(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)}}Cs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function VW(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}Cs.prototype.isDestroyed=function(){return!1};Cs.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 VW(this),fe(this)};var r_=Cs;function Yke(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new oa({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var BN=Yke;function a_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new ye,this.setValue(e)}Object.defineProperties(a_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});a_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};a_.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))}};a_.prototype.equals=function(e){return this===e||e instanceof a_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};a_.prototype.valueOf=function(){return this._value};a_.prototype.toString=function(){return String(this._value)};var fi=a_;function Xke(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let a=this[t],s=this[n];l(s)&&(s(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),a!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,a)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function Kke(e){return new fi(e)}function Qke(e,t,n){return Xke(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??Kke)}var pe=Qke;function eI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(eI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),image:pe("image"),scale:pe("scale"),pixelOffset:pe("pixelOffset"),eyeOffset:pe("eyeOffset"),horizontalOrigin:pe("horizontalOrigin"),verticalOrigin:pe("verticalOrigin"),heightReference:pe("heightReference"),color:pe("color"),rotation:pe("rotation"),alignedAxis:pe("alignedAxis"),sizeInMeters:pe("sizeInMeters"),width:pe("width"),height:pe("height"),scaleByDistance:pe("scaleByDistance"),translucencyByDistance:pe("translucencyByDistance"),pixelOffsetScaleByDistance:pe("pixelOffsetScaleByDistance"),imageSubRegion:pe("imageSubRegion"),distanceDisplayCondition:pe("distanceDisplayCondition"),disableDepthTestDistance:pe("disableDepthTestDistance"),splitDirection:pe("splitDirection")});eI.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 eI(this)};eI.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var bl=eI;var jW=class{constructor(){this._array=[],this._hash={}}get length(){return this._array.length}get values(){return this._array}contains(t){return l(this._hash[t])}set(t,n){let i=this._hash[t];n!==i&&(this.remove(t),this._hash[t]=n,this._array.push(n))}get(t){return this._hash[t]}remove(t){let n=this._hash[t],i=l(n);if(i){let o=this._array;o.splice(o.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},Nt=jW;function Yu(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Yu.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}}});Yu.packedLength=2;Yu.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Yu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Yu),n.near=e[t++],n.far=e[t],n};Yu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Yu.clone=function(e,t){if(l(e))return l(t)||(t=new Yu),t.near=e.near,t.far=e.far,t};Yu.prototype.clone=function(e){return Yu.clone(this,e)};Yu.prototype.equals=function(e){return Yu.equals(this,e)};var kt=Yu;function qf(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}qf.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 qf(e.near,e.nearValue,e.far,e.farValue)};qf.packedLength=4;qf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};qf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new qf),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};qf.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};qf.prototype.clone=function(e){return qf.clone(this,e)};qf.prototype.equals=function(e){return qf.equals(this,e)};var Ut=qf;var s_={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};Object.freeze(s_);var nt=s_;function Yf(e){return e===s_.CLAMP_TO_GROUND||e===s_.CLAMP_TO_3D_TILE||e===s_.CLAMP_TO_TERRAIN}function eC(e){return e===s_.RELATIVE_TO_GROUND||e===s_.RELATIVE_TO_3D_TILE||e===s_.RELATIVE_TO_TERRAIN}var tse={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(tse);var Bi=tse;var nse={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(nse);var zn=nse;var $ke=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Tt=$ke;function lh(){_e.throwInstantiationError()}Object.defineProperties(lh.prototype,{isConstant:{get:_e.throwInstantiationError},definitionChanged:{get:_e.throwInstantiationError}});lh.prototype.getValue=_e.throwInstantiationError;lh.prototype.equals=_e.throwInstantiationError;lh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};lh.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(!lh.equals(e[i],t[i]))return!1;return!0};lh.isConstant=function(e){return!l(e)||e.isConstant};lh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};lh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};lh.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var X=lh;var ise={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(ise);var Vr=ise;var Jke=U.WHITE,Zke=h.ZERO,e3e=nt.NONE,t3e=z.ZERO,n3e=1,i3e=0,o3e=h.ZERO,r3e=Bi.CENTER,a3e=zn.CENTER,s3e=!1,c3e=Vr.NONE,l3e=new h,u3e=new U,f3e=new h,d3e=new z,h3e=new Ut,m3e=new Ut,p3e=new Ut,g3e=new Je,_3e=new kt;function ose(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function c_(e,t){t.collectionChanged.addEventListener(c_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Nt,this._onCollectionChanged(t,t.values,[],[])}c_.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],a=r.entity,s=a._billboard,c,u=r.billboard,f=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(a._position,e,l3e),c=X.getValueOrUndefined(s._image,e),f=l(d)&&l(c)),!f){GW(r,a,n);continue}X.isConstant(a._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(a),u.id=a,r.billboard=u,r.textureValue=void 0),u.show=f,u.position=d,u.color=X.getValueOrDefault(s._color,e,Jke,u3e),u.eyeOffset=X.getValueOrDefault(s._eyeOffset,e,Zke,f3e),u.heightReference=X.getValueOrDefault(s._heightReference,e,e3e),u.pixelOffset=X.getValueOrDefault(s._pixelOffset,e,t3e,d3e),u.scale=X.getValueOrDefault(s._scale,e,n3e),u.rotation=X.getValueOrDefault(s._rotation,e,i3e),u.alignedAxis=X.getValueOrDefault(s._alignedAxis,e,o3e),u.horizontalOrigin=X.getValueOrDefault(s._horizontalOrigin,e,r3e),u.verticalOrigin=X.getValueOrDefault(s._verticalOrigin,e,a3e),u.width=X.getValueOrUndefined(s._width,e),u.height=X.getValueOrUndefined(s._height,e),u.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,h3e),u.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,m3e),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,p3e),u.sizeInMeters=X.getValueOrDefault(s._sizeInMeters,e,s3e),u.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,_3e),u.disableDepthTestDistance=X.getValueOrUndefined(s._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(s._splitDirection,e,c3e),r.textureValue!==c&&(u.image=c,r.textureValue=c);let p=X.getValueOrUndefined(s._imageSubRegion,e,g3e);l(p)&&u.setImageSubRegion(u.image,p)}return!0};c_.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Tt.FAILED;let i=n.billboard;if(i.heightReference===nt.NONE)t.center=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return Tt.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,Tt.DONE};c_.prototype.isDestroyed=function(){return!1};c_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(c_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return fe(this)};c_.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._items,s=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&a.set(r.id,new ose(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?a.contains(r.id)||a.set(r.id,new ose(r)):(GW(a.get(r.id),r,s),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],GW(a.get(r.id),r,s),a.remove(r.id)};function GW(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var LN=c_;var A3e=new h;function vm(e){e=e??G.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"}vm.fromDimensions=function(e){e=e??G.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new vm({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};vm.fromAxisAlignedBoundingBox=function(e){return new vm({minimum:e.minimum,maximum:e.maximum})};vm.packedLength=2*h.packedLength+1;vm.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var ase=new h,sse=new h,rse={minimum:ase,maximum:sse,offsetAttribute:void 0};vm.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,ase),o=h.unpack(e,t+h.packedLength,sse),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):(rse.offsetAttribute=r===-1?void 0:r,new vm(rse))};vm.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new _n,o=new Uint16Array(24),r=new Float64Array(24);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 Me({componentDatatype:Y.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 a=h.subtract(n,t,A3e),s=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===ln.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new At({attributes:i,indices:o,primitiveType:Re.LINES,boundingSphere:new ce(h.ZERO,s),offsetAttribute:e._offsetAttribute})};var Sm=vm;function tC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([U.floatToByte(e),U.floatToByte(t),U.floatToByte(n),U.floatToByte(i)])}Object.defineProperties(tC.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});tC.fromColor=function(e){return new tC(e.red,e.green,e.blue,e.alpha)};tC.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};tC.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 Yt=tC;function tI(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(tI.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});tI.fromDistanceDisplayCondition=function(e){return new tI(e.near,e.far)};tI.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var qn=tI;function y3e(e){e=e??G.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Bt=y3e;function hr(e){e=e??G.EMPTY_OBJECT,this.start=l(e.start)?Q.clone(e.start):new Q,this.stop=l(e.stop)?Q.clone(e.stop):new Q,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(hr.prototype,{isEmpty:{get:function(){let e=Q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var nC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};hr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new _e("options.iso8601 is an invalid ISO 8601 interval.");let i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=e.isStartIncluded??!0,a=e.isStopIncluded??!0,s=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=a,t.data=s,t):(nC.start=i,nC.stop=o,nC.isStartIncluded=r,nC.isStopIncluded=a,nC.data=s,new hr(nC))};hr.toIso8601=function(e,t){return`${Q.toIso8601(e.start,t)}/${Q.toIso8601(e.stop,t)}`};hr.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 hr(e)};hr.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equals(e.start,t.start)&&Q.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};hr.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equalsEpsilon(e.start,t.start,n)&&Q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};hr.intersect=function(e,t,n,i){if(!l(t))return hr.clone(hr.EMPTY,n);let o=e.start,r=e.stop,a=t.start,s=t.stop,c=Q.greaterThanOrEquals(a,o)&&Q.greaterThanOrEquals(r,a),u=!c&&Q.lessThanOrEquals(a,o)&&Q.lessThanOrEquals(o,s);if(!c&&!u)return hr.clone(hr.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=Q.lessThan(r,s);return l(n)||(n=new hr),n.start=c?a:o,n.isStartIncluded=f&&p||!Q.equals(a,o)&&(c&&p||u&&f),n.stop=m?r:s,n.isStopIncluded=m?d:d&&g||!Q.equals(s,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};hr.contains=function(e,t){if(e.isEmpty)return!1;let n=Q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};hr.prototype.clone=function(e){return hr.clone(this,e)};hr.prototype.equals=function(e,t){return hr.equals(this,e,t)};hr.prototype.equalsEpsilon=function(e,t,n){return hr.equalsEpsilon(this,e,t,n)};hr.prototype.toString=function(){return hr.toIso8601(this)};hr.EMPTY=Object.freeze(new hr({start:new Q,stop:new Q,isStartIncluded:!1,isStopIncluded:!1}));var wn=hr;var cse=Object.freeze(Q.fromIso8601("0000-01-01T00:00:00Z")),lse=Object.freeze(Q.fromIso8601("9999-12-31T24:00:00Z")),x3e=Object.freeze(new wn({start:cse,stop:lse})),b3e={MINIMUM_VALUE:cse,MAXIMUM_VALUE:lse,MAXIMUM_INTERVAL:x3e},Qe=b3e;function nI(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(nI.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});nI.fromCartesian3=function(e){return new nI(e.x,e.y,e.z)};nI.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 po=nI;function NN(e){e=e??!0,this.value=NN.toValue(e)}Object.defineProperties(NN.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});NN.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var En=NN;var FN=`in vec3 v_positionEC;
  3798. in vec3 v_normalEC;
  3799. in vec3 v_tangentEC;
  3800. in vec3 v_bitangentEC;
  3801. in vec2 v_st;
  3802. void main()
  3803. {
  3804. vec3 positionToEyeEC = -v_positionEC;
  3805. mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);
  3806. vec3 normalEC = normalize(v_normalEC);
  3807. #ifdef FACE_FORWARD
  3808. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  3809. #endif
  3810. czm_materialInput materialInput;
  3811. materialInput.normalEC = normalEC;
  3812. materialInput.tangentToEyeMatrix = tangentToEyeMatrix;
  3813. materialInput.positionToEyeEC = positionToEyeEC;
  3814. materialInput.st = v_st;
  3815. czm_material material = czm_getMaterial(materialInput);
  3816. #ifdef FLAT
  3817. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  3818. #else
  3819. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  3820. #endif
  3821. }
  3822. `;var kN=`in vec3 position3DHigh;
  3823. in vec3 position3DLow;
  3824. in vec3 normal;
  3825. in vec3 tangent;
  3826. in vec3 bitangent;
  3827. in vec2 st;
  3828. in float batchId;
  3829. out vec3 v_positionEC;
  3830. out vec3 v_normalEC;
  3831. out vec3 v_tangentEC;
  3832. out vec3 v_bitangentEC;
  3833. out vec2 v_st;
  3834. void main()
  3835. {
  3836. vec4 p = czm_computePosition();
  3837. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  3838. v_normalEC = czm_normal * normal; // normal in eye coordinates
  3839. v_tangentEC = czm_normal * tangent; // tangent in eye coordinates
  3840. v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates
  3841. v_st = st;
  3842. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  3843. }
  3844. `;var zN=`in vec3 v_positionEC;
  3845. in vec3 v_normalEC;
  3846. void main()
  3847. {
  3848. vec3 positionToEyeEC = -v_positionEC;
  3849. vec3 normalEC = normalize(v_normalEC);
  3850. #ifdef FACE_FORWARD
  3851. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  3852. #endif
  3853. czm_materialInput materialInput;
  3854. materialInput.normalEC = normalEC;
  3855. materialInput.positionToEyeEC = positionToEyeEC;
  3856. czm_material material = czm_getMaterial(materialInput);
  3857. #ifdef FLAT
  3858. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  3859. #else
  3860. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  3861. #endif
  3862. }
  3863. `;var UN=`in vec3 position3DHigh;
  3864. in vec3 position3DLow;
  3865. in vec3 normal;
  3866. in float batchId;
  3867. out vec3 v_positionEC;
  3868. out vec3 v_normalEC;
  3869. void main()
  3870. {
  3871. vec4 p = czm_computePosition();
  3872. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  3873. v_normalEC = czm_normal * normal; // normal in eye coordinates
  3874. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  3875. }
  3876. `;var VN=`in vec3 v_positionEC;
  3877. in vec3 v_normalEC;
  3878. in vec2 v_st;
  3879. void main()
  3880. {
  3881. vec3 positionToEyeEC = -v_positionEC;
  3882. vec3 normalEC = normalize(v_normalEC);
  3883. #ifdef FACE_FORWARD
  3884. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  3885. #endif
  3886. czm_materialInput materialInput;
  3887. materialInput.normalEC = normalEC;
  3888. materialInput.positionToEyeEC = positionToEyeEC;
  3889. materialInput.st = v_st;
  3890. czm_material material = czm_getMaterial(materialInput);
  3891. #ifdef FLAT
  3892. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  3893. #else
  3894. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  3895. #endif
  3896. }
  3897. `;var jN=`in vec3 position3DHigh;
  3898. in vec3 position3DLow;
  3899. in vec3 normal;
  3900. in vec2 st;
  3901. in float batchId;
  3902. out vec3 v_positionEC;
  3903. out vec3 v_normalEC;
  3904. out vec2 v_st;
  3905. void main()
  3906. {
  3907. vec4 p = czm_computePosition();
  3908. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  3909. v_normalEC = czm_normal * normal; // normal in eye coordinates
  3910. v_st = st;
  3911. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  3912. }
  3913. `;var use={ADD:ee.FUNC_ADD,SUBTRACT:ee.FUNC_SUBTRACT,REVERSE_SUBTRACT:ee.FUNC_REVERSE_SUBTRACT,MIN:ee.MIN,MAX:ee.MAX};Object.freeze(use);var Vc=use;var fse={ZERO:ee.ZERO,ONE:ee.ONE,SOURCE_COLOR:ee.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ee.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ee.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ee.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ee.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ee.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ee.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ee.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ee.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ee.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ee.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ee.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ee.SRC_ALPHA_SATURATE};Object.freeze(fse);var qo=fse;var dse={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:qo.SOURCE_ALPHA,functionSourceAlpha:qo.ONE,functionDestinationRgb:qo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:qo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:qo.ONE,functionSourceAlpha:qo.ONE,functionDestinationRgb:qo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:qo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:qo.SOURCE_ALPHA,functionSourceAlpha:qo.ONE,functionDestinationRgb:qo.ONE,functionDestinationAlpha:qo.ONE})};Object.freeze(dse);var Jt=dse;var hse={FRONT:ee.FRONT,BACK:ee.BACK,FRONT_AND_BACK:ee.FRONT_AND_BACK};Object.freeze(hse);var Li=hse;function iC(e){e=e??G.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(iC.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}}});iC.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(`
  3914. `)};iC.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};iC.prototype.getRenderState=function(){let e=this.isTranslucent(),t=qe(this.renderState,!1);return e?(t.depthMask=!1,t.blending=Jt.ALPHA_BLEND):t.depthMask=!0,t};iC.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=Jt.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Li.BACK}),l(n)&&(i=It(n,i,!0)),i};var xo=iC;var GN=`uniform sampler2D image;
  3915. czm_material czm_getMaterial(czm_materialInput materialInput)
  3916. {
  3917. czm_material material = czm_getDefaultMaterial(materialInput);
  3918. vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));
  3919. rampColor = czm_gammaCorrect(rampColor);
  3920. material.diffuse = rampColor.rgb;
  3921. material.alpha = rampColor.a;
  3922. return material;
  3923. }
  3924. `;var HN=`uniform sampler2D image;
  3925. uniform float strength;
  3926. uniform vec2 repeat;
  3927. czm_material czm_getMaterial(czm_materialInput materialInput)
  3928. {
  3929. czm_material material = czm_getDefaultMaterial(materialInput);
  3930. vec2 st = materialInput.st;
  3931. vec2 centerPixel = fract(repeat * st);
  3932. float centerBump = texture(image, centerPixel).channel;
  3933. float imageWidth = float(imageDimensions.x);
  3934. vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));
  3935. float rightBump = texture(image, rightPixel).channel;
  3936. float imageHeight = float(imageDimensions.y);
  3937. vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));
  3938. float topBump = texture(image, leftPixel).channel;
  3939. vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));
  3940. vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
  3941. material.normal = normalEC;
  3942. material.diffuse = vec3(0.01);
  3943. return material;
  3944. }
  3945. `;var WN=`uniform vec4 lightColor;
  3946. uniform vec4 darkColor;
  3947. uniform vec2 repeat;
  3948. czm_material czm_getMaterial(czm_materialInput materialInput)
  3949. {
  3950. czm_material material = czm_getDefaultMaterial(materialInput);
  3951. vec2 st = materialInput.st;
  3952. // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
  3953. float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0
  3954. // Find the distance from the closest separator (region between two colors)
  3955. float scaledWidth = fract(repeat.s * st.s);
  3956. scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
  3957. float scaledHeight = fract(repeat.t * st.t);
  3958. scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
  3959. float value = min(scaledWidth, scaledHeight);
  3960. vec4 currentColor = mix(lightColor, darkColor, b);
  3961. vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);
  3962. color = czm_gammaCorrect(color);
  3963. material.diffuse = color.rgb;
  3964. material.alpha = color.a;
  3965. return material;
  3966. }
  3967. `;var qN=`uniform vec4 lightColor;
  3968. uniform vec4 darkColor;
  3969. uniform vec2 repeat;
  3970. czm_material czm_getMaterial(czm_materialInput materialInput)
  3971. {
  3972. czm_material material = czm_getDefaultMaterial(materialInput);
  3973. // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
  3974. float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0
  3975. vec4 color = mix(lightColor, darkColor, b);
  3976. color = czm_gammaCorrect(color);
  3977. material.diffuse = color.rgb;
  3978. material.alpha = color.a;
  3979. return material;
  3980. }
  3981. `;var YN=`uniform sampler2D heights;
  3982. uniform sampler2D colors;
  3983. // This material expects heights to be sorted from lowest to highest.
  3984. float getHeight(int idx, float invTexSize)
  3985. {
  3986. vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
  3987. #ifdef OES_texture_float
  3988. return texture(heights, uv).x;
  3989. #else
  3990. return czm_unpackFloat(texture(heights, uv));
  3991. #endif
  3992. }
  3993. czm_material czm_getMaterial(czm_materialInput materialInput)
  3994. {
  3995. czm_material material = czm_getDefaultMaterial(materialInput);
  3996. float height = materialInput.height;
  3997. float invTexSize = 1.0 / float(heightsDimensions.x);
  3998. float minHeight = getHeight(0, invTexSize);
  3999. float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);
  4000. // early-out when outside the height range
  4001. if (height < minHeight || height > maxHeight) {
  4002. material.diffuse = vec3(0.0);
  4003. material.alpha = 0.0;
  4004. return material;
  4005. }
  4006. // Binary search to find heights above and below.
  4007. int idxBelow = 0;
  4008. int idxAbove = heightsDimensions.x;
  4009. float heightBelow = minHeight;
  4010. float heightAbove = maxHeight;
  4011. // while loop not allowed, so use for loop with max iterations.
  4012. // maxIterations of 16 supports a texture size up to 65536 (2^16).
  4013. const int maxIterations = 16;
  4014. for (int i = 0; i < maxIterations; i++) {
  4015. if (idxBelow >= idxAbove - 1) {
  4016. break;
  4017. }
  4018. int idxMid = (idxBelow + idxAbove) / 2;
  4019. float heightTex = getHeight(idxMid, invTexSize);
  4020. if (height > heightTex) {
  4021. idxBelow = idxMid;
  4022. heightBelow = heightTex;
  4023. } else {
  4024. idxAbove = idxMid;
  4025. heightAbove = heightTex;
  4026. }
  4027. }
  4028. float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
  4029. vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
  4030. vec4 color = texture(colors, colorUv);
  4031. // undo preumultiplied alpha
  4032. if (color.a > 0.0)
  4033. {
  4034. color.rgb /= color.a;
  4035. }
  4036. color.rgb = czm_gammaCorrect(color.rgb);
  4037. material.diffuse = color.rgb;
  4038. material.alpha = color.a;
  4039. return material;
  4040. }
  4041. `;var XN=`uniform vec4 color;
  4042. uniform float spacing;
  4043. uniform float width;
  4044. czm_material czm_getMaterial(czm_materialInput materialInput)
  4045. {
  4046. czm_material material = czm_getDefaultMaterial(materialInput);
  4047. float distanceToContour = mod(materialInput.height, spacing);
  4048. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  4049. float dxc = abs(dFdx(materialInput.height));
  4050. float dyc = abs(dFdy(materialInput.height));
  4051. float dF = max(dxc, dyc) * czm_pixelRatio * width;
  4052. float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
  4053. #else
  4054. // If no derivatives available (IE 10?), use pixel ratio
  4055. float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
  4056. #endif
  4057. vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));
  4058. material.diffuse = outColor.rgb;
  4059. material.alpha = outColor.a;
  4060. return material;
  4061. }
  4062. `;var KN=`uniform sampler2D image;
  4063. uniform float minimumHeight;
  4064. uniform float maximumHeight;
  4065. czm_material czm_getMaterial(czm_materialInput materialInput)
  4066. {
  4067. czm_material material = czm_getDefaultMaterial(materialInput);
  4068. float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);
  4069. vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));
  4070. rampColor = czm_gammaCorrect(rampColor);
  4071. material.diffuse = rampColor.rgb;
  4072. material.alpha = rampColor.a;
  4073. return material;
  4074. }
  4075. `;var QN=`uniform vec4 fadeInColor;
  4076. uniform vec4 fadeOutColor;
  4077. uniform float maximumDistance;
  4078. uniform bool repeat;
  4079. uniform vec2 fadeDirection;
  4080. uniform vec2 time;
  4081. float getTime(float t, float coord)
  4082. {
  4083. float scalar = 1.0 / maximumDistance;
  4084. float q = distance(t, coord) * scalar;
  4085. if (repeat)
  4086. {
  4087. float r = distance(t, coord + 1.0) * scalar;
  4088. float s = distance(t, coord - 1.0) * scalar;
  4089. q = min(min(r, s), q);
  4090. }
  4091. return clamp(q, 0.0, 1.0);
  4092. }
  4093. czm_material czm_getMaterial(czm_materialInput materialInput)
  4094. {
  4095. czm_material material = czm_getDefaultMaterial(materialInput);
  4096. vec2 st = materialInput.st;
  4097. float s = getTime(time.x, st.s) * fadeDirection.s;
  4098. float t = getTime(time.y, st.t) * fadeDirection.t;
  4099. float u = length(vec2(s, t));
  4100. vec4 color = mix(fadeInColor, fadeOutColor, u);
  4101. color = czm_gammaCorrect(color);
  4102. material.emission = color.rgb;
  4103. material.alpha = color.a;
  4104. return material;
  4105. }
  4106. `;var $N=`uniform vec4 color;
  4107. uniform float cellAlpha;
  4108. uniform vec2 lineCount;
  4109. uniform vec2 lineThickness;
  4110. uniform vec2 lineOffset;
  4111. czm_material czm_getMaterial(czm_materialInput materialInput)
  4112. {
  4113. czm_material material = czm_getDefaultMaterial(materialInput);
  4114. vec2 st = materialInput.st;
  4115. float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);
  4116. scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
  4117. float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);
  4118. scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
  4119. float value;
  4120. // Fuzz Factor - Controls blurriness of lines
  4121. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  4122. const float fuzz = 1.2;
  4123. vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;
  4124. // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.
  4125. vec2 dx = abs(dFdx(st));
  4126. vec2 dy = abs(dFdy(st));
  4127. vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;
  4128. value = min(
  4129. smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
  4130. smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
  4131. #else
  4132. // If no derivatives available (IE 10?), revert to view-dependent fuzz
  4133. const float fuzz = 0.05;
  4134. vec2 range = 0.5 - (lineThickness * 0.05);
  4135. value = min(
  4136. 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),
  4137. 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));
  4138. #endif
  4139. // Edges taken from RimLightingMaterial.glsl
  4140. // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
  4141. float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));
  4142. float sRim = smoothstep(0.8, 1.0, dRim);
  4143. value *= (1.0 - sRim);
  4144. vec4 halfColor;
  4145. halfColor.rgb = color.rgb * 0.5;
  4146. halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));
  4147. halfColor = czm_gammaCorrect(halfColor);
  4148. material.diffuse = halfColor.rgb;
  4149. material.emission = halfColor.rgb;
  4150. material.alpha = halfColor.a;
  4151. return material;
  4152. }
  4153. `;var JN=`uniform sampler2D image;
  4154. uniform float strength;
  4155. uniform vec2 repeat;
  4156. czm_material czm_getMaterial(czm_materialInput materialInput)
  4157. {
  4158. czm_material material = czm_getDefaultMaterial(materialInput);
  4159. vec4 textureValue = texture(image, fract(repeat * materialInput.st));
  4160. vec3 normalTangentSpace = textureValue.channels;
  4161. normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;
  4162. normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);
  4163. normalTangentSpace = normalize(normalTangentSpace);
  4164. vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
  4165. material.normal = normalEC;
  4166. return material;
  4167. }
  4168. `;var ZN=`uniform vec4 color;
  4169. float getPointOnLine(vec2 p0, vec2 p1, float x)
  4170. {
  4171. float slope = (p0.y - p1.y) / (p0.x - p1.x);
  4172. return slope * (x - p0.x) + p0.y;
  4173. }
  4174. czm_material czm_getMaterial(czm_materialInput materialInput)
  4175. {
  4176. czm_material material = czm_getDefaultMaterial(materialInput);
  4177. vec2 st = materialInput.st;
  4178. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  4179. float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
  4180. #else
  4181. // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head
  4182. float base = 0.975;
  4183. #endif
  4184. vec2 center = vec2(1.0, 0.5);
  4185. float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);
  4186. float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);
  4187. float halfWidth = 0.15;
  4188. float s = step(0.5 - halfWidth, st.t);
  4189. s *= 1.0 - step(0.5 + halfWidth, st.t);
  4190. s *= 1.0 - step(base, st.s);
  4191. float t = step(base, materialInput.st.s);
  4192. t *= 1.0 - step(ptOnUpperLine, st.t);
  4193. t *= step(ptOnLowerLine, st.t);
  4194. // Find the distance from the closest separator (region between two colors)
  4195. float dist;
  4196. if (st.s < base)
  4197. {
  4198. float d1 = abs(st.t - (0.5 - halfWidth));
  4199. float d2 = abs(st.t - (0.5 + halfWidth));
  4200. dist = min(d1, d2);
  4201. }
  4202. else
  4203. {
  4204. float d1 = czm_infinity;
  4205. if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)
  4206. {
  4207. d1 = abs(st.s - base);
  4208. }
  4209. float d2 = abs(st.t - ptOnUpperLine);
  4210. float d3 = abs(st.t - ptOnLowerLine);
  4211. dist = min(min(d1, d2), d3);
  4212. }
  4213. vec4 outsideColor = vec4(0.0);
  4214. vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));
  4215. vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);
  4216. outColor = czm_gammaCorrect(outColor);
  4217. material.diffuse = outColor.rgb;
  4218. material.alpha = outColor.a;
  4219. return material;
  4220. }
  4221. `;var eF=`uniform vec4 color;
  4222. uniform vec4 gapColor;
  4223. uniform float dashLength;
  4224. uniform float dashPattern;
  4225. in float v_polylineAngle;
  4226. const float maskLength = 16.0;
  4227. mat2 rotate(float rad) {
  4228. float c = cos(rad);
  4229. float s = sin(rad);
  4230. return mat2(
  4231. c, s,
  4232. -s, c
  4233. );
  4234. }
  4235. czm_material czm_getMaterial(czm_materialInput materialInput)
  4236. {
  4237. czm_material material = czm_getDefaultMaterial(materialInput);
  4238. vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;
  4239. // Get the relative position within the dash from 0 to 1
  4240. float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
  4241. // Figure out the mask index.
  4242. float maskIndex = floor(dashPosition * maskLength);
  4243. // Test the bit mask.
  4244. float maskTest = floor(dashPattern / pow(2.0, maskIndex));
  4245. vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
  4246. if (fragColor.a < 0.005) { // matches 0/255 and 1/255
  4247. discard;
  4248. }
  4249. fragColor = czm_gammaCorrect(fragColor);
  4250. material.emission = fragColor.rgb;
  4251. material.alpha = fragColor.a;
  4252. return material;
  4253. }
  4254. `;var tF=`uniform vec4 color;
  4255. uniform float glowPower;
  4256. uniform float taperPower;
  4257. czm_material czm_getMaterial(czm_materialInput materialInput)
  4258. {
  4259. czm_material material = czm_getDefaultMaterial(materialInput);
  4260. vec2 st = materialInput.st;
  4261. float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);
  4262. if (taperPower <= 0.99999) {
  4263. glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));
  4264. }
  4265. vec4 fragColor;
  4266. fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
  4267. fragColor.a = clamp(0.0, 1.0, glow) * color.a;
  4268. fragColor = czm_gammaCorrect(fragColor);
  4269. material.emission = fragColor.rgb;
  4270. material.alpha = fragColor.a;
  4271. return material;
  4272. }
  4273. `;var nF=`uniform vec4 color;
  4274. uniform vec4 outlineColor;
  4275. uniform float outlineWidth;
  4276. in float v_width;
  4277. czm_material czm_getMaterial(czm_materialInput materialInput)
  4278. {
  4279. czm_material material = czm_getDefaultMaterial(materialInput);
  4280. vec2 st = materialInput.st;
  4281. float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;
  4282. float b = step(0.5 - halfInteriorWidth, st.t);
  4283. b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);
  4284. // Find the distance from the closest separator (region between two colors)
  4285. float d1 = abs(st.t - (0.5 - halfInteriorWidth));
  4286. float d2 = abs(st.t - (0.5 + halfInteriorWidth));
  4287. float dist = min(d1, d2);
  4288. vec4 currentColor = mix(outlineColor, color, b);
  4289. vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
  4290. outColor = czm_gammaCorrect(outColor);
  4291. material.diffuse = outColor.rgb;
  4292. material.alpha = outColor.a;
  4293. return material;
  4294. }
  4295. `;var iF=`uniform vec4 color;
  4296. uniform vec4 rimColor;
  4297. uniform float width;
  4298. czm_material czm_getMaterial(czm_materialInput materialInput)
  4299. {
  4300. czm_material material = czm_getDefaultMaterial(materialInput);
  4301. // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
  4302. float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));
  4303. float s = smoothstep(1.0 - width, 1.0, d);
  4304. vec4 outColor = czm_gammaCorrect(color);
  4305. vec4 outRimColor = czm_gammaCorrect(rimColor);
  4306. material.diffuse = outColor.rgb;
  4307. material.emission = outRimColor.rgb * s;
  4308. material.alpha = mix(outColor.a, outRimColor.a, s);
  4309. return material;
  4310. }
  4311. `;var oF=`uniform sampler2D image;
  4312. czm_material czm_getMaterial(czm_materialInput materialInput)
  4313. {
  4314. czm_material material = czm_getDefaultMaterial(materialInput);
  4315. vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
  4316. rampColor = czm_gammaCorrect(rampColor);
  4317. material.diffuse = rampColor.rgb;
  4318. material.alpha = rampColor.a;
  4319. return material;
  4320. }
  4321. `;var rF=`uniform vec4 evenColor;
  4322. uniform vec4 oddColor;
  4323. uniform float offset;
  4324. uniform float repeat;
  4325. uniform bool horizontal;
  4326. czm_material czm_getMaterial(czm_materialInput materialInput)
  4327. {
  4328. czm_material material = czm_getDefaultMaterial(materialInput);
  4329. // Based on the Stripes Fragment Shader in the Orange Book (11.1.2)
  4330. float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));
  4331. float value = fract((coord - offset) * (repeat * 0.5));
  4332. float dist = min(value, min(abs(value - 0.5), 1.0 - value));
  4333. vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));
  4334. vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);
  4335. color = czm_gammaCorrect(color);
  4336. material.diffuse = color.rgb;
  4337. material.alpha = color.a;
  4338. return material;
  4339. }
  4340. `;var aF=`uniform vec4 waterColor;
  4341. uniform vec4 landColor;
  4342. czm_material czm_getMaterial(czm_materialInput materialInput)
  4343. {
  4344. czm_material material = czm_getDefaultMaterial(materialInput);
  4345. vec4 outColor = mix(landColor, waterColor, materialInput.waterMask);
  4346. outColor = czm_gammaCorrect(outColor);
  4347. material.diffuse = outColor.rgb;
  4348. material.alpha = outColor.a;
  4349. return material;
  4350. }
  4351. `;var sF=`// Thanks for the contribution Jonas
  4352. // http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
  4353. uniform sampler2D specularMap;
  4354. uniform sampler2D normalMap;
  4355. uniform vec4 baseWaterColor;
  4356. uniform vec4 blendColor;
  4357. uniform float frequency;
  4358. uniform float animationSpeed;
  4359. uniform float amplitude;
  4360. uniform float specularIntensity;
  4361. uniform float fadeFactor;
  4362. czm_material czm_getMaterial(czm_materialInput materialInput)
  4363. {
  4364. czm_material material = czm_getDefaultMaterial(materialInput);
  4365. float time = czm_frameNumber * animationSpeed;
  4366. // fade is a function of the distance from the fragment and the frequency of the waves
  4367. float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);
  4368. float specularMapValue = texture(specularMap, materialInput.st).r;
  4369. // note: not using directional motion at this time, just set the angle to 0.0;
  4370. vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
  4371. vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));
  4372. // fade out the normal perturbation as we move further from the water surface
  4373. normalTangentSpace.xy /= fade;
  4374. // attempt to fade out the normal perturbation as we approach non water areas (low specular map value)
  4375. normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);
  4376. normalTangentSpace = normalize(normalTangentSpace);
  4377. // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane
  4378. float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);
  4379. // fade out water effect as specular map value decreases
  4380. material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;
  4381. // base color is a blend of the water and non-water color based on the value from the specular map
  4382. // may need a uniform blend factor to better control this
  4383. material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);
  4384. // diffuse highlights are based on how perturbed the normal is
  4385. material.diffuse += (0.1 * tsPerturbationRatio);
  4386. material.diffuse = material.diffuse;
  4387. material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);
  4388. material.specular = specularIntensity;
  4389. material.shininess = 10.0;
  4390. return material;
  4391. }
  4392. `;function $e(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=e.minificationFilter??Vt.LINEAR,this._magnificationFilter=e.magnificationFilter??ti.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,this._initializationPromises=[],this._initializationError=void 0,T3e(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l($e._uniformList[this.type])||($e._uniformList[this.type]=Object.keys(this._uniforms))}$e._uniformList={};$e.fromType=function(e,t){let n=new $e({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};$e.fromTypeAsync=async function(e,t){let n=[],i=new $e({fabric:{type:e,uniforms:t}});if(gse(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function gse(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];gse(o,t)}}$e.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};$e.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 u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(A){return A.bufferView}),u=u[0]);let d=new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Dt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let A=this.uniforms[m];A.x=p._width,A.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 u=c.images,f=new oa({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let a=this._updateFunctions;for(o=a.length,t=0;t<o;++t)a[t](this,e);let s=this.materials;for(let c in s)s.hasOwnProperty(c)&&s[c].update(e)};$e.prototype.isDestroyed=function(){return!1};$e.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 fe(this)};function T3e(e,t){e=e??G.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=qe(e.fabric??G.EMPTY_OBJECT),t.fabric=qe(e.fabric??G.EMPTY_OBJECT),t._template.uniforms=qe(t._template.uniforms??G.EMPTY_OBJECT),t._template.materials=qe(t._template.materials??G.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Hn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=$e._materialCache.getMaterial(t.type);if(l(i)){let r=qe(i.fabric,!0);t._template=It(t._template,r,!0),n=i.translucent}S3e(t),I3e(t),O3e(t),B3e(t),l(i)||$e._materialCache.addMaterial(t.type,t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=n??o,n=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 HW(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 mse(e,t){}function C3e(e,t){}var E3e=["type","materials","uniforms","components","source"],v3e=["diffuse","specular","shininess","normal","emission","alpha"];function S3e(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;HW(t,E3e,mse,!0),HW(o,v3e,mse,!0);let r=[];for(let a in i)i.hasOwnProperty(a)&&r.push(a);HW(n,r,C3e,!1)}function w3e(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 I3e(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
  4393. `;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
  4394. {
  4395. `,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
  4396. `,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 a=i&&w3e(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${a};
  4397. `}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
  4398. `:e.shaderSource+=`material.${o} = ${t[o]};
  4399. `}e.shaderSource+=`return material;
  4400. }
  4401. `}}var pse={mat2:Wi,mat3:$,mat4:R},D3e=/\.ktx2$/i;function P3e(e){let t;return function(n,i){let o=n.uniforms,r=o[e],a=t!==r,s=!l(r)||r===$e.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(a&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let d=new jt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Dt({context:i,source:r,sampler:d}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Dt&&r!==c){n._texturePaths[e]=void 0;let d=n._textures[e];l(d)&&d!==n._defaultTexture&&d.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(a&&l(c)&&s&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),!s){if((r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof ImageBitmap||r instanceof OffscreenCanvas)&&r!==n._texturePaths[e]){n._loadedImages.push({id:e,image:r}),n._texturePaths[e]=r;return}_se(n,e)}}}function _se(e,t){let i=e.uniforms[t];if(i===$e.DefaultImageId)return Promise.resolve();let o=De.createIfNeeded(i);if(!(o instanceof De))return Promise.resolve();let r=De.createIfNeeded(e._texturePaths[t]);if(!(!l(r)||r.url!==o.url))return Promise.resolve();let s;return D3e.test(o.url)?s=Hu(o.url):s=o.fetchImage(),Promise.resolve(s).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,s}function R3e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof oa){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),Ase(t,e)}}function Ase(e,t){let i=e.uniforms[t];if(i===$e.DefaultCubeMapId)return Promise.resolve();let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o===e._texturePaths[t])return Promise.resolve();let r=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],a=Promise.all(r);return a.then(function(s){e._loadedCubeMaps.push({id:t,images:s})}).catch(function(s){e._initializationError=s}),e._texturePaths[t]=o,a}function O3e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&yse(e,n)}function yse(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=M3e(o),a;if(r==="channels")a=iI(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;L3e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},yse(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(a=iI(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(P3e(t)),e._initializationPromises.push(_se(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(R3e(t)),e._initializationPromises.push(Ase(e,t));else if(r.indexOf("mat")!==-1){let u=new pse[r];e._uniforms[c]=function(){return pse[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function M3e(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 De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===$e.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 B3e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new $e({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=It(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",a=`${r}_${e._count++}`;iI(o,r,a),e.shaderSource=o.shaderSource+e.shaderSource;let s=`${a}(materialInput)`,c=iI(e,i,s)}}function iI(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",a=`([\\w${i?".":""}])?`,s=new RegExp(a+t+r,"g");return e.shaderSource=e.shaderSource.replace(s,function(c,u,f){return u||f?c:(o+=1,n)}),o}function L3e(e,t,n){return iI(e,t,t,n)}$e._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};$e.DefaultImageId="czm_defaultImage";$e.DefaultCubeMapId="czm_defaultCubeMap";$e.ColorType="Color";$e._materialCache.addMaterial($e.ColorType,{fabric:{type:$e.ColorType,uniforms:{color:new U(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});$e.ImageType="Image";$e._materialCache.addMaterial($e.ImageType,{fabric:{type:$e.ImageType,uniforms:{image:$e.DefaultImageId,repeat:new z(1,1),color:new U(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}});$e.DiffuseMapType="DiffuseMap";$e._materialCache.addMaterial($e.DiffuseMapType,{fabric:{type:$e.DiffuseMapType,uniforms:{image:$e.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});$e.AlphaMapType="AlphaMap";$e._materialCache.addMaterial($e.AlphaMapType,{fabric:{type:$e.AlphaMapType,uniforms:{image:$e.DefaultImageId,channel:"a",repeat:new z(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});$e.SpecularMapType="SpecularMap";$e._materialCache.addMaterial($e.SpecularMapType,{fabric:{type:$e.SpecularMapType,uniforms:{image:$e.DefaultImageId,channel:"r",repeat:new z(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});$e.EmissionMapType="EmissionMap";$e._materialCache.addMaterial($e.EmissionMapType,{fabric:{type:$e.EmissionMapType,uniforms:{image:$e.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});$e.BumpMapType="BumpMap";$e._materialCache.addMaterial($e.BumpMapType,{fabric:{type:$e.BumpMapType,uniforms:{image:$e.DefaultImageId,channel:"r",strength:.8,repeat:new z(1,1)},source:HN},translucent:!1});$e.NormalMapType="NormalMap";$e._materialCache.addMaterial($e.NormalMapType,{fabric:{type:$e.NormalMapType,uniforms:{image:$e.DefaultImageId,channels:"rgb",strength:.8,repeat:new z(1,1)},source:JN},translucent:!1});$e.GridType="Grid";$e._materialCache.addMaterial($e.GridType,{fabric:{type:$e.GridType,uniforms:{color:new U(0,1,0,1),cellAlpha:.1,lineCount:new z(8,8),lineThickness:new z(1,1),lineOffset:new z(0,0)},source:$N},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});$e.StripeType="Stripe";$e._materialCache.addMaterial($e.StripeType,{fabric:{type:$e.StripeType,uniforms:{horizontal:!0,evenColor:new U(1,1,1,.5),oddColor:new U(0,0,1,.5),offset:0,repeat:5},source:rF},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});$e.CheckerboardType="Checkerboard";$e._materialCache.addMaterial($e.CheckerboardType,{fabric:{type:$e.CheckerboardType,uniforms:{lightColor:new U(1,1,1,.5),darkColor:new U(0,0,0,.5),repeat:new z(5,5)},source:WN},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});$e.DotType="Dot";$e._materialCache.addMaterial($e.DotType,{fabric:{type:$e.DotType,uniforms:{lightColor:new U(1,1,0,.75),darkColor:new U(0,1,1,.75),repeat:new z(5,5)},source:qN},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});$e.WaterType="Water";$e._materialCache.addMaterial($e.WaterType,{fabric:{type:$e.WaterType,uniforms:{baseWaterColor:new U(.2,.3,.6,1),blendColor:new U(0,1,.699,1),specularMap:$e.DefaultImageId,normalMap:$e.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:sF},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});$e.RimLightingType="RimLighting";$e._materialCache.addMaterial($e.RimLightingType,{fabric:{type:$e.RimLightingType,uniforms:{color:new U(1,0,0,.7),rimColor:new U(1,1,1,.4),width:.3},source:iF},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});$e.FadeType="Fade";$e._materialCache.addMaterial($e.FadeType,{fabric:{type:$e.FadeType,uniforms:{fadeInColor:new U(1,0,0,1),fadeOutColor:new U(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new z(.5,.5)},source:QN},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});$e.PolylineArrowType="PolylineArrow";$e._materialCache.addMaterial($e.PolylineArrowType,{fabric:{type:$e.PolylineArrowType,uniforms:{color:new U(1,1,1,1)},source:ZN},translucent:!0});$e.PolylineDashType="PolylineDash";$e._materialCache.addMaterial($e.PolylineDashType,{fabric:{type:$e.PolylineDashType,uniforms:{color:new U(1,0,1,1),gapColor:new U(0,0,0,0),dashLength:16,dashPattern:255},source:eF},translucent:!0});$e.PolylineGlowType="PolylineGlow";$e._materialCache.addMaterial($e.PolylineGlowType,{fabric:{type:$e.PolylineGlowType,uniforms:{color:new U(0,.5,1,1),glowPower:.25,taperPower:1},source:tF},translucent:!0});$e.PolylineOutlineType="PolylineOutline";$e._materialCache.addMaterial($e.PolylineOutlineType,{fabric:{type:$e.PolylineOutlineType,uniforms:{color:new U(1,1,1,1),outlineColor:new U(1,0,0,1),outlineWidth:1},source:nF},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});$e.ElevationContourType="ElevationContour";$e._materialCache.addMaterial($e.ElevationContourType,{fabric:{type:$e.ElevationContourType,uniforms:{spacing:100,color:new U(1,0,0,1),width:1},source:XN},translucent:!1});$e.ElevationRampType="ElevationRamp";$e._materialCache.addMaterial($e.ElevationRampType,{fabric:{type:$e.ElevationRampType,uniforms:{image:$e.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:KN},translucent:!1});$e.SlopeRampMaterialType="SlopeRamp";$e._materialCache.addMaterial($e.SlopeRampMaterialType,{fabric:{type:$e.SlopeRampMaterialType,uniforms:{image:$e.DefaultImageId},source:oF},translucent:!1});$e.AspectRampMaterialType="AspectRamp";$e._materialCache.addMaterial($e.AspectRampMaterialType,{fabric:{type:$e.AspectRampMaterialType,uniforms:{image:$e.DefaultImageId},source:GN},translucent:!1});$e.ElevationBandType="ElevationBand";$e._materialCache.addMaterial($e.ElevationBandType,{fabric:{type:$e.ElevationBandType,uniforms:{heights:$e.DefaultImageId,colors:$e.DefaultImageId},source:YN},translucent:!0});$e.WaterMaskType="WaterMask";$e._materialCache.addMaterial($e.WaterMaskType,{fabric:{type:$e.WaterMaskType,source:aF,uniforms:{waterColor:new U(1,1,1,1),landColor:new U(0,0,0,0)}},translucent:!1});var qi=$e;function Gy(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Gy.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:qi.fromType(qi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=xo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(Gy.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}}});Gy.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;Gy.prototype.isTranslucent=xo.prototype.isTranslucent;Gy.prototype.getRenderState=xo.prototype.getRenderState;Gy.MaterialSupport={BASIC:Object.freeze({vertexFormat:Ne.POSITION_AND_NORMAL,vertexShaderSource:UN,fragmentShaderSource:zN}),TEXTURED:Object.freeze({vertexFormat:Ne.POSITION_NORMAL_AND_ST,vertexShaderSource:jN,fragmentShaderSource:VN}),ALL:Object.freeze({vertexFormat:Ne.ALL,vertexShaderSource:kN,fragmentShaderSource:FN})};var go=Gy;var cF=`in vec3 v_positionEC;
  4402. in vec3 v_normalEC;
  4403. in vec4 v_color;
  4404. void main()
  4405. {
  4406. vec3 positionToEyeEC = -v_positionEC;
  4407. vec3 normalEC = normalize(v_normalEC);
  4408. #ifdef FACE_FORWARD
  4409. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  4410. #endif
  4411. vec4 color = czm_gammaCorrect(v_color);
  4412. czm_materialInput materialInput;
  4413. materialInput.normalEC = normalEC;
  4414. materialInput.positionToEyeEC = positionToEyeEC;
  4415. czm_material material = czm_getDefaultMaterial(materialInput);
  4416. material.diffuse = color.rgb;
  4417. material.alpha = color.a;
  4418. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  4419. }
  4420. `;var lF=`in vec3 position3DHigh;
  4421. in vec3 position3DLow;
  4422. in vec3 normal;
  4423. in vec4 color;
  4424. in float batchId;
  4425. out vec3 v_positionEC;
  4426. out vec3 v_normalEC;
  4427. out vec4 v_color;
  4428. void main()
  4429. {
  4430. vec4 p = czm_computePosition();
  4431. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  4432. v_normalEC = czm_normal * normal; // normal in eye coordinates
  4433. v_color = color;
  4434. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  4435. }
  4436. `;var oC=`in vec4 v_color;
  4437. void main()
  4438. {
  4439. out_FragColor = czm_gammaCorrect(v_color);
  4440. }
  4441. `;var uF=`in vec3 position3DHigh;
  4442. in vec3 position3DLow;
  4443. in vec4 color;
  4444. in float batchId;
  4445. out vec4 v_color;
  4446. void main()
  4447. {
  4448. vec4 p = czm_computePosition();
  4449. v_color = color;
  4450. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  4451. }
  4452. `;function h0(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?uF:lF,r=i?oC:cF,a=i?h0.FLAT_VERTEX_FORMAT:h0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=xo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=a,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(h0.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}}});h0.VERTEX_FORMAT=Ne.POSITION_AND_NORMAL;h0.FLAT_VERTEX_FORMAT=Ne.POSITION_ONLY;h0.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;h0.prototype.isTranslucent=xo.prototype.isTranslucent;h0.prototype.getRenderState=xo.prototype.getRenderState;var hn=h0;function rC(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(rC.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:pe("color")});rC.prototype.getType=function(e){return"Color"};var N3e=new Q;rC.prototype.getValue=function(e,t){return l(e)||(e=Q.now(N3e)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};rC.prototype.equals=function(e){return this===e||e instanceof rC&&X.equals(this._color,e._color)};var Wt=rC;var WW=class{constructor(t){t=t??G.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??te.default,this._rectangle=t.rectangle??oe.MAX_VALUE,this._projection=new Hi(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=D.toDegrees(t.west),o=D.toDegrees(t.south),r=D.toDegrees(t.east),a=D.toDegrees(t.north);return l(n)?(n.west=i,n.south=o,n.east=r,n.north=a,n):new oe(i,o,r,a)}tileXYToNativeRectangle(t,n,i,o){let r=this.tileXYToRectangle(t,n,i,o);return r.west=D.toDegrees(r.west),r.south=D.toDegrees(r.south),r.east=D.toDegrees(r.east),r.north=D.toDegrees(r.north),r}tileXYToRectangle(t,n,i,o){let r=this._rectangle,a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),c=r.width/a,u=t*c+r.west,f=(t+1)*c+r.west,d=r.height/s,p=r.north-n*d,g=r.north-(n+1)*d;return l(o)||(o=new oe(u,g,f,p)),o.west=u,o.south=g,o.east=f,o.north=p,o}positionToTileXY(t,n,i){let o=this._rectangle;if(!oe.contains(o,t))return;let r=this.getNumberOfXTilesAtLevel(n),a=this.getNumberOfYTilesAtLevel(n),s=o.width/r,c=o.height/a,u=t.longitude;o.east<o.west&&(u+=D.TWO_PI);let f=(u-o.west)/s|0;f>=r&&(f=r-1);let d=(o.north-t.latitude)/c|0;return d>=a&&(d=a-1),l(i)?(i.x=f,i.y=d,i):new z(f,d)}},Yi=WW;var xse=new h,bse=new h,Tse=new de,qW=new h,F3e=new h,Cse=new ce,k3e=new Yi,oI=[new de,new de,new de,new de],rI=new z,_a={};_a.initialize=function(){let e=_a._initPromise;return l(e)||(e=De.fetchJson(Xt("Assets/approximateTerrainHeights.json")).then(function(t){_a._terrainHeights=t}),_a._initPromise=e),e};_a.getMinimumMaximumHeights=function(e,t){t=t??te.default;let n=Ese(e),i=_a._defaultMinTerrainHeight,o=_a._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,a=_a._terrainHeights[r];l(a)&&(i=a[0],o=a[1]),t.cartographicToCartesian(oe.northeast(e,Tse),xse),t.cartographicToCartesian(oe.southwest(e,Tse),bse),h.midpoint(bse,xse,qW);let s=t.scaleToGeodeticSurface(qW,F3e);if(l(s)){let c=h.distance(qW,s);i=Math.min(i,-c)}else i=_a._defaultMinTerrainHeight}return i=Math.max(_a._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};_a.getBoundingSphere=function(e,t){t=t??te.default;let n=Ese(e),i=_a._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,a=_a._terrainHeights[r];l(a)&&(i=a[1])}let o=ce.fromRectangle3D(e,t,0);return ce.fromRectangle3D(e,t,i,Cse),ce.union(o,Cse,o)};function Ese(e){de.fromRadians(e.east,e.north,0,oI[0]),de.fromRadians(e.west,e.north,0,oI[1]),de.fromRadians(e.east,e.south,0,oI[2]),de.fromRadians(e.west,e.south,0,oI[3]);let t=0,n=0,i=0,o=0,r=_a._terrainHeightsMaxLevel,a;for(a=0;a<=r;++a){let s=!1;for(let c=0;c<4;++c){let u=oI[c];if(k3e.positionToTileXY(u,a,rI),c===0)i=rI.x,o=rI.y;else if(i!==rI.x||o!==rI.y){s=!0;break}}if(s)break;t=i,n=o}if(a!==0)return{x:t,y:n,level:a>r?r:a-1}}_a._terrainHeightsMaxLevel=6;_a._defaultMaxTerrainHeight=9e3;_a._defaultMinTerrainHeight=-1e5;_a._terrainHeights=void 0;_a._initPromise=void 0;Object.defineProperties(_a,{initialized:{get:function(){return l(_a._terrainHeights)}}});var wi=_a;function Gs(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Gs.fromCorners=function(e,t,n){return l(n)||(n=new Gs),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Gs.fromPoints=function(e,t){if(l(t)||(t=new Gs),!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,a=e[0].y,s=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,A=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(m,i),a=Math.max(m,a),o=Math.min(A,o),s=Math.max(A,s)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=a,f.z=s,t.center=h.midpoint(u,f,t.center),t};Gs.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 Gs(e.minimum,e.maximum,e.center)};Gs.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 fF=new h;Gs.intersectPlane=function(e,t){fF=h.subtract(e.maximum,e.minimum,fF);let n=h.multiplyByScalar(fF,.5,fF),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?qt.INSIDE:r+o<0?qt.OUTSIDE:qt.INTERSECTING};Gs.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};Gs.prototype.clone=function(e){return Gs.clone(this,e)};Gs.prototype.intersectPlane=function(e){return Gs.intersectPlane(this,e)};Gs.prototype.intersectAxisAlignedBoundingBox=function(e){return Gs.intersectAxisAlignedBoundingBox(this,e)};Gs.prototype.equals=function(e){return Gs.equals(this,e)};var Xf=Gs;var YW=new se;function wm(e,t){t=t??te.default,e=t.scaleToGeodeticSurface(e);let n=pt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(R.getColumn(n,0,YW)),this._yAxis=h.fromCartesian4(R.getColumn(n,1,YW));let i=h.fromCartesian4(R.getColumn(n,2,YW));this._plane=tn.fromPointNormal(e,i)}Object.defineProperties(wm.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 z3e=new Xf;wm.fromPoints=function(e,t){let n=Xf.fromPoints(e,z3e);return new wm(n.center,t)};var vse=new An,dF=new h;wm.prototype.projectPointOntoPlane=function(e,t){let n=vse;n.origin=e,h.normalize(e,n.direction);let i=ui.rayPlane(n,this._plane,dF);if(l(i)||(h.negate(n.direction,n.direction),i=ui.rayPlane(n,this._plane,dF)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),a=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=a,t):new z(r,a)}};wm.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};wm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new z);let n=vse;n.origin=e,h.clone(this._plane.normal,n.direction);let i=ui.rayPlane(n,this._plane,dF);l(i)||(h.negate(n.direction,n.direction),i=ui.rayPlane(n,this._plane,dF));let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),a=h.dot(this._yAxis,o);return t.x=r,t.y=a,t};wm.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 U3e=new h;wm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,a=U3e;return h.multiplyByScalar(o,e.x,a),t=h.add(i,a,t),h.multiplyByScalar(r,e.y,a),h.add(t,a,t),n.scaleToGeocentricSurface(t,t),t};wm.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 za=wm;function Xi(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}Xi.packedLength=h.packedLength+$.packedLength;Xi.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};Xi.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Xi),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var V3e=new h,j3e=new h,G3e=new h,H3e=new h,W3e=new h,q3e=new h,Y3e=new $,X3e={unitary:new $,diagonal:new $};Xi.fromPoints=function(e,t){if(l(t)||(t=new Xi),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,o=h.clone(e[0],V3e);for(n=1;n<i;n++)h.add(o,e[n],o);let r=1/i;h.multiplyByScalar(o,r,o);let a=0,s=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],o,j3e),a+=p.x*p.x,s+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;a*=r,s*=r,c*=r,u*=r,f*=r,d*=r;let g=Y3e;g[0]=a,g[1]=s,g[2]=c,g[3]=s,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,X3e),A=$.clone(m.unitary,t.halfAxes),y=$.getColumn(A,0,H3e),x=$.getColumn(A,1,W3e),b=$.getColumn(A,2,q3e),T=-Number.MAX_VALUE,E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,w=Number.MAX_VALUE,P=Number.MAX_VALUE,O=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(h.dot(y,p),T),E=Math.max(h.dot(x,p),E),S=Math.max(h.dot(b,p),S),w=Math.min(h.dot(y,p),w),P=Math.min(h.dot(x,p),P),O=Math.min(h.dot(b,p),O);y=h.multiplyByScalar(y,.5*(w+T),y),x=h.multiplyByScalar(x,.5*(P+E),x),b=h.multiplyByScalar(b,.5*(O+S),b);let B=h.add(y,x,t.center);h.add(B,b,B);let L=G3e;return L.x=T-w,L.y=E-P,L.z=S-O,h.multiplyByScalar(L,.5,L),$.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var Rse=new h,K3e=new h;function Sse(e,t,n,i,o,r,a,s,c,u,f){l(f)||(f=new Xi);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=Rse;p.x=(o+r)/2,p.y=(a+s)/2,p.z=(c+u)/2;let g=K3e;g.x=(r-o)/2,g.y=(s-a)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var wse=new de,Q3e=new h,$3e=new de,J3e=new de,Z3e=new de,eze=new de,tze=new de,nze=new h,Ise=new h,ize=new h,Dse=new h,oze=new h,rze=new z,aze=new z,sze=new z,cze=new z,lze=new z,uze=new h,fze=new h,dze=new h,hze=new h,mze=new z,pze=new h,gze=new h,_ze=new h,Aze=new tn(h.UNIT_X,0);Xi.fromRectangle=function(e,t,n,i,o){t=t??0,n=n??0,i=i??te.default;let r,a,s,c,u,f,d;if(e.width<=D.PI){let P=oe.center(e,wse),O=i.cartographicToCartesian(P,Q3e),B=new za(O,i);d=B.plane;let L=P.longitude,_=e.south<0&&e.north>0?0:P.latitude,C=de.fromRadians(L,e.north,n,$3e),v=de.fromRadians(e.west,e.north,n,J3e),I=de.fromRadians(e.west,_,n,Z3e),M=de.fromRadians(e.west,e.south,n,eze),N=de.fromRadians(L,e.south,n,tze),j=i.cartographicToCartesian(C,nze),k=i.cartographicToCartesian(v,Ise),V=i.cartographicToCartesian(I,ize),F=i.cartographicToCartesian(M,Dse),W=i.cartographicToCartesian(N,oze),q=B.projectPointToNearestOnPlane(j,rze),J=B.projectPointToNearestOnPlane(k,aze),H=B.projectPointToNearestOnPlane(V,sze),Z=B.projectPointToNearestOnPlane(F,cze),K=B.projectPointToNearestOnPlane(W,lze);return r=Math.min(J.x,H.x,Z.x),a=-r,c=Math.max(J.y,q.y),s=Math.min(Z.y,K.y),v.height=M.height=t,k=i.cartographicToCartesian(v,Ise),F=i.cartographicToCartesian(M,Dse),u=Math.min(tn.getPointDistance(d,k),tn.getPointDistance(d,F)),f=n,Sse(B.origin,B.xAxis,B.yAxis,B.zAxis,r,a,s,c,u,f,o)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,A=oe.center(e,wse).longitude,y=h.fromRadians(A,m,n,i,uze);y.z=0;let b=Math.abs(y.x)<D.EPSILON10&&Math.abs(y.y)<D.EPSILON10?h.UNIT_X:h.normalize(y,fze),T=h.UNIT_Z,E=h.cross(b,T,dze);d=tn.fromPointNormal(y,b,Aze);let S=h.fromRadians(A+D.PI_OVER_TWO,m,n,i,hze);a=h.dot(tn.projectPointOntoPlane(d,S,mze),E),r=-a,c=h.fromRadians(0,e.north,g?t:n,i,pze).z,s=h.fromRadians(0,e.south,p?t:n,i,gze).z;let w=h.fromRadians(e.east,m,n,i,_ze);return u=tn.getPointDistance(d,w),f=0,Sse(y,E,T,b,r,a,s,c,u,f,o)};Xi.fromTransformation=function(e,t){return l(t)||(t=new Xi),t.center=R.getTranslation(e,t.center),t.halfAxes=R.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Xi.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Xi(e.center,e.halfAxes)};Xi.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,a=i.y,s=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+a*o[$.COLUMN0ROW1]+s*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+a*o[$.COLUMN1ROW1]+s*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+a*o[$.COLUMN2ROW1]+s*o[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?qt.OUTSIDE:u>=c?qt.INSIDE:qt.INTERSECTING};var Ose=new h,Mse=new h,Bse=new h,yze=new h,Pse=new h,xze=new h;Xi.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Rse),i=e.halfAxes,o=$.getColumn(i,0,Ose),r=$.getColumn(i,1,Mse),a=$.getColumn(i,2,Bse),s=h.magnitude(o),c=h.magnitude(r),u=h.magnitude(a),f=!0,d=!0,p=!0;s>0?h.divideByScalar(o,s,o):f=!1,c>0?h.divideByScalar(r,c,r):d=!1,u>0?h.divideByScalar(a,u,a):p=!1;let g=!f+!d+!p,m,A,y;if(g===1){let E=o;m=r,A=a,d?p||(E=a,A=o):(E=r,m=o),y=h.cross(m,A,Pse),E===o?o=y:E===r?r=y:E===a&&(a=y)}else if(g===2){m=o,d?m=r:p&&(m=a);let E=h.UNIT_Y;E.equalsEpsilon(m,D.EPSILON3)&&(E=h.UNIT_X),A=h.cross(m,E,yze),h.normalize(A,A),y=h.cross(m,A,Pse),h.normalize(y,y),m===o?(r=A,a=y):m===r?(a=A,o=y):m===a&&(o=A,r=y)}else g===3&&(o=h.UNIT_X,r=h.UNIT_Y,a=h.UNIT_Z);let x=xze;x.x=h.dot(n,o),x.y=h.dot(n,r),x.z=h.dot(n,a);let b=0,T;return x.x<-s?(T=x.x+s,b+=T*T):x.x>s&&(T=x.x-s,b+=T*T),x.y<-c?(T=x.y+c,b+=T*T):x.y>c&&(T=x.y-c,b+=T*T),x.z<-u?(T=x.z+u,b+=T*T):x.z>u&&(T=x.z-u,b+=T*T),b};var bze=new h,Tze=new h;Xi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new ia);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=e.center,s=e.halfAxes,c=$.getColumn(s,0,Ose),u=$.getColumn(s,1,Mse),f=$.getColumn(s,2,Bse),d=h.add(c,u,bze);h.add(d,f,d),h.add(d,a,d);let p=h.subtract(d,t,Tze),g=h.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),h.add(a,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(a,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(a,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(a,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(a,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(a,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(a,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,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 Cze=new h,Eze=new h,vze=new h;Xi.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,Cze),r=$.getColumn(i,1,Eze),a=$.getColumn(i,2,vze);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],a,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],a,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],a,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],a,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],a,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],a,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],a,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],a,t[7]),t};var Sze=new $;Xi.computeTransformation=function(e,t){l(t)||(t=new R);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,Sze);return R.fromRotationTranslation(i,n,t)};var wze=new ce;Xi.isOccluded=function(e,t){let n=ce.fromOrientedBoundingBox(e,wze);return!t.isBoundingSphereVisible(n)};Xi.prototype.intersectPlane=function(e){return Xi.intersectPlane(this,e)};Xi.prototype.distanceSquaredTo=function(e){return Xi.distanceSquaredTo(this,e)};Xi.prototype.computePlaneDistances=function(e,t,n){return Xi.computePlaneDistances(this,e,t,n)};Xi.prototype.computeCorners=function(e){return Xi.computeCorners(this,e)};Xi.prototype.computeTransformation=function(e){return Xi.computeTransformation(this,e)};Xi.prototype.isOccluded=function(e){return Xi.isOccluded(this,e)};Xi.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Xi.prototype.clone=function(e){return Xi.clone(this,e)};Xi.prototype.equals=function(e){return Xi.equals(this,e)};var $t=Xi;var hF={};hF.getHeight=function(e,t,n){return(e-n)*t+n};var Ize=new de;hF.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,Ize);if(!l(r))return h.clone(e,o);let a=hF.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,a,t,o)};var ho=hF;var mF=`in vec3 position3DHigh;
  4453. in vec3 position3DLow;
  4454. in float batchId;
  4455. #ifdef EXTRUDED_GEOMETRY
  4456. in vec3 extrudeDirection;
  4457. uniform float u_globeMinimumAltitude;
  4458. #endif // EXTRUDED_GEOMETRY
  4459. #ifdef PER_INSTANCE_COLOR
  4460. out vec4 v_color;
  4461. #endif // PER_INSTANCE_COLOR
  4462. #ifdef TEXTURE_COORDINATES
  4463. #ifdef SPHERICAL
  4464. out vec4 v_sphericalExtents;
  4465. #else // SPHERICAL
  4466. out vec2 v_inversePlaneExtents;
  4467. out vec4 v_westPlane;
  4468. out vec4 v_southPlane;
  4469. #endif // SPHERICAL
  4470. out vec3 v_uvMinAndSphericalLongitudeRotation;
  4471. out vec3 v_uMaxAndInverseDistance;
  4472. out vec3 v_vMaxAndInverseDistance;
  4473. #endif // TEXTURE_COORDINATES
  4474. void main()
  4475. {
  4476. vec4 position = czm_computePosition();
  4477. #ifdef EXTRUDED_GEOMETRY
  4478. float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));
  4479. delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;
  4480. //extrudeDirection is zero for the top layer
  4481. position = position + vec4(extrudeDirection * delta, 0.0);
  4482. #endif
  4483. #ifdef TEXTURE_COORDINATES
  4484. #ifdef SPHERICAL
  4485. v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);
  4486. v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);
  4487. #else // SPHERICAL
  4488. #ifdef COLUMBUS_VIEW_2D
  4489. vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);
  4490. vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);
  4491. // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):
  4492. // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)
  4493. // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)
  4494. // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)
  4495. 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));
  4496. bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;
  4497. planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);
  4498. planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);
  4499. // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)
  4500. // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)
  4501. // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)
  4502. idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;
  4503. idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));
  4504. planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);
  4505. planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);
  4506. vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;
  4507. 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;
  4508. 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;
  4509. #else // COLUMBUS_VIEW_2D
  4510. // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction
  4511. vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;
  4512. vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;
  4513. vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;
  4514. #endif // COLUMBUS_VIEW_2D
  4515. vec3 eastWard = southEastCorner - southWestCorner;
  4516. float eastExtent = length(eastWard);
  4517. eastWard /= eastExtent;
  4518. vec3 northWard = northWestCorner - southWestCorner;
  4519. float northExtent = length(northWard);
  4520. northWard /= northExtent;
  4521. v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));
  4522. v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));
  4523. v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);
  4524. #endif // SPHERICAL
  4525. vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);
  4526. vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);
  4527. v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);
  4528. v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);
  4529. v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;
  4530. #endif // TEXTURE_COORDINATES
  4531. #ifdef PER_INSTANCE_COLOR
  4532. v_color = czm_batchTable_color(batchId);
  4533. #endif
  4534. gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
  4535. }
  4536. `;var Hy=`#ifdef VECTOR_TILE
  4537. uniform vec4 u_highlightColor;
  4538. #endif
  4539. void main(void)
  4540. {
  4541. #ifdef VECTOR_TILE
  4542. out_FragColor = czm_gammaCorrect(u_highlightColor);
  4543. #else
  4544. out_FragColor = vec4(1.0);
  4545. #endif
  4546. czm_writeDepthClamp();
  4547. }
  4548. `;var XW={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};XW.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(XW);var Yn=XW;var Lse={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS};Object.freeze(Lse);var hc=Lse;function Dze(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 pF=Dze;function m0(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=Pze(t),o=e.floatingPointTexture,r=i===je.FLOAT&&!o,a=Rze(t,r),s=Oze(a,t,r),c=Math.floor(Mt.maximumTextureSize/s),u=Math.min(n,c),f=s*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,A=m*.5;this._textureDimensions=new z(f,d),this._textureStep=new se(p,g,m,A),this._pixelDatatype=r?je.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=a,this._stride=s,this._texture=void 0;let y=4*f*d;this._batchValues=i===je.FLOAT&&!r?new Float32Array(y):new Uint8Array(y),this._batchValuesDirty=!1}Object.defineProperties(m0.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function Pze(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Y.UNSIGNED_BYTE){t=!0;break}return t?je.FLOAT:je.UNSIGNED_BYTE}function Fse(e,t){let n=e[t].componentsPerAttribute;return n===2?z:n===3?h:n===4?se:Number}function Rze(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r].componentDatatype;n[r]=i,s!==Y.UNSIGNED_BYTE&&t?i+=4:++i}return n}function Oze(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==Y.UNSIGNED_BYTE&&n?o+4:o+1}var aI=new se;function Mze(e,t,n){let i=se.unpack(e,t,aI),o=se.unpackFloat(i);i=se.unpack(e,t+4,aI);let r=se.unpackFloat(i);i=se.unpack(e,t+8,aI);let a=se.unpackFloat(i);i=se.unpack(e,t+12,aI);let s=se.unpackFloat(i);return se.fromElements(o,r,a,s,n)}function Bze(e,t,n){let i=se.packFloat(e.x,aI);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 Nse=new se;m0.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],a=4*this._stride*e+4*o,s;this._packFloats&&i[t].componentDatatype!==je.UNSIGNED_BYTE?s=Mze(this._batchValues,a,Nse):s=se.unpack(this._batchValues,a,Nse);let c=Fse(i,t);return l(c.fromCartesian4)?c.fromCartesian4(s,n):l(c.clone)?c.clone(s,n):s.x};var Lze=[void 0,void 0,new z,new h,new se],Nze=new se;m0.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=Lze[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),a=Fse(this._attributes,t);if(l(a.equals)?a.equals(r,n):r===n)return;let c=Nze;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 u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==je.UNSIGNED_BYTE?Bze(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function Fze(e,t){let n=e._textureDimensions;e._texture=new Dt({context:t,pixelFormat:Xe.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:jt.NEAREST,flipY:!1})}function kze(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}m0.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||Fze(this,e.context),kze(this))};m0.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:It(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function zze(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep;
  4549. vec2 computeSt(float batchId)
  4550. {
  4551. float stepX = batchTextureStep.x;
  4552. float centerX = batchTextureStep.y;
  4553. float numberOfAttributes = float(${t});
  4554. return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5);
  4555. }
  4556. `:`uniform vec4 batchTextureStep;
  4557. uniform vec2 batchTextureDimensions;
  4558. vec2 computeSt(float batchId)
  4559. {
  4560. float stepX = batchTextureStep.x;
  4561. float centerX = batchTextureStep.y;
  4562. float stepY = batchTextureStep.z;
  4563. float centerY = batchTextureStep.w;
  4564. float numberOfAttributes = float(${t});
  4565. float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x);
  4566. float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x);
  4567. return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
  4568. }
  4569. `}function Uze(e){return e===1?"float":`vec${e}`}function Vze(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function jze(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,a=Uze(o),s=Vze(o),c=e._offsets[t],u=`${a} ${r}(float batchId)
  4570. {
  4571. vec2 st = computeSt(batchId);
  4572. st.x += batchTextureStep.x * float(${c});
  4573. `;return e._packFloats&&i.componentDatatype!==je.UNSIGNED_BYTE?u+=`vec4 textureValue;
  4574. textureValue.x = czm_unpackFloat(texture(batchTexture, st));
  4575. textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0)));
  4576. textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0)));
  4577. textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0)));
  4578. `:u+=` vec4 textureValue = texture(batchTexture, st);
  4579. `,u+=` ${a} value = textureValue${s};
  4580. `,e._pixelDatatype===je.UNSIGNED_BYTE&&i.componentDatatype===Y.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0;
  4581. `:e._pixelDatatype===je.FLOAT&&i.componentDatatype===Y.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0;
  4582. `),u+=` return value;
  4583. }
  4584. `,u}m0.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
  4585. `;t+=`${zze(this)}
  4586. `;let n=e.length;for(let i=0;i<n;++i)t+=jze(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),a=i.substring(o);return`${r}
  4587. ${t}
  4588. ${a}`}};m0.prototype.isDestroyed=function(){return!1};m0.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),fe(this)};var aC=m0;var sI=class e{constructor(t){this._ellipsoid=t??te.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return D.PI_OVER_TWO-2*Math.atan(Math.exp(-t))}static geodeticLatitudeToMercatorAngle(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,o=t.longitude*i,r=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,a=t.height;return l(n)?(n.x=o,n.y=r,n.z=a,n):new h(o,r,a)}unproject(t,n){let i=this._oneOverSemimajorAxis,o=t.x*i,r=e.mercatorAngleToGeodeticLatitude(t.y*i),a=t.z;return l(n)?(n.longitude=o,n.latitude=r,n.height=a,n):new de(o,r,a)}};sI.MaximumLatitude=sI.mercatorAngleToGeodeticLatitude(Math.PI);var di=sI;function Gze(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let a=e[0].modelMatrix;for(r=1;r<o;++r)if(!R.equals(a,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&kn.transformToWorldCoordinates(e[r]);else R.multiplyTransformation(t,e[0].modelMatrix,t)}function KW(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let a=0;a<o;++a)r[a]=t}function Hze(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?KW(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(KW(i.westHemisphereGeometry,n),KW(i.eastHemisphereGeometry,n))}}function Wze(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,a=e.compressVertices,s=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(Gze(t,s,o),!o)for(c=0;c<d;++c)l(t[c].geometry)&&kn.splitLongitude(t[c]);if(Hze(t),r)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(kn.reorderForPostVertexCache(g.geometry),kn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(kn.reorderForPostVertexCache(g.westHemisphereGeometry),kn.reorderForPreVertexCache(g.westHemisphereGeometry),kn.reorderForPostVertexCache(g.eastHemisphereGeometry),kn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=kn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(o)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE&&kn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE){let A=`${m}3D`,y=`${m}2D`;kn.projectTo2D(u,m,A,y,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ce.fromVertices(u.attributes.position2D.values)),kn.encodeAttribute(u,A,`${A}High`,`${A}Low`),kn.encodeAttribute(u,y,`${y}High`,`${y}Low`)}a&&kn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(kn.fitToUnsignedShortIndices(u));p=g}return p}function QW(e,t,n,i){let o,r,a,s=i.length-1;if(s>=0){let u=i[s];o=u.offset+u.count,a=u.index,r=n[a].indices.length}else o=0,a=0,r=n[a].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;o+p>r&&(o=0,r=n[++a].indices.length),i.push({index:a,offset:o,count:p}),o+=p}}function qze(e,t){let n=[];return QW(e,"geometry",t,n),QW(e,"westHemisphereGeometry",t,n),QW(e,"eastHemisphereGeometry",t,n),n}var p0={};p0.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,a,s=!1;o>0&&(t=Wze(e),t.length>0&&(n=kn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=qze(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(a=new Array(o),s=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,s&&(a[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ce.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ce.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:a,boundingSpheres:c,boundingSpheresCV:u}};function Yze(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 Xze(e,t){let n=e.length;for(let i=0;i<n;++i)Yze(e[i],t)}function Kze(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 a in r)if(r.hasOwnProperty(a)&&l(r[a])){let s=r[a];t+=5+s.values.length}}return t}p0.packCreateGeometryResults=function(e,t){let n=new Float64Array(Kze(e)),i=[],o={},r=e.length,a=0;n[a++]=r;for(let s=0;s<r;s++){let c=e[s],u=l(c);if(n[a++]=u?1:0,!u)continue;n[a++]=c.primitiveType,n[a++]=c.geometryType,n[a++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[a++]=f,f&&ce.pack(c.boundingSphere,n,a),a+=ce.packedLength;let d=l(c.boundingSphereCV)?1:0;n[a++]=d,d&&ce.pack(c.boundingSphereCV,n,a),a+=ce.packedLength;let p=c.attributes,g=[];for(let A in p)p.hasOwnProperty(A)&&l(p[A])&&(g.push(A),l(o[A])||(o[A]=i.length,i.push(A)));n[a++]=g.length;for(let A=0;A<g.length;A++){let y=g[A],x=p[y];n[a++]=o[y],n[a++]=x.componentDatatype,n[a++]=x.componentsPerAttribute,n[a++]=x.normalize?1:0,n[a++]=x.values.length,n.set(x.values,a),a+=x.values.length}let m=l(c.indices)?c.indices.length:0;n[a++]=m,m>0&&(n.set(c.indices,a),a+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};p0.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,a=1;for(;a<n.length;){if(!(n[a++]===1)){o[r++]=void 0;continue}let c=n[a++],u=n[a++],f=n[a++];f===-1&&(f=void 0);let d,p;n[a++]===1&&(d=ce.unpack(n,a)),a+=ce.packedLength,n[a++]===1&&(p=ce.unpack(n,a)),a+=ce.packedLength;let A,y,x,b=new _n,T=n[a++];for(i=0;i<T;i++){let S=t[n[a++]],w=n[a++];x=n[a++];let P=n[a++]!==0;A=n[a++],y=Y.createTypedArray(w,A);for(let O=0;O<A;O++)y[O]=n[a++];b[S]=new Me({componentDatatype:w,componentsPerAttribute:x,normalize:P,values:y})}let E;if(A=n[a++],A>0){let S=y.length/x;for(E=Ue.createTypedArray(S,A),i=0;i<A;i++)E[i]=n[a++]}o[r++]=new At({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:b,offsetAttribute:f})}return o};function Qze(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 a=e[r];if(R.pack(a.modelMatrix,i,o),o+=R.packedLength,l(a.attributes)&&l(a.attributes.offset)){let s=a.attributes.offset.value;i[o]=s[0],i[o+1]=s[1],i[o+2]=s[2]}o+=3}return t.push(i.buffer),i}function $ze(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=R.unpack(t,o),a;o+=R.packedLength,l(t[o])&&(a={offset:new po(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:a}}return n}p0.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:Qze(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Hi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};p0.unpackCombineGeometryParameters=function(e){let t=$ze(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let s=0;s<i;s++){let c=p0.unpackCreateGeometryResults(n[s]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[o];p.geometry=d,++o}}let r=te.clone(e.ellipsoid),a=e.isGeographic?new Hi(r):new di(r);return{instances:t,ellipsoid:r,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:R.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function kse(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 a=e[r];l(a)?(i[o++]=1,ce.pack(e[r],i,o)):i[o++]=0,o+=ce.packedLength}return i}function zse(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}p0.packCombineGeometryResults=function(e,t){l(e.geometries)&&Xze(e.geometries,t);let n=kse(e.boundingSpheres),i=kse(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}};p0.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:zse(e.boundingSpheres),boundingSpheresCV:zse(e.boundingSpheresCV)}};var sC=p0;var Use={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(Use);var ra=Use;var nu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};nu.NUMBER_OF_SHADOW_MODES=4;nu.castShadows=function(e){return e===nu.ENABLED||e===nu.CAST_ONLY};nu.receiveShadows=function(e){return e===nu.ENABLED||e===nu.RECEIVE_ONLY};nu.fromCastReceive=function(e,t){return e&&t?nu.ENABLED:e?nu.CAST_ONLY:t?nu.RECEIVE_ONLY:nu.DISABLED};Object.freeze(nu);var vn=nu;function jr(e){e=e??G.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=R.clone(e.modelMatrix??R.IDENTITY),this._modelMatrix=new R,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??vn.DISABLED,this._translucent=void 0,this._state=ra.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(jr.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 Jze(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],a=!0;for(let s=1;s<t;++s){let c=e[s].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){a=!1;break}}a&&n.push(o)}return n}var Zze=new z,eUe=new h,Kse=new se;function Qse(e){let t=e.length;if(t===1)return e[0];if(t===2)return z.unpack(e,0,Zze);if(t===3)return h.unpack(e,0,eUe);if(t===4)return se.unpack(e,0,Kse)}function tUe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=Jze(i),a=r.length,s=[],c={},u={},f,p=i[0].attributes,g,m,A;for(g=0;g<a;++g)m=r[g],A=p[m],c[m]=g,s.push({functionName:`czm_batchTable_${m}`,componentDatatype:A.componentDatatype,componentsPerAttribute:A.componentsPerAttribute,normalize:A.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(s.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:1}),u.center3DHigh=s.length-5,u.center3DLow=s.length-4,u.center2DHigh=s.length-3,u.center2DLow=s.length-2,u.radius=s.length-1),r.indexOf("offset")!==-1&&(s.push({functionName:"czm_batchTable_offset2D",componentDatatype:Y.FLOAT,componentsPerAttribute:3}),f=s.length-1),s.push({functionName:"czm_batchTable_pickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let y=s.length,x=new aC(t,s,o);for(g=0;g<o;++g){let b=i[g];p=b.attributes;for(let P=0;P<a;++P){m=r[P],A=p[m];let O=Qse(A.value),B=c[m];x.setBatchedAttribute(g,B,O)}let T={primitive:b.pickPrimitive??e};l(b.id)&&(T.id=b.id);let E=t.createPickId(T);e._pickIds.push(E);let S=E.color,w=Kse;w.x=U.floatToByte(S.red),w.y=U.floatToByte(S.green),w.z=U.floatToByte(S.blue),w.w=U.floatToByte(S.alpha),x.setBatchedAttribute(g,y-1,w)}e._batchTable=x,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function nUe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Me({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function iUe(e){let t=e.attributes,n=new _n;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=nUe(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 At({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ce.clone(e.boundingSphere)})}function oUe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:R.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var rUe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;jr._modifyShaderPosition=function(e,t,n){let i,o="",r="",a="";for(;(i=rUe.exec(t))!==null;){let s=i[1],c=`vec4 czm_compute${s[0].toUpperCase()}${s.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
  4589. `),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;
  4590. `,r+=`in vec4 position;
  4591. `,a+=`${c}
  4592. {
  4593. return u_modifiedModelView * position;
  4594. }
  4595. `,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?a+=`${c}
  4596. {
  4597. return czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);
  4598. }
  4599. `:(r+=`in vec3 ${s}2DHigh;
  4600. in vec3 ${s}2DLow;
  4601. `,a+=`${c}
  4602. {
  4603. vec4 p;
  4604. if (czm_morphTime == 1.0)
  4605. {
  4606. p = czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);
  4607. }
  4608. else if (czm_morphTime == 0.0)
  4609. {
  4610. p = czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy);
  4611. }
  4612. else
  4613. {
  4614. p = czm_columbusViewMorph(
  4615. czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy),
  4616. czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow),
  4617. czm_morphTime);
  4618. }
  4619. return p;
  4620. }
  4621. `)}return[o,r,t,a].join(`
  4622. `)};jr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${He.replaceMain(t,"czm_non_show_main")}
  4623. void main()
  4624. {
  4625. czm_non_show_main();
  4626. gl_Position *= czm_batchTable_show(batchId);
  4627. }`:t};jr._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 Vse(e){return`${He.replaceMain(e,"czm_non_pick_main")}
  4628. out vec4 v_pickColor;
  4629. void main()
  4630. {
  4631. czm_non_pick_main();
  4632. v_pickColor = czm_batchTable_pickColor(batchId);
  4633. }`}function jse(e){return`in vec4 v_pickColor;
  4634. ${e}`}jr._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};jr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
  4635. `;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition();
  4636. `;return o+=` if (czm_sceneMode == czm_sceneMode3D)
  4637. `,o+=` {
  4638. `,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` }
  4639. `,o+=` else
  4640. `,o+=` {
  4641. `,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` }
  4642. `,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};jr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=He.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main()
  4643. {
  4644. czm_non_distanceDisplayCondition_main();
  4645. vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
  4646. vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
  4647. vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
  4648. float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
  4649. `;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
  4650. `:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
  4651. vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
  4652. vec4 centerRTE;
  4653. if (czm_morphTime == 1.0)
  4654. {
  4655. centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
  4656. }
  4657. else if (czm_morphTime == 0.0)
  4658. {
  4659. centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
  4660. }
  4661. else
  4662. {
  4663. centerRTE = czm_columbusViewMorph(
  4664. czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
  4665. czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
  4666. czm_morphTime);
  4667. }
  4668. `,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius;
  4669. float distanceSq;
  4670. if (czm_sceneMode == czm_sceneMode2D)
  4671. {
  4672. distanceSq = czm_eyeHeight2D.y - radiusSq;
  4673. }
  4674. else
  4675. {
  4676. distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq;
  4677. }
  4678. distanceSq = max(distanceSq, 0.0);
  4679. float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
  4680. float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
  4681. float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0;
  4682. gl_Position *= show;
  4683. }`,`${i}
  4684. ${o}`};function Gse(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,a=i&&n?2:1;a+=o||r?1:0;let s=a>1?`vec${a}`:"float",c="compressedAttributes",u=`in ${s} ${c};`,f="",d="";if(i){f+=`vec2 st;
  4685. `;let m=a>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m});
  4686. `}n&&o&&r?(f+=`vec3 normal;
  4687. vec3 tangent;
  4688. vec3 bitangent;
  4689. `,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
  4690. `):(n&&(f+=`vec3 normal;
  4691. `,d+=` normal = czm_octDecode(${c}${a>1?`.${i?"y":"x"}`:""});
  4692. `),o&&(f+=`vec3 tangent;
  4693. `,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
  4694. `),r&&(f+=`vec3 bitangent;
  4695. `,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
  4696. `));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=He.replaceMain(p,"czm_non_compressed_main");let g=`void main()
  4697. {
  4698. ${d} czm_non_compressed_main();
  4699. }`;return[u,f,p,g].join(`
  4700. `)}function aUe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
  4701. czm_non_depth_clamp_main();
  4702. gl_Position = czm_depthClamp(gl_Position);}
  4703. `,t}function sUe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
  4704. czm_non_depth_clamp_main();
  4705. #if defined(LOG_DEPTH)
  4706. czm_writeLogDepth();
  4707. #else
  4708. czm_writeDepthClamp();
  4709. #endif
  4710. }
  4711. `,t}function Hse(e,t){let n=e.vertexAttributes}function cUe(e,t){return function(){return e[t]}}var $W=Math.max(cn.hardwareConcurrency-1,1),gF,lUe=new Wn("combineGeometry");function uUe(e,t){let n,i,o,r,a=e._instanceIds;if(e._state===ra.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let s=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<s;++o)i=n[o].geometry,a.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(gF))for(gF=new Array($W),o=0;o<$W;o++)gF[o]=new Wn("createGeometry");let f;for(u=pF(u,$W),o=0;o<u.length;o++){let d=0,p=u[o],g=p.length;for(r=0;r<g;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let A=new Float64Array(d);for(m=[A.buffer],r=0;r<g;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,A,f.offset),f.geometry=A)}c.push(gF[o].scheduleTask({subTasks:u[o]},m))}e._state=ra.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=ra.CREATED}).catch(function(d){lI(e,t,ra.FAILED,d)})}else if(e._state===ra.CREATED){let s=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=lUe.scheduleTask(sC.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},s),s);e._createGeometryResults=void 0,e._state=ra.COMBINING,Promise.resolve(f).then(function(d){let p=sC.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=R.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=ra.COMBINED):lI(e,t,ra.FAILED,void 0)}).catch(function(d){lI(e,t,ra.FAILED,d)})}}function fUe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,a,s,c=0;for(s=0;s<i;s++){a=n[s];let p=a.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=iUe(p):g=p.constructor.createGeometry(p),o[c++]=oUe(a,g),r.push(a.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=sC.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=R.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=ra.COMBINED):lI(e,t,ra.FAILED,void 0)}function dUe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,a=r.length,s=e._tempBoundingSpheres;if(!l(s)){for(s=new Array(a),i=0;i<a;i++)s[i]=new ce;e._tempBoundingSpheres=s}for(i=0;i<a;++i){let A=s[i],y=e._batchTable.getBatchedAttribute(i,n,new h);A=r[i].clone(A),ece(A,y,o[i])}let c=[],u=[],f=[];for(i=0;i<a;++i){let A=s[i];A.center.x-A.radius>0||ce.intersectPlane(A,tn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING?c.push(A):(u.push(A),f.push(A))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ce.union(d,c[i]);for(i=1;i<f.length;i++)p=ce.union(p,f[i]);for(i=1;i<u.length;i++)g=ce.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let A=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=A,e._boundingSphereCV[i]=ce.projectTo2D(A,t.mapProjection,e._boundingSphereCV[i])}jr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Wse=new Tn,$se=new de,Jse=new h,Zse=new ce;function hUe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,a=i.center2DHigh,s=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let A=p[m];if(!l(A))continue;let y=e.modelMatrix;l(y)&&(A=ce.transform(A,y,Zse));let x=A.center,b=A.radius,T=Tn.fromCartesian(x,Wse);if(d.setBatchedAttribute(m,o,T.high),d.setBatchedAttribute(m,r,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(x,$se),S=u.project(E,Jse);T=Tn.fromCartesian(S,Wse),d.setBatchedAttribute(m,a,T.high),d.setBatchedAttribute(m,s,T.low)}d.setBatchedAttribute(m,c,b)}e._batchTableBoundingSpheresUpdated=!0}var JW=new h,mUe=new h;function qse(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,a=e._batchTable,s=e._instanceBoundingSpheres,c=s.length;for(let u=0;u<c;++u){let f=s[u];if(!l(f))continue;let d=a.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){a.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ce.transform(f,p,Zse));let g=f.center;g=r.scaleToGeodeticSurface(g,mUe);let m=r.cartesianToCartographic(g,$se),A=o.project(m,Jse),y=h.add(d,g,JW);m=r.cartesianToCartographic(y,m);let x=o.project(m,JW),b=h.subtract(x,A,JW),T=b.x;b.x=b.z,b.z=b.y,b.y=T,a.setBatchedAttribute(u,i,b)}e._batchTableOffsetsUpdated=!0}function pUe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,a=[],s=i.length;for(let c=0;c<s;++c){let u=i[c];if(a.push(Fn.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Oe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ce.clone(u.boundingSphere)),e._boundingSphereWC.push(new ce),!o){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ce.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ce),e._boundingSphereMorph.push(new ce)}}e._va=a,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,lI(e,t,ra.COMPLETE,void 0)}function gUe(e,t,n,i){let o=n.getRenderState(),r;i?(r=qe(o,!1),r.cull={enabled:!0,face:Li.BACK},e._frontFaceRS=Ve.fromCache(r),r.cull.face=Li.FRONT,e._backFaceRS=Ve.fromCache(r)):(e._frontFaceRS=Ve.fromCache(o),e._backFaceRS=e._frontFaceRS),r=qe(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=qe(o,!1),r.depthTest.func=hc.GREATER,i?(r.cull={enabled:!0,face:Li.BACK},e._frontFaceDepthFailRS=Ve.fromCache(r),r.cull.face=Li.FRONT,e._backFaceDepthFailRS=Ve.fromCache(r)):(e._frontFaceDepthFailRS=Ve.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function _Ue(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=jr._appendOffsetToShader(e,r),r=jr._appendShowToShader(e,r),r=jr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Vse(r),r=jr._updateColorAttribute(e,r,!1),r=Gse(e,r),r=jr._modifyShaderPosition(e,r,t.scene3DOnly);let a=n.getFragmentShaderSource();a=jse(a),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:o}),Hse(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=jr._appendShowToShader(e,r),r=jr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Vse(r),r=jr._updateColorAttribute(e,r,!0),r=Gse(e,r),r=jr._modifyShaderPosition(e,r,t.scene3DOnly),r=aUe(r),a=e._depthFailAppearance.getFragmentShaderSource(),a=jse(a),a=sUe(a),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:o}),Hse(e._spDepthFail,o))}var cI=new R,Yse=new h;function Xse(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},a=t.uniforms;if(l(a))for(let c in a)a.hasOwnProperty(c)&&(r[c]=cUe(a,c));let s=It(r,o);return s=e._batchTable.getUniformMapCallback()(s),l(e.rtcCenter)&&(s.u_modifiedModelView=function(){let c=i.context.uniformState.view;return R.multiply(c,e._modelMatrix,cI),R.multiplyByPoint(cI,e.rtcCenter,Yse),R.setTranslation(cI,Yse,cI),cI}),s}function AUe(e,t,n,i,o,r,a,s){let c=Xse(e,t,n,s),u;l(e._depthFailAppearance)&&(u=Xse(e,e._depthFailAppearance,e._depthFailAppearance.material,s));let f=i?Ie.TRANSLUCENT:Ie.OPAQUE,d=o?2:1;d*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*d;let p=r.length,g=0;for(let m=0;m<p;++m){let A;o&&(A=r[m],l(A)||(A=r[m]=new tt({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._backFaceRS,A.shaderProgram=e._sp,A.uniformMap=c,A.pass=f,++m),A=r[m],l(A)||(A=r[m]=new tt({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._frontFaceRS,A.shaderProgram=e._sp,A.uniformMap=c,A.pass=f,l(e._depthFailAppearance)&&(o&&(++m,A=r[m],l(A)||(A=r[m]=new tt({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._backFaceDepthFailRS,A.shaderProgram=e._spDepthFail,A.uniformMap=u,A.pass=f),++m,A=r[m],l(A)||(A=r[m]=new tt({owner:e,primitiveType:e._primitiveType})),A.vertexArray=e._va[g],A.renderState=e._frontFaceDepthFailRS,A.shaderProgram=e._spDepthFail,A.uniformMap=u,A.pass=f),++g}}jr._updateBoundingVolumes=function(e,t,n,i){let o,r,a;if(i||!R.equals(n,e._modelMatrix))for(R.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)a=e._boundingSpheres[o],l(a)&&(e._boundingSphereWC[o]=ce.transform(a,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ce.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphereMorph[o]=ce.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let s=e.appearance.pixelSize;if(l(s))for(r=e._boundingSpheres.length,o=0;o<r;++o){a=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(a,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*s;c.radius=a.radius+f}};function yUe(e,t,n,i,o,r,a,s){jr._updateBoundingVolumes(e,t,o);let c;t.mode===ie.SCENE3D?c=e._boundingSphereWC:t.mode===ie.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ie.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=vn.castShadows(e.shadows),g=vn.receiveShadows(e.shadows),m=n.length,A=s?2:1;A*=l(e._depthFailAppearance)?2:1;for(let y=0;y<m;++y){let x=Math.floor(y/A),b=n[y];b.modelMatrix=o,b.boundingVolume=c[x],b.cull=r,b.debugShowBoundingVolume=a,b.castShadows=p,b.receiveShadows=g,d?b.pickId="v_pickColor":b.pickId=void 0,u.push(b)}}}jr.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!==ie.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===ra.FAILED)return;let t=e.context;if(l(this._batchTable)||tUe(this,t),this._batchTable.attributes.length>0){if(Mt.maximumVertexTextureImageUnits===0)throw new re("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!==ra.COMPLETE&&this._state!==ra.COMBINED&&(this.asynchronous?uUe(this,e):fUe(this,e)),this._state===ra.COMBINED&&(hUe(this,e),qse(this,e),pUe(this,e)),!this.show||this._state!==ra.COMPLETE)return;this._batchTableOffsetsUpdated||qse(this,e),this._recomputeBoundingSpheres&&dUe(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 a=this.depthFailAppearance,s=l(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=s,o=!0,r=!0):this._depthFailMaterial!==s&&(this._depthFailMaterial=s,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&(this._createRenderStatesFunction??gUe)(this,t,n,u),r&&(this._createShaderProgramFunction??_Ue)(this,e,n),(o||r)&&(this._createCommandsFunction??AUe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??yUe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var xUe=new ce,bUe=new ce;function ece(e,t,n){if(n===ln.TOP){let i=ce.clone(e,xUe),o=ce.clone(e,bUe);o.center=h.add(o.center,t,o.center),e=ce.union(i,o,e)}else n===ln.ALL&&(e.center=h.add(e.center,t,e.center));return e}function TUe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,a=Y.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function CUe(e,t,n,i,o){return function(r){let a=Qse(r);e.setBatchedAttribute(t,n,a),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var EUe=new h;function vUe(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)&&ece(i,h.fromArray(r.get(),0,EUe),e._offsetInstanceExtend[n]),l(o)&&(i=ce.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function SUe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}jr.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 u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let a=this._batchTable,s=this._batchTableAttributeIndices;t={};let c={};for(let u in s)if(s.hasOwnProperty(u)){let f=s[u];c[u]={get:TUe(a,n,f),set:CUe(a,n,f,this,u)}}return vUe(this,c,n),SUe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};jr.prototype.isDestroyed=function(){return!1};jr.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,fe(this)};function lI(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===ra.COMPLETE||e._state===ra.FAILED,!0})}var Pn=jr;function wUe(e){e=e??G.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Tl=wUe;var uI=`#ifdef TEXTURE_COORDINATES
  4712. #ifdef SPHERICAL
  4713. in vec4 v_sphericalExtents;
  4714. #else // SPHERICAL
  4715. in vec2 v_inversePlaneExtents;
  4716. in vec4 v_westPlane;
  4717. in vec4 v_southPlane;
  4718. #endif // SPHERICAL
  4719. in vec3 v_uvMinAndSphericalLongitudeRotation;
  4720. in vec3 v_uMaxAndInverseDistance;
  4721. in vec3 v_vMaxAndInverseDistance;
  4722. #endif // TEXTURE_COORDINATES
  4723. #ifdef PER_INSTANCE_COLOR
  4724. in vec4 v_color;
  4725. #endif
  4726. #ifdef NORMAL_EC
  4727. vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {
  4728. vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);
  4729. return eyeCoordinate.xyz / eyeCoordinate.w;
  4730. }
  4731. vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {
  4732. vec2 glFragCoordXY = gl_FragCoord.xy;
  4733. // Sample depths at both offset and negative offset
  4734. float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
  4735. float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
  4736. // Explicitly evaluate both paths
  4737. // Necessary for multifrustum and for edges of the screen
  4738. bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);
  4739. float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);
  4740. float useDownOrLeft = float(useUpOrRight == 0.0);
  4741. vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);
  4742. vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);
  4743. return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;
  4744. }
  4745. #endif // NORMAL_EC
  4746. void main(void)
  4747. {
  4748. #ifdef REQUIRES_EC
  4749. float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));
  4750. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  4751. #endif
  4752. #ifdef REQUIRES_WC
  4753. vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;
  4754. vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;
  4755. #endif
  4756. #ifdef TEXTURE_COORDINATES
  4757. vec2 uv;
  4758. #ifdef SPHERICAL
  4759. // Treat world coords as a sphere normal for spherical coordinates
  4760. vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);
  4761. sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;
  4762. sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
  4763. uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;
  4764. uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;
  4765. #else // SPHERICAL
  4766. // Unpack planes and transform to eye space
  4767. uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;
  4768. uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;
  4769. #endif // SPHERICAL
  4770. #endif // TEXTURE_COORDINATES
  4771. #ifdef CULL_FRAGMENTS
  4772. // When classifying translucent geometry, logDepthOrDepth == 0.0
  4773. // indicates a region that should not be classified, possibly due to there
  4774. // being opaque pixels there in another buffer.
  4775. if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
  4776. discard;
  4777. }
  4778. #endif
  4779. #ifdef PICK
  4780. out_FragColor.a = 1.0; // Explicitly set the alpha, otherwise this may be discarded by ShaderSource.createPickFragmentShaderSource
  4781. #ifdef CULL_FRAGMENTS
  4782. czm_writeDepthClamp();
  4783. #endif // CULL_FRAGMENTS
  4784. #else // PICK
  4785. #ifdef NORMAL_EC
  4786. // Compute normal by sampling adjacent pixels in 2x2 block in screen space
  4787. vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));
  4788. vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));
  4789. vec3 normalEC = normalize(cross(leftRight, downUp));
  4790. #endif
  4791. #ifdef PER_INSTANCE_COLOR
  4792. vec4 color = czm_gammaCorrect(v_color);
  4793. #ifdef FLAT
  4794. out_FragColor = color;
  4795. #else // FLAT
  4796. czm_materialInput materialInput;
  4797. materialInput.normalEC = normalEC;
  4798. materialInput.positionToEyeEC = -eyeCoordinate.xyz;
  4799. czm_material material = czm_getDefaultMaterial(materialInput);
  4800. material.diffuse = color.rgb;
  4801. material.alpha = color.a;
  4802. out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
  4803. #endif // FLAT
  4804. // Premultiply alpha. Required for classification primitives on translucent globe.
  4805. out_FragColor.rgb *= out_FragColor.a;
  4806. #else // PER_INSTANCE_COLOR
  4807. // Material support.
  4808. // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or
  4809. // dependencies for culling but might not actually be used by the material.
  4810. czm_materialInput materialInput;
  4811. #ifdef USES_NORMAL_EC
  4812. materialInput.normalEC = normalEC;
  4813. #endif
  4814. #ifdef USES_POSITION_TO_EYE_EC
  4815. materialInput.positionToEyeEC = -eyeCoordinate.xyz;
  4816. #endif
  4817. #ifdef USES_TANGENT_TO_EYE
  4818. materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);
  4819. #endif
  4820. #ifdef USES_ST
  4821. // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired
  4822. // texture coordinate system, which typically forms a tight oriented bounding box around the geometry.
  4823. // Shader is provided a set of reference points for remapping.
  4824. materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;
  4825. materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;
  4826. #endif
  4827. czm_material material = czm_getMaterial(materialInput);
  4828. #ifdef FLAT
  4829. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  4830. #else // FLAT
  4831. out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
  4832. #endif // FLAT
  4833. // Premultiply alpha. Required for classification primitives on translucent globe.
  4834. out_FragColor.rgb *= out_FragColor.a;
  4835. #endif // PER_INSTANCE_COLOR
  4836. czm_writeDepthClamp();
  4837. #endif // PICK
  4838. }
  4839. `;function Kf(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new ZW;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new ZW;if(o.requiresTextureCoordinates=e,n instanceof hn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource}
  4840. ${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}Kf.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 hn&&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 hn||(o=t.material.shaderSource),new He({defines:i,sources:[o,uI]})};Kf.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 He({defines:n,sources:[uI],pickColorQualifier:"in"})};Kf.prototype.createVertexShader=function(e,t,n,i){return cce(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Kf.prototype.createPickVertexShader=function(e,t,n,i){return cce(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var tce=new h,nce=new de,ice={high:0,low:0};function cce(e,t,n,i,o,r,a,s){let c=i.slice();if(s.eastMostYhighDefine===""){let u=nce;u.longitude=D.PI,u.latitude=0,u.height=0;let f=a.project(u,tce),d=Tn.encode(f.x,ice);s.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,s.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=nce;p.longitude=-D.PI,p.latitude=0,p.height=0;let g=a.project(p,tce);d=Tn.encode(g.x,ice),s.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,s.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(s.eastMostYhighDefine),c.push(s.eastMostYlowDefine),c.push(s.westMostYhighDefine),c.push(s.westMostYlowDefine)),l(r)&&r instanceof hn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new He({defines:c,sources:[o]})}function ZW(){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(ZW.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 oce(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)/z.distance(t,e)}var IUe=[new z,new z,new z,new z];function lce(e,t){let n=IUe,i=z.unpack(t,0,n[0]),o=z.unpack(t,2,n[1]),r=z.unpack(t,4,n[2]);e.uMaxVmax=new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let a=1/oce(i,o,r),s=1/oce(i,r,o);e.uvMinAndExtents=new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,s]})}var uce=new de,fce=new h,DUe=new h,PUe=new h,_F={high:0,low:0};function dce(e,t,n){let i=uce;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,fce);i.latitude=e.north;let r=t.project(i,DUe);i.longitude=e.east,i.latitude=e.south;let a=t.project(i,PUe),s=[0,0,0,0],c=[0,0,0,0],u=Tn.encode(o.x,_F);s[0]=u.high,c[0]=u.low,u=Tn.encode(o.y,_F),s[1]=u.high,c[1]=u.low,u=Tn.encode(r.y,_F),s[2]=u.high,c[2]=u.low,u=Tn.encode(a.x,_F),s[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:s}),n.planes2D_LOW=new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var RUe=new R,OUe=new R,rce=new h,MUe=new de,BUe=[new de,new de,new de,new de,new de,new de,new de,new de];function LUe(e,t,n,i,o,r){let a=oe.center(e,MUe);a.height=n;let s=de.toCartesian(a,t,rce),c=pt.eastNorthUpToFixedFrame(s,t,RUe),u=R.inverse(c,OUe),f=e.west,d=e.east,p=e.north,g=e.south,m=BUe;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let A=(f+d)*.5,y=(p+g)*.5;m[4].latitude=g,m[4].longitude=A,m[5].latitude=p,m[5].longitude=A,m[6].latitude=y,m[6].longitude=f,m[7].latitude=y,m[7].longitude=d;let x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let O=0;O<8;O++){m[O].height=n;let B=de.toCartesian(m[O],t,rce);R.multiplyByPoint(u,B,B),B.z=0,x=Math.min(x,B.x),b=Math.max(b,B.x),T=Math.min(T,B.y),E=Math.max(E,B.y)}let S=i;S.x=x,S.y=T,S.z=0,R.multiplyByPoint(c,S,S);let w=o;w.x=b,w.y=T,w.z=0,R.multiplyByPoint(c,w,w),h.subtract(w,S,o);let P=r;P.x=x,P.y=E,P.z=0,R.multiplyByPoint(c,P,P),h.subtract(P,S,r)}var NUe=new h,FUe=new h,kUe=new Tn;Kf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=fce,a=NUe,s=FUe;LUe(e,n,o??0,r,a,s);let c={};lce(c,t);let u=Tn.fromCartesian(r,kUe);return c.southWest_HIGH=new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),c.northward=new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),dce(e,i,c),c};var zUe=new h;function ace(e,t,n,i){let o=uce;o.latitude=e,o.longitude=t,o.height=0;let r=de.toCartesian(o,n,zUe),a=Math.sqrt(r.x*r.x+r.y*r.y),s=D.fastApproximateAtan2(a,r.z),c=D.fastApproximateAtan2(r.x,r.y);return i.x=s,i.y=c,i}var sce=new z;Kf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=ace(e.south,e.west,n,sce),r=o.x,a=o.y,s=ace(e.north,e.east,n,sce),c=s.x,u=s.y,f=0;a>u&&(f=D.PI-a,a=-D.PI,u+=f),r-=D.EPSILON5,a-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let d=1/(u-a),p=1/(c-r),g={sphericalExtents:new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,a,p,d]}),longitudeRotation:new Tl({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return lce(g,t),dce(e,i,g),g};Kf.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)};Kf.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 UUe(e){return Math.max(e.width,e.height)>Kf.MAX_WIDTH_FOR_PLANAR_EXTENTS}Kf.shouldUseSphericalCoordinates=function(e){return UUe(e)};Kf.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var Qf=Kf;var hce={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS};Object.freeze(hce);var Xn=hce;var mce={ZERO:ee.ZERO,KEEP:ee.KEEP,REPLACE:ee.REPLACE,INCREMENT:ee.INCR,DECREMENT:ee.DECR,INVERT:ee.INVERT,INCREMENT_WRAP:ee.INCR_WRAP,DECREMENT_WRAP:ee.DECR_WRAP};Object.freeze(mce);var vt=mce;var AF={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};AF.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Xn.ALWAYS,frontOperation:{fail:vt.KEEP,zFail:vt.KEEP,zPass:vt.REPLACE},backFunction:Xn.ALWAYS,backOperation:{fail:vt.KEEP,zFail:vt.KEEP,zPass:vt.REPLACE},reference:AF.CESIUM_3D_TILE_MASK,mask:AF.CESIUM_3D_TILE_MASK}};var Ht=Object.freeze(AF);function Wy(e){e=e??G.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Yn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=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:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Wy.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}}});Wy.isSupported=function(e){return e.context.stencilBuffer};function cC(e,t){let n=t?Xn.EQUAL:Xn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:vt.KEEP,zFail:vt.DECREMENT_WRAP,zPass:vt.KEEP},backFunction:n,backOperation:{fail:vt.KEEP,zFail:vt.INCREMENT_WRAP,zPass:vt.KEEP},reference:Ht.CESIUM_3D_TILE_MASK,mask:Ht.CESIUM_3D_TILE_MASK},stencilMask:Ht.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},depthMask:!1}}function tq(e){return{stencilTest:{enabled:e,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},reference:0,mask:Ht.CLASSIFICATION_MASK},stencilMask:Ht.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:Jt.PRE_MULTIPLIED_ALPHA_BLEND}}var VUe={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},reference:0,mask:Ht.CLASSIFICATION_MASK},stencilMask:Ht.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function jUe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(cC(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(cC(o,!0)),e._rsColorPass=Ve.fromCache(tq(o,!1)),e._rsPickPass=Ve.fromCache(VUe)}function GUe(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;
  4841. `,r=` extrudeDirection = czm_octDecode(${n}, 65535.0);
  4842. `,a=t;a=a.replace(/in\s+vec3\s+extrudeDirection;/g,""),a=He.replaceMain(a,"czm_non_compressed_main");let s=`void main()
  4843. {
  4844. ${r} czm_non_compressed_main();
  4845. }`;return[i,o,a,s].join(`
  4846. `)}}function HUe(e,t){let n=t.context,i=e._primitive,o=mF;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Pn._appendDistanceDisplayConditionToShader(i,o),o=Pn._modifyShaderPosition(e,o,t.scene3DOnly),o=Pn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,a=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=GUe(i,o));let s=e._extruded?"EXTRUDED_GEOMETRY":"",c=new He({defines:[s],sources:[o]}),u=new He({sources:[Hy]}),f=e._primitive._attributeLocations,d=new Qf(a,r,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=He.createPickVertexShaderSource(o);m=Pn._appendShowToShader(i,m),m=Pn._updatePickColorAttribute(m);let A=d.createPickFragmentShader(!1),y=d.createPickVertexShader([s],m,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:y,fragmentShaderSource:A,attributeLocations:f}),a){let x=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(x)){let b=d.createPickFragmentShader(!0),T=d.createPickVertexShader([s],m,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:b,attributeLocations:f})}e._spPick2D=x}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=Pn._appendShowToShader(i,o),c=new He({defines:[s],sources:[o]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([s],o,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),a){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let A=d.createFragmentShader(!0),y=d.createVertexShader([s],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:y,fragmentShaderSource:A,attributeLocations:f})}e._spColor2D=m}}function WUe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,a,s=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[s++];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=Ie.TERRAIN_CLASSIFICATION,a=tt.shallowClone(r,r.derivedCommands.tileset),a.renderState=e._rsStencilDepthPass3DTiles,a.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=a,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=Ie.TERRAIN_CLASSIFICATION;let A=e.appearance.material;if(l(A)&&(c=It(c,A._uniforms)),r.uniformMap=c,a=tt.shallowClone(r,r.derivedCommands.tileset),a.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=a,u){let y=tt.shallowClone(r,r.derivedCommands.appearance2D);y.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=y,y=tt.shallowClone(a,a.derivedCommands.appearance2D),y.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=y}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=tt.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function qUe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,a=0,s;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<o;c+=2){let m=i._va[d++];if(n&&(s=r[a++],m=i._va[s.index]),u=t[c],l(u)||(u=t[c]=new tt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=s.offset,u.count=s.count),f=tt.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new tt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=s.offset,u.count=s.count),f=tt.shallowClone(u,u.derivedCommands.tileset),f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let A=tt.shallowClone(u,u.derivedCommands.pick2D);A.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=A,A=tt.shallowClone(f,f.derivedCommands.pick2D),A.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=A}}}function YUe(e,t,n,i,o,r,a){WUe(e,r),qUe(e,a)}function pce(e,t){return Math.floor(e%t/2)}function eq(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function gce(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function XUe(e,t,n,i,o,r,a,s){let c=e._primitive;Pn._updateBoundingVolumes(c,t,o);let u;t.mode===ie.SCENE3D?u=c._boundingSphereWC:t.mode===ie.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ie.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==Yn.CESIUM_3D_TILE,p=f!==Yn.TERRAIN,g=t.passes,m,A,y;if(g.render){let x=n.length;for(m=0;m<x;++m)A=u[pce(m,x)],d&&(y=n[m],eq(y,t,o,r,A,a)),p&&(y=n[m].derivedCommands.tileset,eq(y,t,o,r,A,a));if(t.invertClassification){let b=e._commandsIgnoreShow,T=b.length;for(m=0;m<T;++m)A=u[m],y=b[m],eq(y,t,o,r,A,a)}}if(g.pick){let x=i.length,b=c._pickOffsets;for(m=0;m<x;++m){let T=b[pce(m,x)];A=u[T.index],d&&(y=i[m],gce(y,t,o,r,A)),p&&(y=i[m].derivedCommands.tileset,gce(y,t,o,r,A))}}}Wy.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,a,s,c,u=!1,f=!0,d,p=!1,g=!1;for(r>0&&(c=o[0].attributes,p=Qf.hasAttributesForSphericalExtents(c),g=Qf.hasAttributesForTextureCoordinatePlanes(c),d=c.color),a=0;a<r;a++){s=o[a];let A=s.attributes.color;l(A)&&(u=!0),f=f&&l(A)&&Yt.equals(d,A)}if(!f&&!p&&!g)throw new _e("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new hn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(r);for(a=0;a<r;++a)s=o[a],m[a]=new Bt({geometry:s.geometry,attributes:s.attributes,modelMatrix:s.modelMatrix,id:s.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(A,y){n._createBoundingVolumeFunction(A,y)}),i._createRenderStatesFunction=function(A,y,x,b){jUe(n,y)},i._createShaderProgramFunction=function(A,y,x){HUe(n,y)},i._createCommandsFunction=function(A,y,x,b,T,E,S){YUe(n,void 0,void 0,!0,!1,E,S)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(A,y,x,b,T,E,S,w){n._updateAndQueueCommandsFunction(A,y,x,b,T,E,S,w)}:i._updateAndQueueCommandsFunction=function(A,y,x,b,T,E,S,w){XUe(n,y,x,b,T,E,S,w)},this._primitive=new Pn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(cC(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(cC(!1,!0)),this._rsColorPass=Ve.fromCache(tq(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(cC(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(cC(!0,!0)),this._rsColorPass=Ve.fromCache(tq(!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))})};Wy.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Wy.prototype.isDestroyed=function(){return!1};Wy.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,fe(this)};var fI=Wy;var KUe={u_globeMinimumAltitude:function(){return 55e3}};function iu(e){e=e??G.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 a=0;a<r;a++){let s=o[a].attributes;if(l(s)&&l(s.color)){t=new hn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??Yn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=wi._defaultMaxTerrainHeight,this._minTerrainHeight=wi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:KUe}}Object.defineProperties(iu.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}}});iu.isSupported=fI.isSupported;function _ce(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Ace(e){return function(t,n){return e._minHeight}}var QUe=new h,$Ue=new h,JUe=new h,ZUe=new de,eVe=new oe;function yF(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,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<r;d+=3){let p=h.unpack(i,d,QUe),g=h.unpack(o,d,$Ue),m=h.add(p,g,JUe),A=n.cartesianToCartographic(m,ZUe),y=A.latitude,x=A.longitude;a=Math.min(a,y),s=Math.min(s,x),c=Math.max(c,y),u=Math.max(u,x)}let f=eVe;return f.north=c,f.south=a,f.east=u,f.west=s,f}function tVe(e,t,n){let i=wi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function nVe(e,t,n){let i=t.mapProjection.ellipsoid,o=yF(t,n),r=$t.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let a=t.mapProjection,s=ce.fromRectangleWithHeights2D(o,a,e._maxHeight,e._minHeight);h.fromElements(s.center.z,s.center.x,s.center.y,s.center),e._boundingVolumes2D.push(s)}}function nq(e,t){return Math.floor(e%t/2)}function iq(e,t,n,i,o,r,a){let s=e._primitive;n.mode!==ie.SCENE3D&&t.shaderProgram===s._spColor&&s._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function yce(e,t,n,i,o,r){let a=e._primitive;n.mode!==ie.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function iVe(e,t,n,i,o,r,a,s){let c;t.mode===ie.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==Yn.CESIUM_3D_TILE,d=u!==Yn.TERRAIN,p=t.passes,g=e._primitive,m,A,y;if(p.render){let x=n.length;for(m=0;m<x;++m)A=c[nq(m,x)],f&&(y=n[m],iq(e,y,t,o,r,A,a)),d&&(y=n[m].derivedCommands.tileset,iq(e,y,t,o,r,A,a));if(t.invertClassification){let b=g._commandsIgnoreShow,T=b.length;for(m=0;m<T;++m)A=c[m],y=b[m],iq(e,y,t,o,r,A,a)}}if(p.pick){let x=i.length,b;for(e._useFragmentCulling||(b=g._primitive._pickOffsets),m=0;m<x;++m){if(A=c[nq(m,x)],!e._useFragmentCulling){let T=b[nq(m,x)];A=c[T.index]}f&&(y=i[m],yce(e,y,t,o,r,A)),d&&(y=i[m].derivedCommands.tileset,yce(e,y,t,o,r,A))}}}iu.initializeTerrainHeights=function(){return wi.initialize()};iu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!wi.initialized){iu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,a,s=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=s.length,u=new Array(c),f,d;for(f=0;f<c;++f){o=s[f],r=o.geometry;let A=yF(e,r);l(d)?l(A)&&oe.union(d,A,d):d=oe.clone(A);let y=o.id;if(l(y)&&l(A)){let x=wi.getBoundingSphere(A,i);this._boundingSpheresKeys.push(y),this._boundingSpheres.push(x)}a=r.constructor,!l(a)||l(a.createShadowVolume)}tVe(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=ho.getHeight(this._minTerrainHeight,p,g),this._maxHeight=ho.getHeight(this._maxTerrainHeight,p,g);let m=iu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let A,y=!0;for(f=0;f<c;++f)if(o=s[f],r=o.geometry,d=yF(e,r),Qf.shouldUseSphericalCoordinates(d)){y=!1;break}for(f=0;f<c;++f){o=s[f],r=o.geometry,a=r.constructor;let x=yF(e,r),b=r.textureCoordinateRotationPoints;y?A=Qf.getPlanarTextureCoordinateAttributes(x,b,i,e.mapProjection,this._maxHeight):A=Qf.getSphericalExtentGeometryInstanceAttributes(x,b,i,e.mapProjection);let T=o.attributes;for(let E in T)T.hasOwnProperty(E)&&(A[E]=T[E]);u[f]=new Bt({geometry:a.createShadowVolume(r,Ace(this),_ce(this)),attributes:A,id:o.id})}}else for(f=0;f<c;++f)o=s[f],r=o.geometry,a=r.constructor,u[f]=new Bt({geometry:a.createShadowVolume(r,Ace(this),_ce(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(A,y){nVe(t,A,y)},n._updateAndQueueCommandsFunction=function(A,y,x,b,T,E,S,w){iVe(t,y,x,b,T,E,S,w)},this._primitive=new fI(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))})};iu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};iu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};iu.prototype.isDestroyed=function(){return!1};iu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};iu._supportsMaterials=function(e){return e.depthTexture};iu.supportsMaterials=function(e){return iu._supportsMaterials(e.frameState.context)};var ou=iu;function lC(){_e.throwInstantiationError()}Object.defineProperties(lC.prototype,{isConstant:{get:_e.throwInstantiationError},definitionChanged:{get:_e.throwInstantiationError}});lC.prototype.getType=_e.throwInstantiationError;lC.prototype.getValue=_e.throwInstantiationError;lC.prototype.equals=_e.throwInstantiationError;var oVe=new Q;lC.getValue=function(e,t,n){let i;return l(e)||(e=Q.now(oVe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=qi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==qi.ColorType)&&(n=qi.fromType(qi.ColorType)),U.clone(U.WHITE,n.uniforms.color),n)};var vr=lC;function qy(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}qy.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};qy.prototype._setOptions=_e.throwInstantiationError;qy.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,a=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,a,e),this._isHidden(r,a,e))return;let s=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(a.fill)||a.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Wt,d,p=t._getIsClosed(c);if(f)d=new hn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=vr.getValue(e,u,this._material);this._material=g,d=new go({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=hn.VERTEX_FORMAT,this._primitive=o.add(new ou({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:s,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Pn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:s}))}}if(!n&&l(a.outline)&&a.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(a.outlineWidth,e,1);this._outlinePrimitive=i.add(new Pn({geometryInstances:u,appearance:new hn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:s}))}};qy.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),Tt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ce.clone(o.boundingSphere,e),Tt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Tt.PENDING:Tt.FAILED};qy.prototype.isDestroyed=function(){return!1};qy.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),fe(this)};var Ti=qy;var xce={};function dI(e,t){l(xce[e])||(xce[e]=!0,console.warn(t??e))}dI.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.";dI.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";dI.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";dI.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var _t=dI;var bce={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(bce);var l_=bce;var Tce={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(Tce);var rn=Tce;var Cce=D.EPSILON10;function rVe(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let a,s=e[0],c,u,f=0,d=-1;for(a=1;a<r;++a)c=e[a],t(s,c,Cce)?(l(u)||(u=e.slice(0,a),f=a-1,d=0),o&&i.push(a)):(l(u)&&(u.push(c),f=a,o&&(d=i.length)),s=c);return n&&t(e[0],e[r-1],Cce)&&(o&&(l(u)?i.splice(d,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Fo=rVe;function aVe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+s*s),u=c*s,f=Math.atan2(s,r),d=c*a,p=d*d,g=1-p,m=Math.sqrt(g),A=t/4,y=A*A,x=y*A,b=y*y,T=1+A-3*y/4+5*x/4-175*b/64,E=1-A+15*y/8-35*x/8,S=1-3*A+35*y/4,w=1-5*A,P=T*f-E*Math.sin(2*f)*A/2-S*Math.sin(4*f)*y/16-w*Math.sin(6*f)*x/48-Math.sin(8*f)*5*b/512,O=e._constants;O.a=n,O.b=i,O.f=o,O.cosineHeading=r,O.sineHeading=a,O.tanU=s,O.cosineU=c,O.sineU=u,O.sigma=f,O.sineAlpha=d,O.sineSquaredAlpha=p,O.cosineSquaredAlpha=g,O.cosineAlpha=m,O.u2Over4=A,O.u4Over16=y,O.u6Over64=x,O.u8Over256=b,O.a0=T,O.a1=E,O.a2=S,O.a3=w,O.distanceRatio=P}function sVe(e,t){return e*t*(4+e*(4-3*t))/16}function Ece(e,t,n,i,o,r,a){let s=sVe(e,n);return(1-s)*e*t*(i+s*o*(a+s*r*(2*a*a-1)))}function cVe(e,t,n,i,o,r,a){let s=(t-n)/t,c=r-i,u=Math.atan((1-s)*Math.tan(o)),f=Math.atan((1-s)*Math.tan(a)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),A=d*g,y=d*m,x=p*m,b=p*g,T=c,E=D.TWO_PI,S=Math.cos(T),w=Math.sin(T),P,O,B,L,_;do{S=Math.cos(T),w=Math.sin(T);let F=y-b*S;B=Math.sqrt(g*g*w*w+F*F),O=x+A*S,P=Math.atan2(B,O);let W;B===0?(W=0,L=1):(W=A*w/B,L=1-W*W),E=T,_=O-2*x/L,isFinite(_)||(_=0),T=c+Ece(s,W,L,P,B,O,_)}while(Math.abs(T-E)>D.EPSILON12);let C=L*(t*t-n*n)/(n*n),v=1+C*(4096+C*(C*(320-175*C)-768))/16384,I=C*(256+C*(C*(74-47*C)-128))/1024,M=_*_,N=I*B*(_+I*(O*(2*M-1)-I*_*(4*B*B-3)*(4*M-3)/6)/4),j=n*v*(P-N),k=Math.atan2(g*w,y-b*S),V=Math.atan2(d*w,y*S-b);e._distance=j,e._startHeading=k,e._endHeading=V,e._uSquared=C}var lVe=new h,oq=new h;function vce(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,oq),lVe),r=h.normalize(i.cartographicToCartesian(n,oq),oq);cVe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=de.clone(t,e._start),e._end=de.clone(n,e._end),e._start.height=0,e._end.height=0,aVe(e)}function hI(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new de,this._end=new de,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&vce(this,e,t,i)}Object.defineProperties(hI.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}}});hI.prototype.setEndPoints=function(e,t){vce(this,e,t,this._ellipsoid)};hI.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};hI.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),a=Math.cos(6*i),s=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,A=n.u6Over64,y=n.u4Over16,x=2*p*g*o/3+i*(1-m+7*y/4-15*A/4+579*g/64-(y-15*A/4+187*g/16)*o-(5*A/4-115*g/16)*r-29*g*a/16)+(m/2-y+71*A/32-85*g/16)*s+(5*y/16-5*A/4+383*g/96)*c-d*((A-11*g/2)*s+5*g*c/2)+(29*A/96-29*g/16)*u+539*g*f/1536,b=Math.asin(Math.sin(x)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(b));x=x-n.sigma;let E=Math.cos(2*n.sigma+x),S=Math.sin(x),w=Math.cos(x),P=n.cosineU*w,O=n.sineU*S,L=Math.atan2(S*n.sineHeading,P-O*n.cosineHeading)-Ece(n.f,n.sineAlpha,n.cosineSquaredAlpha,x,S,w,E);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=T,t.height=0,t):new de(this._start.longitude+L,T,0)};var u_=hI;function aq(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,a=r*i,s=a*i,c=s*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),A=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*a/16384-441*s/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*a/4096+2205*s/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*a/16384+1575*s/65536+155925*c/8388608)*d-(35*r/3072+175*a/12288+3675*s/262144+13475*c/1048576)*p+(315*a/131072+2205*s/524288+43659*c/8388608)*g-(693*s/1310720+6237*c/5242880)*m+1001*c/8388608*A)}function uVe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,a=r*i,s=t,c=s*s,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),A=Math.cos(2*i),y=Math.sin(4*i),x=Math.cos(4*i),b=Math.sin(6*i),T=Math.cos(6*i),E=Math.sin(8*i),S=Math.cos(8*i),w=Math.sin(10*i),P=Math.cos(10*i),O=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*d/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*a)*g/5242880)*A+(21*i*f/256+483*i*d/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*x+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*S+8011*i*g/1048576*P+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*d/4096-33*o*d/512+20861*p/524288-33*o*p/512+a*p/1024+28273*g/1048576-471*o*g/8192+9*a*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*o*d/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*a*g/2048)*y+(151*f/6144+151*d/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*b+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*E+(8011*p/2621440+8011*g/1048576)*w+293393*g/251658240*O}function uC(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function fVe(e,t,n,i,o){let r=uC(e._ellipticity,n),a=uC(e._ellipticity,o);return Math.atan2(D.negativePiToPi(i-t),a-r)}function dVe(e,t,n,i,o,r,a){let s=e._heading,c=r-i,u=0;if(D.equalsEpsilon(Math.abs(s),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(o)*D.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=aq(e._ellipticity,t,o);u=(aq(e._ellipticity,t,a)-f)/Math.cos(s)}return Math.abs(u)}var hVe=new h,rq=new h;function Sce(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,rq),hVe),r=h.normalize(i.cartographicToCartesian(n,rq),rq),a=i.maximumRadius,s=i.minimumRadius,c=a*a,u=s*s;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=de.clone(t,e._start),e._start.height=0,e._end=de.clone(n,e._end),e._end.height=0,e._heading=fVe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=dVe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function wce(e,t,n,i,o,r){if(n===0)return de.clone(e,r);let a=o*o,s,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=aq(o,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=uVe(p,o,i),Math.abs(t)<D.EPSILON10)s=D.negativePiToPi(e.longitude);else{let g=uC(o,e.latitude),m=uC(o,c);u=Math.tan(t)*(m-g),s=D.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-a*d*d)}u=n/f,t>0?s=D.negativePiToPi(e.longitude+u):s=D.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=s,r.latitude=c,r.height=0,r):new de(s,c,0)}function g0(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new de,this._end=new de,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Sce(this,e,t,i)}Object.defineProperties(g0.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}}});g0.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??te.default,a=r.maximumRadius,s=r.minimumRadius,c=a*a,u=s*s,f=Math.sqrt((c-u)/c);t=D.negativePiToPi(t);let d=wce(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new g0(e,d,r):(o.setEndPoints(e,d),o)};g0.prototype.setEndPoints=function(e,t){Sce(this,e,t,this._ellipsoid)};g0.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};g0.prototype.interpolateUsingSurfaceDistance=function(e,t){return wce(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};g0.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(r.longitude)*Math.PI),l(t)||(t=new de),Math.abs(D.PI_OVER_TWO-o)<=D.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-o),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,r.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let a=r.latitude,s=n*Math.sin(a),c=Math.tan(.5*(D.PI_OVER_TWO+a))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+s)/(1-s),f=r.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,d,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};g0.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let r=uC(n,o.latitude),a=uC(n,e),s=Math.tan(i)*(a-r),c=D.negativePiToPi(o.longitude+s);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new de(c,e,0)};var jc=g0;var mq=[Hi,di],mVe=mq.length,Yce=Math.cos(D.toRadians(30)),Ice=Math.cos(D.toRadians(150)),Xce=0,Kce=1e3;function d_(e){e=e??G.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??rn.GEODESIC,this._ellipsoid=te.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(d_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+te.packedLength+1+1}}});d_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<mVe;i++)if(t instanceof mq[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var pVe=new h,Dce=new h,Pce=new h;function hq(e,t,n,i,o){let r=Cl(i,e,0,pVe),a=Cl(i,e,n,Dce),s=Cl(i,t,0,Pce),c=_0(a,r,Dce),u=_0(s,r,Pce);return h.cross(u,c,o),h.normalize(o,o)}var gVe=new de,_Ve=new h,AVe=new h,yVe=new h;function sq(e,t,n,i,o,r,a,s,c,u,f){if(o===0)return;let d;r===rn.GEODESIC?d=new u_(e,t,a):r===rn.RHUMB&&(d=new jc(e,t,a));let p=d.surfaceDistance;if(p<o)return;let g=hq(e,t,i,a,yVe),m=Math.ceil(p/o),A=p/m,y=A,x=m-1,b=s.length;for(let T=0;T<x;T++){let E=d.interpolateUsingSurfaceDistance(y,gVe),S=Cl(a,E,n,_Ve),w=Cl(a,E,i,AVe);h.pack(g,s,b),h.pack(S,c,b),h.pack(w,u,b),f.push(E.latitude),f.push(E.longitude),b+=3,y+=A}}var cq=new de;function Cl(e,t,n,i){return de.clone(t,cq),cq.height=n,de.toCartesian(cq,e,i)}d_.pack=function(e,t,n){let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let a=0;a<r;++a){let s=o[a];h.pack(s,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,te.pack(e._ellipsoid,t,i),i+=te.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};d_.unpack=function(e,t,n){let i=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 a=e[i++],s=e[i++]===1,c=e[i++],u=te.unpack(e,i);i+=te.packedLength;let f=e[i++],d=e[i++]===1;return l(n)||(n=new d_({positions:r})),n._positions=r,n.granularity=a,n.loop=s,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function _0(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function Rce(e,t,n,i){return i=_0(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var xVe=new h,bVe=new h,TVe=new h,Qce=new h,CVe=0,EVe=-1;function lq(e,t,n,i,o){let r=_0(n,t,Qce),a=Rce(e,t,r,xVe),s=Rce(i,t,r,bVe);if(D.equalsEpsilon(h.dot(a,s),EVe,D.EPSILON5))return o=h.cross(r,a,o),o=h.normalize(o,o),o;o=h.add(s,a,o),o=h.normalize(o,o);let c=h.cross(r,o,TVe);return h.dot(s,c)<CVe&&(o=h.negate(o,o)),o}var CF=tn.fromPointNormal(h.ZERO,h.UNIT_Y),vVe=new h,SVe=new h,wVe=new h,IVe=new h,DVe=new h,xF=new h,bF=new de,Oce=new de,Mce=new de;d_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,a=new mq[e._projectionIndex](i),s=Xce,c=Kce,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,A,y,x=new jc(void 0,void 0,i),b,T,E,S=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],b=ui.lineSegmentPlane(g,m,CF,xF),l(b)&&!h.equalsEpsilon(b,g,D.EPSILON7)&&!h.equalsEpsilon(b,m,D.EPSILON7)&&(e.arcType===rn.GEODESIC?S.push(h.clone(b)):e.arcType===rn.RHUMB&&(E=i.cartesianToCartographic(b,bF).longitude,A=i.cartesianToCartographic(g,bF),y=i.cartesianToCartographic(m,Oce),x.setEndPoints(A,y),T=x.findIntersectionWithLongitude(E,Mce),b=i.cartographicToCartesian(T,xF),l(b)&&!h.equalsEpsilon(b,g,D.EPSILON7)&&!h.equalsEpsilon(b,m,D.EPSILON7)&&S.push(h.clone(b)))),S.push(m);n&&(g=d[p-1],m=d[0],b=ui.lineSegmentPlane(g,m,CF,xF),l(b)&&!h.equalsEpsilon(b,g,D.EPSILON7)&&!h.equalsEpsilon(b,m,D.EPSILON7)&&(e.arcType===rn.GEODESIC?S.push(h.clone(b)):e.arcType===rn.RHUMB&&(E=i.cartesianToCartographic(b,bF).longitude,A=i.cartesianToCartographic(g,bF),y=i.cartesianToCartographic(m,Oce),x.setEndPoints(A,y),T=x.findIntersectionWithLongitude(E,Mce),b=i.cartographicToCartesian(T,xF),l(b)&&!h.equalsEpsilon(b,g,D.EPSILON7)&&!h.equalsEpsilon(b,m,D.EPSILON7)&&S.push(h.clone(b)))));let w=S.length,P=new Array(w);for(f=0;f<w;f++){let q=de.fromCartesian(S[f],i);q.height=0,P[f]=q}if(P=Fo(P,de.equalsEpsilon),w=P.length,w<2)return;let O=[],B=[],L=[],_=[],C=vVe,v=SVe,I=wVe,M=IVe,N=DVe,j=P[0],k=P[1],V=P[w-1];for(C=Cl(i,V,s,C),M=Cl(i,k,s,M),v=Cl(i,j,s,v),I=Cl(i,j,c,I),n?N=lq(C,v,I,M,N):N=hq(j,k,c,i,N),h.pack(N,B,0),h.pack(v,L,0),h.pack(I,_,0),O.push(j.latitude),O.push(j.longitude),sq(j,k,s,c,o,r,i,B,L,_,O),f=1;f<w-1;++f){C=h.clone(v,C),v=h.clone(M,v);let q=P[f];Cl(i,q,c,I),Cl(i,P[f+1],s,M),lq(C,v,I,M,N),u=B.length,h.pack(N,B,u),h.pack(v,L,u),h.pack(I,_,u),O.push(q.latitude),O.push(q.longitude),sq(P[f],P[f+1],s,c,o,r,i,B,L,_,O)}let F=P[w-1],W=P[w-2];if(v=Cl(i,F,s,v),I=Cl(i,F,c,I),n){let q=P[0];C=Cl(i,W,s,C),M=Cl(i,q,s,M),N=lq(C,v,I,M,N)}else N=hq(W,F,c,i,N);if(u=B.length,h.pack(N,B,u),h.pack(v,L,u),h.pack(I,_,u),O.push(F.latitude),O.push(F.longitude),n){for(sq(F,j,s,c,o,r,i,B,L,_,O),u=B.length,f=0;f<3;++f)B[u+f]=B[f],L[u+f]=L[f],_[u+f]=_[f];O.push(j.latitude),O.push(j.longitude)}return t4e(n,a,L,_,B,O,t)};var PVe=new h,RVe=new $,OVe=new Le;function Bce(e,t,n,i){let o=_0(n,t,PVe),r=h.dot(o,e);if(r>Yce||r<Ice){let a=_0(i,n,Qce),s=r<Ice?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Le.fromAxisAngle(a,s,OVe),u=$.fromQuaternion(c,RVe);return $.multiplyByVector(u,e,e),!0}return!1}var Lce=new de,MVe=new h,Nce=new h;function mI(e,t,n,i,o){let r=de.toCartesian(t,e._ellipsoid,MVe),a=h.add(r,n,Nce),s=!1,c=e._ellipsoid,u=c.cartesianToCartographic(a,Lce);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(s=!0,a=h.subtract(r,n,Nce),u=c.cartesianToCartographic(a,Lce)),u.height=0;let f=e.project(u,o);return o=h.subtract(f,i,o),o.z=0,o=h.normalize(o,o),s&&h.negate(o,o),o}var BVe=new h,Fce=new h;function kce(e,t,n,i,o,r){let a=h.subtract(t,e,BVe);h.normalize(a,a);let s=n-Xce,c=h.multiplyByScalar(a,s,Fce);h.add(e,c,o);let u=i-Kce;c=h.multiplyByScalar(a,u,Fce),h.add(t,c,r)}var LVe=new h;function TF(e,t){let n=tn.getPointDistance(CF,e),i=tn.getPointDistance(CF,t),o=LVe;D.equalsEpsilon(n,0,D.EPSILON2)?(o=_0(t,e,o),h.multiplyByScalar(o,D.EPSILON2,o),h.add(e,o,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(o=_0(e,t,o),h.multiplyByScalar(o,D.EPSILON2,o),h.add(t,o,t))}function NVe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let o=D.sign(t.longitude);return e.longitude=o*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let o=D.sign(e.longitude);return t.longitude=o*(i-D.EPSILON11),2}return 0}var $ce=new de,Jce=new de,zce=new h,uq=new h,Uce=new h,Vce=new h,FVe=new h,jce=new h,kVe=[$ce,Jce],zVe=new oe,UVe=new h,VVe=new h,jVe=new h,GVe=new h,HVe=new h,WVe=new h,fq=new h,dq=new h,qVe=new h,YVe=new h,XVe=new h,Gce=new h,KVe=new h,QVe=new h,$Ve=new Tn,JVe=new Tn,Hce=new h,ZVe=new h,Wce=new h,e4e=[new ce,new ce],Zce=[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],qce=Zce.length;function t4e(e,t,n,i,o,r,a){let s,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),A=new Float64Array(d*3),y=new Float32Array(p),x=new Float32Array(p),b=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),S,w,P,O;a&&(S=new Float32Array(p),w=new Float32Array(p),P=new Float32Array(p),O=new Float32Array(d*2));let B=r.length/2,L=0,_=$ce;_.height=0;let C=Jce;C.height=0;let v=zce,I=uq;if(a)for(c=0,s=1;s<B;s++)_.latitude=r[c],_.longitude=r[c+1],C.latitude=r[c+2],C.longitude=r[c+3],v=t.project(_,v),I=t.project(C,I),L+=h.distance(v,I),c+=2;let M=i.length/3;I=h.unpack(i,0,I);let N=0;for(c=3,s=1;s<M;s++)v=h.clone(I,v),I=h.unpack(i,c,I),N+=h.distance(v,I),c+=3;let j;c=3;let k=0,V=0,F=0,W=0,q=!1,J=h.unpack(n,0,Vce),H=h.unpack(i,0,uq),Z=h.unpack(o,0,jce);if(e){let Ee=h.unpack(n,n.length-6,Uce);Bce(Z,Ee,J,H)&&(Z=h.negate(Z,Z))}let K=0,le=0,me=0;for(s=0;s<f;s++){let Ee=h.clone(J,Uce),Be=h.clone(H,zce),ke=h.clone(Z,FVe);q&&(ke=h.negate(ke,ke)),J=h.unpack(n,c,Vce),H=h.unpack(i,c,uq),Z=h.unpack(o,c,jce),q=Bce(Z,Ee,J,H),_.latitude=r[k],_.longitude=r[k+1],C.latitude=r[k+2],C.longitude=r[k+3];let Ge,rt,et,Pe;if(a){let ii=NVe(_,C);Ge=t.project(_,HVe),rt=t.project(C,WVe);let Lr=_0(rt,Ge,Hce);Lr.y=Math.abs(Lr.y),et=fq,Pe=dq,ii===0||h.dot(Lr,h.UNIT_Y)>Yce?(et=mI(t,_,ke,Ge,fq),Pe=mI(t,C,Z,rt,dq)):ii===1?(Pe=mI(t,C,Z,rt,dq),et.x=0,et.y=D.sign(_.longitude-Math.abs(C.longitude)),et.z=0):(et=mI(t,_,ke,Ge,fq),Pe.x=0,Pe.y=D.sign(_.longitude-C.longitude),Pe.z=0)}let Ye=h.distance(Be,H),ut=Tn.fromCartesian(Ee,$Ve),Ct=h.subtract(J,Ee,qVe),en=h.normalize(Ct,Gce),Gt=h.subtract(Be,Ee,YVe);Gt=h.normalize(Gt,Gt);let yt=h.cross(en,Gt,Gce);yt=h.normalize(yt,yt);let wt=h.cross(Gt,ke,KVe);wt=h.normalize(wt,wt);let xn=h.subtract(H,J,XVe);xn=h.normalize(xn,xn);let at=h.cross(Z,xn,QVe);at=h.normalize(at,at);let st=Ye/N,Ln=K/N,Nn=0,so,jo,to,no=0,jn=0;if(a){Nn=h.distance(Ge,rt),so=Tn.fromCartesian(Ge,JVe),jo=h.subtract(rt,Ge,Hce),to=h.normalize(jo,ZVe);let ii=to.x;to.x=to.y,to.y=-ii,no=Nn/L,jn=le/L}for(j=0;j<8;j++){let ii=W+j*4,Lr=V+j*2,So=ii+3,Di=j<4?1:-1,ai=j===2||j===3||j===6||j===7?1:-1;h.pack(ut.high,y,ii),y[So]=Ct.x,h.pack(ut.low,x,ii),x[So]=Ct.y,h.pack(wt,b,ii),b[So]=Ct.z,h.pack(at,T,ii),T[So]=st*Di,h.pack(yt,E,ii);let Oo=Ln*ai;Oo===0&&ai<0&&(Oo=9),E[So]=Oo,a&&(S[ii]=so.high.x,S[ii+1]=so.high.y,S[ii+2]=so.low.x,S[ii+3]=so.low.y,P[ii]=-et.y,P[ii+1]=et.x,P[ii+2]=Pe.y,P[ii+3]=-Pe.x,w[ii]=jo.x,w[ii+1]=jo.y,w[ii+2]=to.x,w[ii+3]=to.y,O[Lr]=no*Di,Oo=jn*ai,Oo===0&&ai<0&&(Oo=9),O[Lr+1]=Oo)}let Gn=jVe,sn=GVe,Qn=UVe,Tr=VVe,ma=oe.fromCartographicArray(kVe,zVe),Qa=wi.getMinimumMaximumHeights(ma,u),Ba=Qa.minimumTerrainHeight,$a=Qa.maximumTerrainHeight;me+=Math.abs(Ba),me+=Math.abs($a),kce(Ee,Be,Ba,$a,Gn,Qn),kce(J,H,Ba,$a,sn,Tr);let lr=h.multiplyByScalar(yt,D.EPSILON5,Wce);h.add(Gn,lr,Gn),h.add(sn,lr,sn),h.add(Qn,lr,Qn),h.add(Tr,lr,Tr),TF(Gn,sn),TF(Qn,Tr),h.pack(Gn,A,F),h.pack(sn,A,F+3),h.pack(Tr,A,F+6),h.pack(Qn,A,F+9),lr=h.multiplyByScalar(yt,-2*D.EPSILON5,Wce),h.add(Gn,lr,Gn),h.add(sn,lr,sn),h.add(Qn,lr,Qn),h.add(Tr,lr,Tr),TF(Gn,sn),TF(Qn,Tr),h.pack(Gn,A,F+12),h.pack(sn,A,F+15),h.pack(Tr,A,F+18),h.pack(Qn,A,F+21),k+=2,c+=3,V+=16,F+=24,W+=32,K+=Ye,le+=Nn}c=0;let ae=0;for(s=0;s<f;s++){for(j=0;j<qce;j++)m[c+j]=Zce[j]+ae;ae+=8,c+=qce}let be=e4e;ce.fromVertices(n,h.ZERO,3,be[0]),ce.fromVertices(i,h.ZERO,3,be[1]);let ge=ce.fromBoundingSpheres(be);ge.radius+=me/(f*2);let we={position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:A}),startHiAndForwardOffsetX:f_(y),startLoAndForwardOffsetY:f_(x),startNormalAndForwardOffsetZ:f_(b),endNormalAndTextureCoordinateNormalizationX:f_(T),rightNormalAndTextureCoordinateNormalizationY:f_(E)};return a&&(we.startHiLo2D=f_(S),we.offsetAndRight2D=f_(w),we.startEndNormals2D=f_(P),we.texcoordNormalization2D=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:O})),new At({attributes:we,indices:m,boundingSphere:ge})}function f_(e){return new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}d_._projectNormal=mI;var fC=d_;var EF=`in vec4 v_startPlaneNormalEcAndHalfWidth;
  4847. in vec4 v_endPlaneNormalEcAndBatchId;
  4848. in vec4 v_rightPlaneEC; // Technically can compute distance for this here
  4849. in vec4 v_endEcAndStartEcX;
  4850. in vec4 v_texcoordNormalizationAndStartEcYZ;
  4851. #ifdef PER_INSTANCE_COLOR
  4852. in vec4 v_color;
  4853. #endif
  4854. void main(void)
  4855. {
  4856. float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
  4857. vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);
  4858. // Discard for sky
  4859. if (logDepthOrDepth == 0.0) {
  4860. #ifdef DEBUG_SHOW_VOLUME
  4861. out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
  4862. return;
  4863. #else // DEBUG_SHOW_VOLUME
  4864. discard;
  4865. #endif // DEBUG_SHOW_VOLUME
  4866. }
  4867. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  4868. eyeCoordinate /= eyeCoordinate.w;
  4869. float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
  4870. // Check distance of the eye coordinate against the right-facing plane
  4871. float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
  4872. // Check eye coordinate against the mitering planes
  4873. float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
  4874. float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);
  4875. if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
  4876. #ifdef DEBUG_SHOW_VOLUME
  4877. out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
  4878. return;
  4879. #else // DEBUG_SHOW_VOLUME
  4880. discard;
  4881. #endif // DEBUG_SHOW_VOLUME
  4882. }
  4883. // Check distance of the eye coordinate against start and end planes with normals in the right plane.
  4884. // For computing unskewed lengthwise texture coordinate.
  4885. // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.
  4886. // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"
  4887. vec3 alignedPlaneNormal;
  4888. // start aligned plane
  4889. alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
  4890. alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
  4891. distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);
  4892. // end aligned plane
  4893. alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);
  4894. alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
  4895. distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);
  4896. #ifdef PER_INSTANCE_COLOR
  4897. out_FragColor = czm_gammaCorrect(v_color);
  4898. #else // PER_INSTANCE_COLOR
  4899. // Clamp - distance to aligned planes may be negative due to mitering,
  4900. // so fragment texture coordinate might be out-of-bounds.
  4901. float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);
  4902. s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;
  4903. float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);
  4904. czm_materialInput materialInput;
  4905. materialInput.s = s;
  4906. materialInput.st = vec2(s, t);
  4907. materialInput.str = vec3(s, t, 0.0);
  4908. czm_material material = czm_getMaterial(materialInput);
  4909. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  4910. #endif // PER_INSTANCE_COLOR
  4911. // Premultiply alpha. Required for classification primitives on translucent globe.
  4912. out_FragColor.rgb *= out_FragColor.a;
  4913. czm_writeDepthClamp();
  4914. }
  4915. `;var vF=`in vec3 v_forwardDirectionEC;
  4916. in vec3 v_texcoordNormalizationAndHalfWidth;
  4917. in float v_batchId;
  4918. #ifdef PER_INSTANCE_COLOR
  4919. in vec4 v_color;
  4920. #else
  4921. in vec2 v_alignedPlaneDistances;
  4922. in float v_texcoordT;
  4923. #endif
  4924. float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {
  4925. // We don't expect the ray to ever be parallel to the plane
  4926. return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);
  4927. }
  4928. void main(void)
  4929. {
  4930. vec4 eyeCoordinate = gl_FragCoord;
  4931. eyeCoordinate /= eyeCoordinate.w;
  4932. #ifdef PER_INSTANCE_COLOR
  4933. out_FragColor = czm_gammaCorrect(v_color);
  4934. #else // PER_INSTANCE_COLOR
  4935. // Use distances for planes aligned with segment to prevent skew in dashing
  4936. float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);
  4937. float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);
  4938. // Clamp - distance to aligned planes may be negative due to mitering
  4939. distanceFromStart = max(0.0, distanceFromStart);
  4940. distanceFromEnd = max(0.0, distanceFromEnd);
  4941. float s = distanceFromStart / (distanceFromStart + distanceFromEnd);
  4942. s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;
  4943. czm_materialInput materialInput;
  4944. materialInput.s = s;
  4945. materialInput.st = vec2(s, v_texcoordT);
  4946. materialInput.str = vec3(s, v_texcoordT, 0.0);
  4947. czm_material material = czm_getMaterial(materialInput);
  4948. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  4949. #endif // PER_INSTANCE_COLOR
  4950. }
  4951. `;var SF=`in vec3 position3DHigh;
  4952. in vec3 position3DLow;
  4953. in vec4 startHiAndForwardOffsetX;
  4954. in vec4 startLoAndForwardOffsetY;
  4955. in vec4 startNormalAndForwardOffsetZ;
  4956. in vec4 endNormalAndTextureCoordinateNormalizationX;
  4957. in vec4 rightNormalAndTextureCoordinateNormalizationY;
  4958. in vec4 startHiLo2D;
  4959. in vec4 offsetAndRight2D;
  4960. in vec4 startEndNormals2D;
  4961. in vec2 texcoordNormalization2D;
  4962. in float batchId;
  4963. out vec3 v_forwardDirectionEC;
  4964. out vec3 v_texcoordNormalizationAndHalfWidth;
  4965. out float v_batchId;
  4966. // For materials
  4967. #ifdef WIDTH_VARYING
  4968. out float v_width;
  4969. #endif
  4970. #ifdef ANGLE_VARYING
  4971. out float v_polylineAngle;
  4972. #endif
  4973. #ifdef PER_INSTANCE_COLOR
  4974. out vec4 v_color;
  4975. #else
  4976. out vec2 v_alignedPlaneDistances;
  4977. out float v_texcoordT;
  4978. #endif
  4979. // Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.
  4980. // Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.
  4981. void main()
  4982. {
  4983. v_batchId = batchId;
  4984. // Start position
  4985. vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
  4986. vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
  4987. vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
  4988. vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
  4989. vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
  4990. vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
  4991. // Start plane
  4992. vec4 startPlane2D;
  4993. vec4 startPlane3D;
  4994. startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
  4995. startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
  4996. startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
  4997. startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);
  4998. // Right plane
  4999. vec4 rightPlane2D;
  5000. vec4 rightPlane3D;
  5001. rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
  5002. rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
  5003. rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
  5004. rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);
  5005. // End position
  5006. posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
  5007. posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
  5008. posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
  5009. posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
  5010. posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
  5011. vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
  5012. vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
  5013. vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));
  5014. // End plane
  5015. vec4 endPlane2D;
  5016. vec4 endPlane3D;
  5017. endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
  5018. endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
  5019. endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
  5020. endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);
  5021. // Forward direction
  5022. v_forwardDirectionEC = normalize(endEC - startEC);
  5023. vec2 cleanTexcoordNormalization2D;
  5024. cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
  5025. cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
  5026. vec2 cleanTexcoordNormalization3D;
  5027. cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
  5028. cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
  5029. cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));
  5030. v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);
  5031. #ifdef PER_INSTANCE_COLOR
  5032. v_color = czm_batchTable_color(batchId);
  5033. #else // PER_INSTANCE_COLOR
  5034. // For computing texture coordinates
  5035. v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
  5036. v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
  5037. #endif // PER_INSTANCE_COLOR
  5038. #ifdef WIDTH_VARYING
  5039. float width = czm_batchTable_width(batchId);
  5040. float halfWidth = width * 0.5;
  5041. v_width = width;
  5042. v_texcoordNormalizationAndHalfWidth.z = halfWidth;
  5043. #else
  5044. float halfWidth = 0.5 * czm_batchTable_width(batchId);
  5045. v_texcoordNormalizationAndHalfWidth.z = halfWidth;
  5046. #endif
  5047. // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
  5048. // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
  5049. // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
  5050. // Since this is morphing, compute both 3D and 2D positions and then blend.
  5051. // ****** 3D ******
  5052. // Check distance to the end plane and start plane, pick the plane that is closer
  5053. vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition
  5054. float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
  5055. float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
  5056. vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
  5057. vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
  5058. vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
  5059. // Nudge the top vertex upwards to prevent flickering
  5060. vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
  5061. geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
  5062. geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
  5063. positionEc3D.xyz += geodeticSurfaceNormal;
  5064. // Determine if this vertex is on the "left" or "right"
  5065. normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
  5066. // A "perfect" implementation would push along normals according to the angle against forward.
  5067. // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
  5068. positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
  5069. // ****** 2D ******
  5070. // Check distance to the end plane and start plane, pick the plane that is closer
  5071. vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition
  5072. absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
  5073. absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
  5074. planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
  5075. upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
  5076. normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
  5077. // Nudge the top vertex upwards to prevent flickering
  5078. geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
  5079. geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
  5080. geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
  5081. positionEc2D.xyz += geodeticSurfaceNormal;
  5082. // Determine if this vertex is on the "left" or "right"
  5083. normalEC *= sign(texcoordNormalization2D.x);
  5084. #ifndef PER_INSTANCE_COLOR
  5085. // Use vertex's sidedness to compute its texture coordinate.
  5086. v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
  5087. #endif
  5088. // A "perfect" implementation would push along normals according to the angle against forward.
  5089. // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
  5090. positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
  5091. // Blend for actual position
  5092. gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);
  5093. #ifdef ANGLE_VARYING
  5094. // Approximate relative screen space direction of the line.
  5095. vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
  5096. approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
  5097. v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
  5098. #endif
  5099. }
  5100. `;var wF=`in vec3 position3DHigh;
  5101. in vec3 position3DLow;
  5102. // In 2D and in 3D, texture coordinate normalization component signs encodes:
  5103. // * X sign - sidedness relative to right plane
  5104. // * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume
  5105. #ifndef COLUMBUS_VIEW_2D
  5106. in vec4 startHiAndForwardOffsetX;
  5107. in vec4 startLoAndForwardOffsetY;
  5108. in vec4 startNormalAndForwardOffsetZ;
  5109. in vec4 endNormalAndTextureCoordinateNormalizationX;
  5110. in vec4 rightNormalAndTextureCoordinateNormalizationY;
  5111. #else
  5112. in vec4 startHiLo2D;
  5113. in vec4 offsetAndRight2D;
  5114. in vec4 startEndNormals2D;
  5115. in vec2 texcoordNormalization2D;
  5116. #endif
  5117. in float batchId;
  5118. out vec4 v_startPlaneNormalEcAndHalfWidth;
  5119. out vec4 v_endPlaneNormalEcAndBatchId;
  5120. out vec4 v_rightPlaneEC;
  5121. out vec4 v_endEcAndStartEcX;
  5122. out vec4 v_texcoordNormalizationAndStartEcYZ;
  5123. // For materials
  5124. #ifdef WIDTH_VARYING
  5125. out float v_width;
  5126. #endif
  5127. #ifdef ANGLE_VARYING
  5128. out float v_polylineAngle;
  5129. #endif
  5130. #ifdef PER_INSTANCE_COLOR
  5131. out vec4 v_color;
  5132. #endif
  5133. void main()
  5134. {
  5135. #ifdef COLUMBUS_VIEW_2D
  5136. vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;
  5137. vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);
  5138. vec3 ecEnd = forwardDirectionEC + ecStart;
  5139. forwardDirectionEC = normalize(forwardDirectionEC);
  5140. // Right plane
  5141. v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
  5142. v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
  5143. // start plane
  5144. vec4 startPlaneEC;
  5145. startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
  5146. startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
  5147. // end plane
  5148. vec4 endPlaneEC;
  5149. endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
  5150. endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
  5151. v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);
  5152. v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;
  5153. #else // COLUMBUS_VIEW_2D
  5154. vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;
  5155. vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);
  5156. vec3 ecEnd = ecStart + offset;
  5157. vec3 forwardDirectionEC = normalize(offset);
  5158. // start plane
  5159. vec4 startPlaneEC;
  5160. startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
  5161. startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
  5162. // end plane
  5163. vec4 endPlaneEC;
  5164. endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
  5165. endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
  5166. // Right plane
  5167. v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
  5168. v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
  5169. v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
  5170. v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;
  5171. #endif // COLUMBUS_VIEW_2D
  5172. v_endEcAndStartEcX.xyz = ecEnd;
  5173. v_endEcAndStartEcX.w = ecStart.x;
  5174. v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;
  5175. #ifdef PER_INSTANCE_COLOR
  5176. v_color = czm_batchTable_color(batchId);
  5177. #endif // PER_INSTANCE_COLOR
  5178. // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
  5179. // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
  5180. // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
  5181. vec4 positionRelativeToEye = czm_computePosition();
  5182. // Check distance to the end plane and start plane, pick the plane that is closer
  5183. vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition
  5184. float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));
  5185. float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));
  5186. vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);
  5187. vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
  5188. vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
  5189. // Extrude bottom vertices downward for far view distances, like for GroundPrimitives
  5190. upOrDown = cross(forwardDirectionEC, normalEC);
  5191. upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;
  5192. upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;
  5193. upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;
  5194. positionEC.xyz += upOrDown;
  5195. v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));
  5196. // Determine distance along normalEC to push for a volume of appropriate width.
  5197. // Make volumes about double pixel width for a conservative fit - in practice the
  5198. // extra cost here is minimal compared to the loose volume heights.
  5199. //
  5200. // N = normalEC (guaranteed "right-facing")
  5201. // R = rightEC
  5202. // p = angle between N and R
  5203. // w = distance to push along R if R == N
  5204. // d = distance to push along N
  5205. //
  5206. // N R
  5207. // { p| } * cos(p) = dot(N, R) = w / d
  5208. // d | |w * d = w / dot(N, R)
  5209. // { | }
  5210. // o---------- polyline segment ---->
  5211. //
  5212. float width = czm_batchTable_width(batchId);
  5213. #ifdef WIDTH_VARYING
  5214. v_width = width;
  5215. #endif
  5216. v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;
  5217. v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;
  5218. v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;
  5219. v_endPlaneNormalEcAndBatchId.w = batchId;
  5220. width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R
  5221. width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N
  5222. // Determine if this vertex is on the "left" or "right"
  5223. #ifdef COLUMBUS_VIEW_2D
  5224. normalEC *= sign(texcoordNormalization2D.x);
  5225. #else
  5226. normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
  5227. #endif
  5228. positionEC.xyz += width * normalEC;
  5229. gl_Position = czm_depthClamp(czm_projection * positionEC);
  5230. #ifdef ANGLE_VARYING
  5231. // Approximate relative screen space direction of the line.
  5232. vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));
  5233. approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
  5234. v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
  5235. #endif
  5236. }
  5237. `;var IF=`in vec3 position3DHigh;
  5238. in vec3 position3DLow;
  5239. in vec3 prevPosition3DHigh;
  5240. in vec3 prevPosition3DLow;
  5241. in vec3 nextPosition3DHigh;
  5242. in vec3 nextPosition3DLow;
  5243. in vec2 expandAndWidth;
  5244. in vec4 color;
  5245. in float batchId;
  5246. out vec4 v_color;
  5247. void main()
  5248. {
  5249. float expandDir = expandAndWidth.x;
  5250. float width = abs(expandAndWidth.y) + 0.5;
  5251. bool usePrev = expandAndWidth.y < 0.0;
  5252. vec4 p = czm_computePosition();
  5253. vec4 prev = czm_computePrevPosition();
  5254. vec4 next = czm_computeNextPosition();
  5255. float angle;
  5256. vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
  5257. gl_Position = czm_viewportOrthographic * positionWC;
  5258. v_color = color;
  5259. }
  5260. `;var ru=`void clipLineSegmentToNearPlane(
  5261. vec3 p0,
  5262. vec3 p1,
  5263. out vec4 positionWC,
  5264. out bool clipped,
  5265. out bool culledByNearPlane,
  5266. out vec4 clippedPositionEC)
  5267. {
  5268. culledByNearPlane = false;
  5269. clipped = false;
  5270. vec3 p0ToP1 = p1 - p0;
  5271. float magnitude = length(p0ToP1);
  5272. vec3 direction = normalize(p0ToP1);
  5273. // Distance that p0 is behind the near plane. Negative means p0 is
  5274. // in front of the near plane.
  5275. float endPoint0Distance = czm_currentFrustum.x + p0.z;
  5276. // Camera looks down -Z.
  5277. // When moving a point along +Z: LESS VISIBLE
  5278. // * Points in front of the camera move closer to the camera.
  5279. // * Points behind the camrea move farther away from the camera.
  5280. // When moving a point along -Z: MORE VISIBLE
  5281. // * Points in front of the camera move farther away from the camera.
  5282. // * Points behind the camera move closer to the camera.
  5283. // Positive denominator: -Z, becoming more visible
  5284. // Negative denominator: +Z, becoming less visible
  5285. // Nearly zero: parallel to near plane
  5286. float denominator = -direction.z;
  5287. if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
  5288. {
  5289. // p0 is behind the near plane and the line to p1 is nearly parallel to
  5290. // the near plane, so cull the segment completely.
  5291. culledByNearPlane = true;
  5292. }
  5293. else if (endPoint0Distance > 0.0)
  5294. {
  5295. // p0 is behind the near plane, and the line to p1 is moving distinctly
  5296. // toward or away from it.
  5297. // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)
  5298. float t = endPoint0Distance / denominator;
  5299. if (t < 0.0 || t > magnitude)
  5300. {
  5301. // Near plane intersection is not between the two points.
  5302. // We already confirmed p0 is behind the naer plane, so now
  5303. // we know the entire segment is behind it.
  5304. culledByNearPlane = true;
  5305. }
  5306. else
  5307. {
  5308. // Segment crosses the near plane, update p0 to lie exactly on it.
  5309. p0 = p0 + t * direction;
  5310. // Numerical noise might put us a bit on the wrong side of the near plane.
  5311. // Don't let that happen.
  5312. p0.z = min(p0.z, -czm_currentFrustum.x);
  5313. clipped = true;
  5314. }
  5315. }
  5316. clippedPositionEC = vec4(p0, 1.0);
  5317. positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);
  5318. }
  5319. vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)
  5320. {
  5321. // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.
  5322. #ifdef POLYLINE_DASH
  5323. // Compute the window coordinates of the points.
  5324. vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
  5325. vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
  5326. vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);
  5327. // Determine the relative screen space direction of the line.
  5328. vec2 lineDir;
  5329. if (usePrevious) {
  5330. lineDir = normalize(positionWindow.xy - previousWindow.xy);
  5331. }
  5332. else {
  5333. lineDir = normalize(nextWindow.xy - positionWindow.xy);
  5334. }
  5335. angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)
  5336. // Quantize the angle so it doesn't change rapidly between segments.
  5337. angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;
  5338. #endif
  5339. vec4 clippedPrevWC, clippedPrevEC;
  5340. bool prevSegmentClipped, prevSegmentCulled;
  5341. clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);
  5342. vec4 clippedNextWC, clippedNextEC;
  5343. bool nextSegmentClipped, nextSegmentCulled;
  5344. clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);
  5345. bool segmentClipped, segmentCulled;
  5346. vec4 clippedPositionWC, clippedPositionEC;
  5347. clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);
  5348. if (segmentCulled)
  5349. {
  5350. return vec4(0.0, 0.0, 0.0, 1.0);
  5351. }
  5352. vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);
  5353. vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);
  5354. // If a segment was culled, we can't use the corresponding direction
  5355. // computed above. We should never see both of these be true without
  5356. // \`segmentCulled\` above also being true.
  5357. if (prevSegmentCulled)
  5358. {
  5359. directionToPrevWC = -directionToNextWC;
  5360. }
  5361. else if (nextSegmentCulled)
  5362. {
  5363. directionToNextWC = -directionToPrevWC;
  5364. }
  5365. vec2 thisSegmentForwardWC, otherSegmentForwardWC;
  5366. if (usePrevious)
  5367. {
  5368. thisSegmentForwardWC = -directionToPrevWC;
  5369. otherSegmentForwardWC = directionToNextWC;
  5370. }
  5371. else
  5372. {
  5373. thisSegmentForwardWC = directionToNextWC;
  5374. otherSegmentForwardWC = -directionToPrevWC;
  5375. }
  5376. vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);
  5377. vec2 leftWC = thisSegmentLeftWC;
  5378. float expandWidth = width * 0.5;
  5379. // When lines are split at the anti-meridian, the position may be at the
  5380. // same location as the next or previous position, and we need to handle
  5381. // that to avoid producing NaNs.
  5382. if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))
  5383. {
  5384. vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);
  5385. vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;
  5386. float leftSumLength = length(leftSumWC);
  5387. leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);
  5388. // The sine of the angle between the two vectors is given by the formula
  5389. // |a x b| = |a||b|sin(theta)
  5390. // which is
  5391. // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));
  5392. // Because the z components of both vectors are zero, the x and y coordinate will be zero.
  5393. // Therefore, the sine of the angle is just the z component of the cross product.
  5394. vec2 u = -thisSegmentForwardWC;
  5395. vec2 v = leftWC;
  5396. float sinAngle = abs(u.x * v.y - u.y * v.x);
  5397. expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);
  5398. }
  5399. vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
  5400. return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;
  5401. }
  5402. vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)
  5403. {
  5404. vec4 positionEC = czm_modelViewRelativeToEye * position;
  5405. vec4 prevEC = czm_modelViewRelativeToEye * previous;
  5406. vec4 nextEC = czm_modelViewRelativeToEye * next;
  5407. return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
  5408. }
  5409. `;var n4e=`#define CLIP_POLYLINE
  5410. ${ru}
  5411. ${IF}`,i4e=oC;function Yy(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Yy.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??n4e,this._fragmentShaderSource=e.fragmentShaderSource??i4e,this._renderState=xo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Yy.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}}});Yy.VERTEX_FORMAT=Ne.POSITION_ONLY;Yy.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;Yy.prototype.isTranslucent=xo.prototype.isTranslucent;Yy.prototype.getRenderState=xo.prototype.getRenderState;var Ua=Yy;var DF=`in vec3 position3DHigh;
  5412. in vec3 position3DLow;
  5413. in vec3 prevPosition3DHigh;
  5414. in vec3 prevPosition3DLow;
  5415. in vec3 nextPosition3DHigh;
  5416. in vec3 nextPosition3DLow;
  5417. in vec2 expandAndWidth;
  5418. in vec2 st;
  5419. in float batchId;
  5420. out float v_width;
  5421. out vec2 v_st;
  5422. out float v_polylineAngle;
  5423. void main()
  5424. {
  5425. float expandDir = expandAndWidth.x;
  5426. float width = abs(expandAndWidth.y) + 0.5;
  5427. bool usePrev = expandAndWidth.y < 0.0;
  5428. vec4 p = czm_computePosition();
  5429. vec4 prev = czm_computePrevPosition();
  5430. vec4 next = czm_computeNextPosition();
  5431. float angle;
  5432. vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
  5433. gl_Position = czm_viewportOrthographic * positionWC;
  5434. v_width = width;
  5435. v_st.s = st.s;
  5436. v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
  5437. v_polylineAngle = angle;
  5438. }
  5439. `;var dC=`#ifdef VECTOR_TILE
  5440. uniform vec4 u_highlightColor;
  5441. #endif
  5442. in vec2 v_st;
  5443. void main()
  5444. {
  5445. czm_materialInput materialInput;
  5446. vec2 st = v_st;
  5447. st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);
  5448. materialInput.s = st.s;
  5449. materialInput.st = st;
  5450. materialInput.str = vec3(st, 0.0);
  5451. czm_material material = czm_getMaterial(materialInput);
  5452. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  5453. #ifdef VECTOR_TILE
  5454. out_FragColor *= u_highlightColor;
  5455. #endif
  5456. czm_writeLogDepth();
  5457. }
  5458. `;var o4e=`#define CLIP_POLYLINE
  5459. ${ru}
  5460. ${DF}`,r4e=dC;function Xy(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Xy.VERTEX_FORMAT;this.material=l(e.material)?e.material:qi.fromType(qi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o4e,this._fragmentShaderSource=e.fragmentShaderSource??r4e,this._renderState=xo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Xy.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
  5461. ${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}}});Xy.VERTEX_FORMAT=Ne.POSITION_AND_ST;Xy.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;Xy.prototype.isTranslucent=xo.prototype.isTranslucent;Xy.prototype.getRenderState=xo.prototype.getRenderState;var mc=Xy;function A0(e){e=e??G.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new mc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Yn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous: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=ele(!1),this._renderState3DTiles=ele(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:Li.FRONT},depthTest:{enabled:!0},blending:Jt.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(A0.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}}});A0.initializeTerrainHeights=function(){return wi.initialize()};function a4e(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,a=o._batchTable.getVertexShaderCallback()(wF);a=Pn._appendShowToShader(o,a),a=Pn._appendDistanceDisplayConditionToShader(o,a),a=Pn._modifyShaderPosition(e,a,t.scene3DOnly);let s=o._batchTable.getVertexShaderCallback()(SF);s=Pn._appendShowToShader(o,s),s=Pn._appendDistanceDisplayConditionToShader(o,s),s=Pn._modifyShaderPosition(e,s,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(EF),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new He({defines:u,sources:[a]}),m=new He({defines:p,sources:[d,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:r});let A=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(A)){let x=new He({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[a]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:x,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=A;let y=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(y)){let x=new He({defines:u.concat([`MAX_TERRAIN_HEIGHT ${wi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[s]});c=o._batchTable.getVertexShaderCallback()(vF);let b=new He({defines:p,sources:[d,c]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:x,fragmentShaderSource:b,attributeLocations:r})}e._spMorph=y}function ele(e){return Ve.fromCache({cull:{enabled:!0},blending:Jt.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Xn.EQUAL,frontOperation:{fail:vt.KEEP,zFail:vt.KEEP,zPass:vt.KEEP},backFunction:Xn.EQUAL,backOperation:{fail:vt.KEEP,zFail:vt.KEEP,zPass:vt.KEEP},reference:Ht.CESIUM_3D_TILE_MASK,mask:Ht.CESIUM_3D_TILE_MASK}})}function s4e(e,t,n,i,o,r){let a=e._primitive,s=a._va.length;o.length=s,r.length=s;let u=t instanceof Ua?{}:n._uniforms,f=a._batchTable.getUniformMapCallback()(u);for(let d=0;d<s;d++){let p=a._va[d],g=o[d];l(g)||(g=o[d]=new tt({owner:e,primitiveType:a._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ie.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=tt.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let A=tt.shallowClone(g,g.derivedCommands.color2D);A.shaderProgram=e._sp2D,g.derivedCommands.color2D=A;let y=tt.shallowClone(m,m.derivedCommands.color2D);y.shaderProgram=e._sp2D,m.derivedCommands.color2D=y;let x=tt.shallowClone(g,g.derivedCommands.colorMorph);x.renderState=e._renderStateMorph,x.shaderProgram=e._spMorph,x.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=x}}function tle(e,t,n,i,o,r,a){n.mode===ie.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ie.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function c4e(e,t,n,i,o,r,a){let s=e._primitive;Pn._updateBoundingVolumes(s,t,o);let c;t.mode===ie.SCENE3D?c=s._boundingSphereWC:t.mode===ie.COLUMBUS_VIEW?c=s._boundingSphereCV:t.mode===ie.SCENE2D&&l(s._boundingSphere2D)?c=s._boundingSphere2D:l(s._boundingSphereMorph)&&(c=s._boundingSphereMorph);let u=t.mode===ie.MORPHING,f=e.classificationType,d=f!==Yn.CESIUM_3D_TILE,p=f!==Yn.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&s.allowPicking){let A=n.length;for(let y=0;y<A;++y){let x=c[y];d&&(g=n[y],tle(e,g,t,o,r,x,a)),p&&(g=n[y].derivedCommands.tileset,tle(e,g,t,o,r,x,a))}}}A0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!wi.initialized){A0.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,a=new Array(r),s;for(t=0;t<r;++t)if(s=o[t].attributes,!l(s)||!l(s.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];s={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(s[f]=u[f]);l(s.width)||(s.width=new Tl({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,fC.setProjectionAndEllipsoid(c.geometry,e.mapProjection),a[t]=new Bt({geometry:c.geometry,attributes:s,id:c.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){a4e(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){s4e(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,A){c4e(n,u,f,d,p,g,m)},this._primitive=new Pn(i)}if(this.appearance instanceof Ua&&!this._hasPerInstanceColors)throw new _e("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))})};A0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};A0.isSupported=function(e){return e.frameState.context.depthTexture};A0.prototype.isDestroyed=function(){return!1};A0.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,fe(this)};var Im=A0;var l4e=new z(1,1),u4e=!1,f4e=U.WHITE;function hC(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new ye,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(hC.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:pe("image"),repeat:pe("repeat"),color:pe("color"),transparent:pe("transparent")});hC.prototype.getType=function(e){return"Image"};var d4e=new Q;hC.prototype.getValue=function(e,t){return l(e)||(e=Q.now(d4e)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,l4e,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,f4e,t.color),X.getValueOrDefault(this._transparent,e,u4e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};hC.prototype.equals=function(e){return this===e||e instanceof hC&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var Ky=hC;function h4e(e){if(e instanceof U)return new Wt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Ky;return t.image=e,t}}function m4e(e,t){return pe(e,t,h4e)}var er=m4e;function pI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(pI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),dimensions:pe("dimensions"),heightReference:pe("heightReference"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition")});pI.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 pI(this)};pI.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var mC=pI;var nle={FIXED:0,INERTIAL:1};Object.freeze(nle);var Ni=nle;function pC(){_e.throwInstantiationError()}Object.defineProperties(pC.prototype,{isConstant:{get:_e.throwInstantiationError},definitionChanged:{get:_e.throwInstantiationError},referenceFrame:{get:_e.throwInstantiationError}});pC.prototype.getValue=_e.throwInstantiationError;pC.prototype.getValueInReferenceFrame=_e.throwInstantiationError;pC.prototype.equals=_e.throwInstantiationError;var ile=new $;pC.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=pt.computeIcrfToCentralBodyFixedMatrix(e,ile);if(n===Ni.INERTIAL)return $.multiplyByVector(r,t,o);if(n===Ni.FIXED)return $.multiplyByVector($.transpose(r,ile),t,o)};var Dm=pC;function Qy(e,t){this._definitionChanged=new ye,this._value=h.clone(e),this._referenceFrame=t??Ni.FIXED}Object.defineProperties(Qy.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Ni.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var p4e=new Q;Qy.prototype.getValue=function(e,t){return l(e)||(e=Q.now(p4e)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};Qy.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)};Qy.prototype.getValueInReferenceFrame=function(e,t,n){return Dm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Qy.prototype.equals=function(e){return this===e||e instanceof Qy&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var au=Qy;function gI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(gI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),positions:pe("positions"),width:pe("width"),height:pe("height"),heightReference:pe("heightReference"),extrudedHeight:pe("extrudedHeight"),extrudedHeightReference:pe("extrudedHeightReference"),cornerType:pe("cornerType"),granularity:pe("granularity"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition"),classificationType:pe("classificationType"),zIndex:pe("zIndex")});gI.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 gI(this)};gI.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var gC=gI;function g4e(e){return e}function _4e(e,t){return pe(e,t,g4e)}var su=_4e;function _I(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(_I.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),length:pe("length"),topRadius:pe("topRadius"),bottomRadius:pe("bottomRadius"),heightReference:pe("heightReference"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),numberOfVerticalLines:pe("numberOfVerticalLines"),slices:pe("slices"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition")});_I.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 _I(this)};_I.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var _C=_I;function AI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(AI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),semiMajorAxis:pe("semiMajorAxis"),semiMinorAxis:pe("semiMinorAxis"),height:pe("height"),heightReference:pe("heightReference"),extrudedHeight:pe("extrudedHeight"),extrudedHeightReference:pe("extrudedHeightReference"),rotation:pe("rotation"),stRotation:pe("stRotation"),granularity:pe("granularity"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),numberOfVerticalLines:pe("numberOfVerticalLines"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition"),classificationType:pe("classificationType"),zIndex:pe("zIndex")});AI.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 AI(this)};AI.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var AC=AI;function yI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(yI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),radii:pe("radii"),innerRadii:pe("innerRadii"),minimumClock:pe("minimumClock"),maximumClock:pe("maximumClock"),minimumCone:pe("minimumCone"),maximumCone:pe("maximumCone"),heightReference:pe("heightReference"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),stackPartitions:pe("stackPartitions"),slicePartitions:pe("slicePartitions"),subdivisions:pe("subdivisions"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition")});yI.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 yI(this)};yI.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var yC=yI;function xI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(xI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),text:pe("text"),font:pe("font"),style:pe("style"),scale:pe("scale"),showBackground:pe("showBackground"),backgroundColor:pe("backgroundColor"),backgroundPadding:pe("backgroundPadding"),pixelOffset:pe("pixelOffset"),eyeOffset:pe("eyeOffset"),horizontalOrigin:pe("horizontalOrigin"),verticalOrigin:pe("verticalOrigin"),heightReference:pe("heightReference"),fillColor:pe("fillColor"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),translucencyByDistance:pe("translucencyByDistance"),pixelOffsetScaleByDistance:pe("pixelOffsetScaleByDistance"),scaleByDistance:pe("scaleByDistance"),distanceDisplayCondition:pe("distanceDisplayCondition"),disableDepthTestDistance:pe("disableDepthTestDistance")});xI.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 xI(this)};xI.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var Pm=xI;var A4e=new h(1,1,1),y4e=h.ZERO,x4e=Le.IDENTITY;function ole(e,t,n){this.translation=h.clone(e??y4e),this.rotation=Le.clone(t??x4e),this.scale=h.clone(n??A4e)}ole.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var $y=ole;var pq=new $y;function bI(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new ye,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(bI.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:pe("translation"),rotation:pe("rotation"),scale:pe("scale")});var b4e=new Q;bI.prototype.getValue=function(e,t){return l(e)||(e=Q.now(b4e)),l(t)||(t=new $y),t.translation=X.getValueOrClonedDefault(this._translation,e,pq.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,pq.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,pq.scale,t.scale),t};bI.prototype.equals=function(e){return this===e||e instanceof bI&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var xC=bI;function y0(e,t){this._propertyNames=[],this._definitionChanged=new ye,l(e)&&this.merge(e,t)}Object.defineProperties(y0.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(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});y0.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function T4e(e){return new fi(e)}y0.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,pe(e,!0,n??T4e)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};y0.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var C4e=new Q;y0.prototype.getValue=function(e,t){l(e)||(e=Q.now(C4e)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=X.getValueOrUndefined(this[r],e,t[r])}return t};y0.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 a=i[o],s=this[a],c=e[a];s===void 0&&n.indexOf(a)===-1&&this.addProperty(a,void 0,t),c!==void 0&&(s!==void 0?l(s)&&l(s.merge)&&s.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[a]=c.clone():this[a]=c)}};function E4e(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 a=n[r];if(i.indexOf(a)===-1||!X.equals(e[a],t[a]))return!1}return!0}y0.prototype.equals=function(e){return this===e||e instanceof y0&&E4e(this,e)};var cu=y0;function rle(e){return new xC(e)}function v4e(e){return new cu(e,rle)}function S4e(e){return new cu(e)}function w4e(e){return new cu(e)}function TI(e){this._definitionChanged=new ye,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._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=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(e??G.EMPTY_OBJECT)}Object.defineProperties(TI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),uri:pe("uri"),scale:pe("scale"),enableVerticalExaggeration:pe("enableVerticalExaggeration"),minimumPixelSize:pe("minimumPixelSize"),maximumScale:pe("maximumScale"),incrementallyLoadTextures:pe("incrementallyLoadTextures"),runAnimations:pe("runAnimations"),clampAnimations:pe("clampAnimations"),shadows:pe("shadows"),heightReference:pe("heightReference"),silhouetteColor:pe("silhouetteColor"),silhouetteSize:pe("silhouetteSize"),color:pe("color"),colorBlendMode:pe("colorBlendMode"),colorBlendAmount:pe("colorBlendAmount"),imageBasedLightingFactor:pe("imageBasedLightingFactor"),environmentMapOptions:pe("environmentMapOptions",void 0,w4e),lightColor:pe("lightColor"),distanceDisplayCondition:pe("distanceDisplayCondition"),nodeTransformations:pe("nodeTransformations",void 0,v4e),articulations:pe("articulations",void 0,S4e),clippingPlanes:pe("clippingPlanes"),customShader:pe("customShader")});TI.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.environmentMapOptions=this.environmentMapOptions,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 TI(this)};TI.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new cu(t,rle)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new cu(n)}};var h_=TI;function CI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(CI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),uri:pe("uri"),maximumScreenSpaceError:pe("maximumScreenSpaceError")});CI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new CI(this)};CI.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var bC=CI;function EI(e){this._definitionChanged=new ye,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._relativeTo=void 0,this._relativeToSubscription=void 0,this.merge(e??G.EMPTY_OBJECT)}Object.defineProperties(EI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),leadTime:pe("leadTime"),trailTime:pe("trailTime"),width:pe("width"),resolution:pe("resolution"),material:er("material"),distanceDisplayCondition:pe("distanceDisplayCondition"),relativeTo:pe("relativeTo")});EI.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.relativeTo=this.relativeTo,e):new EI(this)};EI.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo};var m_=EI;function vI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(vI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),plane:pe("plane"),dimensions:pe("dimensions"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition")});vI.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 vI(this)};vI.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var PF=vI;function SI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(SI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),pixelSize:pe("pixelSize"),heightReference:pe("heightReference"),color:pe("color"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),scaleByDistance:pe("scaleByDistance"),translucencyByDistance:pe("translucencyByDistance"),distanceDisplayCondition:pe("distanceDisplayCondition"),disableDepthTestDistance:pe("disableDepthTestDistance"),splitDirection:pe("splitDirection")});SI.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 SI(this)};SI.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var TC=SI;function I4e(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Gc=I4e;function D4e(e){return Array.isArray(e)&&(e=new Gc(e)),new fi(e)}function wI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(wI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),hierarchy:pe("hierarchy",void 0,D4e),height:pe("height"),heightReference:pe("heightReference"),extrudedHeight:pe("extrudedHeight"),extrudedHeightReference:pe("extrudedHeightReference"),stRotation:pe("stRotation"),granularity:pe("granularity"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),perPositionHeight:pe("perPositionHeight"),closeTop:pe("closeTop"),closeBottom:pe("closeBottom"),arcType:pe("arcType"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition"),classificationType:pe("classificationType"),zIndex:pe("zIndex"),textureCoordinates:pe("textureCoordinates")});wI.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 wI(this)};wI.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var Rm=wI;function II(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(II.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),positions:pe("positions"),width:pe("width"),granularity:pe("granularity"),material:er("material"),depthFailMaterial:er("depthFailMaterial"),arcType:pe("arcType"),clampToGround:pe("clampToGround"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition"),classificationType:pe("classificationType"),zIndex:pe("zIndex")});II.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 II(this)};II.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var El=II;function DI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(DI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),positions:pe("positions"),shape:pe("shape"),cornerType:pe("cornerType"),granularity:pe("granularity"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition")});DI.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 DI(this)};DI.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var CC=DI;function PI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(PI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),coordinates:pe("coordinates"),height:pe("height"),heightReference:pe("heightReference"),extrudedHeight:pe("extrudedHeight"),extrudedHeightReference:pe("extrudedHeightReference"),rotation:pe("rotation"),stRotation:pe("stRotation"),granularity:pe("granularity"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition"),classificationType:pe("classificationType"),zIndex:pe("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=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Om=PI;function RI(e){this._definitionChanged=new ye,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(e??G.EMPTY_OBJECT)}Object.defineProperties(RI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:pe("show"),positions:pe("positions"),minimumHeights:pe("minimumHeights"),maximumHeights:pe("maximumHeights"),granularity:pe("granularity"),fill:pe("fill"),material:er("material"),outline:pe("outline"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth"),shadows:pe("shadows"),distanceDisplayCondition:pe("distanceDisplayCondition")});RI.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 RI(this)};RI.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var p_=RI;var P4e=new de,gq=[];function R4e(e){return new au(e)}function O4e(e){return pe(e,void 0,R4e)}function Es(e,t){return pe(e,void 0,function(n){return n instanceof t?n:new t(n)})}function $f(e){e=e??G.EMPTY_OBJECT;let t=e.id;l(t)||(t=Hn()),this._availability=void 0,this._id=t,this._definitionChanged=new ye,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??l_.AUTODETECT,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",...gq],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 _q(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],a=r._show;(!n&&a)!==(n&&a)&&_q(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties($f.prototype,{availability:su("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:su("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&&_q(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:su("trackingReferenceFrame"),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&&_q(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Es("billboard",bl),box:Es("box",mC),corridor:Es("corridor",gC),cylinder:Es("cylinder",_C),description:pe("description"),ellipse:Es("ellipse",AC),ellipsoid:Es("ellipsoid",yC),label:Es("label",Pm),model:Es("model",h_),tileset:Es("tileset",bC),orientation:pe("orientation"),path:Es("path",m_),plane:Es("plane",PF),point:Es("point",TC),polygon:Es("polygon",Rm),polyline:Es("polyline",El),polylineVolume:Es("polylineVolume",CC),properties:Es("properties",cu),position:O4e("position"),rectangle:Es("rectangle",Om),viewFrom:pe("viewFrom"),wall:Es("wall",p_)});$f.registerEntityType=function(e,t){Object.defineProperties($f.prototype,{[e]:Es(e,t)}),gq.includes(e)||gq.push(e)};$f.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};$f.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,su(e,!0))};$f.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};$f.prototype.merge=function(e){this.name=this.name??e.name,this.availability=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 a=this[r],s=e[r];!l(a)&&t.indexOf(r)===-1&&this.addProperty(r),l(s)&&(l(a)?l(a.merge)&&a.merge(s):l(s.merge)&&l(s.clone)?this[r]=s.clone():this[r]=s)}};var ale=new $,sle=new h,cle=new Le;$f.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,sle);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,cle);return l(i)?t=R.fromRotationTranslation($.fromQuaternion(i,ale),n,t):t=pt.eastNorthUpToFixedFrame(n,void 0,t),t};$f.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=X.getValueOrDefault(t,e,nt.NONE),a=X.getValueOrUndefined(this._position,e,sle);if(r===nt.NONE||!l(a)||h.equalsEpsilon(a,h.ZERO,D.EPSILON8))return this.computeModelMatrix(e,o);let s=i.cartesianToCartographic(a,P4e);Yf(r)?s.height=n:s.height+=n,a=i.cartographicToCartesian(s,a);let c=X.getValueOrUndefined(this._orientation,e,cle);return l(c)?o=R.fromRotationTranslation($.fromQuaternion(c,ale),a,o):o=pt.eastNorthUpToFixedFrame(a,void 0,o),o};$f.supportsMaterialsforEntitiesOnTerrain=function(e){return ou.supportsMaterials(e)};$f.supportsPolylinesOnTerrain=function(e){return Im.isSupported(e)};var Yo=$f;var M4e=new Wt(U.WHITE),B4e=new fi(!0),L4e=new fi(!0),N4e=new fi(!1),F4e=new fi(U.BLACK),k4e=new fi(vn.DISABLED),z4e=new fi(new kt),U4e=new fi(Yn.BOTH);function vl(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 ye,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=Yo.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(vl.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)&&X.isConstant(this._showProperty)&&X.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)&&X.isConstant(this._showProperty)&&X.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}}});vl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};vl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};vl.prototype.createFillGeometryInstance=_e.throwInstantiationError;vl.prototype.createOutlineGeometryInstance=_e.throwInstantiationError;vl.prototype.isDestroyed=function(){return!1};vl.prototype.destroy=function(){fe(this)};vl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Qe.MINIMUM_VALUE)};vl.prototype._isOnTerrain=function(e,t){return!1};vl.prototype._getIsClosed=function(e){return!0};vl.prototype._isDynamic=_e.throwInstantiationError;vl.prototype._setStaticOptions=_e.throwInstantiationError;vl.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,a=l(r)&&r.isConstant?r.getValue(Qe.MINIMUM_VALUE):!0,s=o.outline,c=l(s);if(c&&s.isConstant&&(c=s.getValue(Qe.MINIMUM_VALUE)),!a&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??M4e,this._fillProperty=r??L4e,this._showProperty=u??B4e,this._showOutlineProperty=o.outline??N4e,this._outlineColorProperty=c?o.outlineColor??F4e:void 0,this._shadowsProperty=o.shadows??k4e,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??z4e,this._classificationTypeProperty=o.classificationType??U4e,this._fillEnabled=a;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Wt);if(c&&f&&(_t(_t.geometryOutlines),c=!1),this._onTerrain=f,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 d=o.outlineWidth;this._outlineWidth=l(d)?d.getValue(Qe.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};vl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Ci=vl;function EC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new ye,this.setCallback(e,t)}Object.defineProperties(EC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var V4e=new Q;EC.prototype.getValue=function(e,t){return l(e)||(e=Q.now(V4e)),this._callback(e,t)};EC.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};EC.prototype.equals=function(e){return this===e||e instanceof EC&&this._callback===e._callback&&this._isConstant===e._isConstant};var Mm=EC;var lle=new h;function vC(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new de,this._normal=new h,this._definitionChanged=new ye,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(Qe.MINIMUM_VALUE,lle);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(vC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});vC.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=a=>{this._terrainHeight=a.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var j4e=new Q;vC.prototype.getValue=function(e,t){l(e)||(e=Q.now(j4e));let n=X.getValueOrDefault(this._heightReference,e,nt.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,nt.NONE);if(n===nt.NONE&&!eC(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,lle);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,D.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let a=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return h.multiplyByScalar(a,this._terrainHeight,t)};vC.prototype.isDestroyed=function(){return!1};vC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),fe(this)};var SC=vC;function G4e(e,t,n,i){if(Ci.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 a=new Mm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new SC(this._scene,a,r)}}var g_=G4e;var ule=h.ZERO,fle=new h,H4e=new h,dle=new U;function W4e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Xu(e,t){Ci.call(this,{entity:e,scene:t,geometryOptions:new W4e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Xu.prototype=Object.create(Ci.prototype),Xu.prototype.constructor=Xu);Object.defineProperties(Xu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Xu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=qn.fromDistanceDisplayCondition(o),a={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Wt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,dle)),l(s)||(s=U.WHITE),a.color=Yt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,ule,fle))),new Bt({id:t,geometry:Uc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:a})};Xu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,dle),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:qn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,ule,fle))),new Bt({id:t,geometry:Sm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Xu.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Xu.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Ci.prototype._isHidden.call(this,e,t)};Xu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Xu.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,nt.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Wt?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Qe.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==nt.NONE?ln.ALL:void 0};Xu.prototype._onEntityPropertyChanged=g_;Xu.DynamicGeometryUpdater=wC;function wC(e,t,n){Ti.call(this,e,t,n)}l(Object.create)&&(wC.prototype=Object.create(Ti.prototype),wC.prototype.constructor=wC);wC.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,H4e),o=this._options.dimensions;return!l(i)||!l(o)||Ti.prototype._isHidden.call(this,e,t,n)};wC.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,nt.NONE),o=this._options;o.dimensions=X.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==nt.NONE?ln.ALL:void 0};var RF=Xu;function Jy(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Ni.FIXED,this._definitionChanged=new ye,this.setCallback(e,t)}Object.defineProperties(Jy.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var q4e=new Q;Jy.prototype.getValue=function(e,t){return l(e)||(e=Q.now(q4e)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};Jy.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Jy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Dm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Jy.prototype.equals=function(e){return this===e||e instanceof Jy&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var OF=Jy;/*! @license DOMPurify 3.4.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.4.7/LICENSE */function hle(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function Y4e(e){if(Array.isArray(e))return e}function X4e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,o,r,a,s=[],c=!0,u=!1;try{if(r=(n=n.call(e)).next,t!==0)for(;!(c=(i=r.call(n)).done)&&(s.push(i.value),s.length!==t);c=!0);}catch(f){u=!0,o=f}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}function K4e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
  5462. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q4e(e,t){return Y4e(e)||X4e(e,t)||$4e(e,t)||K4e()}function $4e(e,t){if(e){if(typeof e=="string")return hle(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hle(e,t):void 0}}var Sle=Object.entries,mle=Object.setPrototypeOf,J4e=Object.isFrozen,Z4e=Object.getPrototypeOf,e8e=Object.getOwnPropertyDescriptor,wl=Object.freeze,Jf=Object.seal,RC=Object.create,wle=typeof Reflect<"u"&&Reflect,Cq=wle.apply,Eq=wle.construct;wl||(wl=function(t){return t});Jf||(Jf=function(t){return t});Cq||(Cq=function(t,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];return t.apply(n,o)});Eq||(Eq=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return new t(...i)});var IC=rs(Array.prototype.forEach),t8e=rs(Array.prototype.lastIndexOf),ple=rs(Array.prototype.pop),DC=rs(Array.prototype.push),n8e=rs(Array.prototype.splice),Sl=Array.isArray,BI=rs(String.prototype.toLowerCase),Aq=rs(String.prototype.toString),gle=rs(String.prototype.match),PC=rs(String.prototype.replace),_le=rs(String.prototype.indexOf),i8e=rs(String.prototype.trim),o8e=rs(Number.prototype.toString),r8e=rs(Boolean.prototype.toString),Ale=typeof BigInt>"u"?null:rs(BigInt.prototype.toString),yle=typeof Symbol>"u"?null:rs(Symbol.prototype.toString),Aa=rs(Object.prototype.hasOwnProperty),OI=rs(Object.prototype.toString),pc=rs(RegExp.prototype.test),MI=a8e(TypeError);function rs(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return Cq(e,t,i)}}function a8e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Eq(e,n)}}function Ei(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:BI;if(mle&&mle(e,null),!Sl(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(J4e(t)||(t[i]=r),o=r)}e[o]=!0}return e}function s8e(e){for(let t=0;t<e.length;t++)Aa(e,t)||(e[t]=null);return e}function Hc(e){let t=RC(null);for(let i of Sle(e)){var n=Q4e(i,2);let o=n[0],r=n[1];Aa(e,o)&&(Sl(r)?t[o]=s8e(r):r&&typeof r=="object"&&r.constructor===Object?t[o]=Hc(r):t[o]=r)}return t}function c8e(e){switch(typeof e){case"string":return e;case"number":return o8e(e);case"boolean":return r8e(e);case"bigint":return Ale?Ale(e):"0";case"symbol":return yle?yle(e):"Symbol()";case"undefined":return OI(e);case"function":case"object":{if(e===null)return OI(e);let t=e,n=Lm(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:OI(i)}return OI(e)}default:return OI(e)}}function Lm(e,t){for(;e!==null;){let i=e8e(e,t);if(i){if(i.get)return rs(i.get);if(typeof i.value=="function")return rs(i.value)}e=Z4e(e)}function n(){return null}return n}function l8e(e){try{return pc(e,""),!0}catch{return!1}}var xle=wl(["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","search","section","select","shadow","slot","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"]),yq=wl(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xq=wl(["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"]),u8e=wl(["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"]),bq=wl(["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"]),f8e=wl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ble=wl(["#text"]),Tle=wl(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Tq=wl(["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","mask-type","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"]),Cle=wl(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),MF=wl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),d8e=Jf(/{{[\w\W]*|^[\w\W]*}}/g),h8e=Jf(/<%[\w\W]*|^[\w\W]*%>/g),m8e=Jf(/\${[\w\W]*/g),p8e=Jf(/^data-[\-\w.\u00B7-\uFFFF]+$/),g8e=Jf(/^aria-[\-\w]+$/),Ele=Jf(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_8e=Jf(/^(?:\w+script|data):/i),A8e=Jf(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),y8e=Jf(/^html$/i),x8e=Jf(/^[a-z][.\w]*(-[.\w]+)+$/i),Bm={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},b8e=function(){return typeof window>"u"?null:window},T8e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},vle=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ile(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b8e(),t=gn=>Ile(gn);if(t.version="3.4.7",t.removed=[],!e||!e.document||e.document.nodeType!==Bm.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,o=i.currentScript;e.DocumentFragment;let r=e.HTMLTemplateElement,a=e.Node,s=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let f=e.DOMParser,d=e.trustedTypes,p=s.prototype,g=Lm(p,"cloneNode"),m=Lm(p,"remove"),A=Lm(p,"nextSibling"),y=Lm(p,"childNodes"),x=Lm(p,"parentNode"),b=Lm(p,"shadowRoot"),T=Lm(p,"attributes"),E=a&&a.prototype?Lm(a.prototype,"nodeType"):null,S=a&&a.prototype?Lm(a.prototype,"nodeName"):null;if(typeof r=="function"){let gn=n.createElement("template");gn.content&&gn.content.ownerDocument&&(n=gn.content.ownerDocument)}let w,P="",O=n,B=O.implementation,L=O.createNodeIterator,_=O.createDocumentFragment,C=O.getElementsByTagName,v=i.importNode,I=vle();t.isSupported=typeof Sle=="function"&&typeof x=="function"&&B&&B.createHTMLDocument!==void 0;let M=d8e,N=h8e,j=m8e,k=p8e,V=g8e,F=_8e,W=A8e,q=x8e,J=Ele,H=null,Z=Ei({},[...xle,...yq,...xq,...bq,...ble]),K=null,le=Ei({},[...Tle,...Tq,...Cle,...MF]),me=Object.seal(RC(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}})),ae=null,be=null,ge=Object.seal(RC(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),we=!0,Ee=!0,Be=!1,ke=!0,Ge=!1,rt=!0,et=!1,Pe=!1,Ye=!1,ut=!1,Ct=!1,en=!1,Gt=!0,yt=!1,wt="user-content-",xn=!0,at=!1,st={},Ln=null,Nn=Ei({},["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"]),so=null,jo=Ei({},["audio","video","img","source","image","track"]),to=null,no=Ei({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jn="http://www.w3.org/1998/Math/MathML",Gn="http://www.w3.org/2000/svg",sn="http://www.w3.org/1999/xhtml",Qn=sn,Tr=!1,ma=null,Qa=Ei({},[jn,Gn,sn],Aq),Ba=Ei({},["mi","mo","mn","ms","mtext"]),$a=Ei({},["annotation-xml"]),lr=Ei({},["title","style","font","a","script"]),ii=null,Lr=["application/xhtml+xml","text/html"],So="text/html",Di=null,ai=null,Oo=n.createElement("form"),uc=function(Ce){return Ce instanceof RegExp||Ce instanceof Function},Jr=function(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ai&&ai===Ce)return;(!Ce||typeof Ce!="object")&&(Ce={}),Ce=Hc(Ce),ii=Lr.indexOf(Ce.PARSER_MEDIA_TYPE)===-1?So:Ce.PARSER_MEDIA_TYPE,Di=ii==="application/xhtml+xml"?Aq:BI,H=Aa(Ce,"ALLOWED_TAGS")&&Sl(Ce.ALLOWED_TAGS)?Ei({},Ce.ALLOWED_TAGS,Di):Z,K=Aa(Ce,"ALLOWED_ATTR")&&Sl(Ce.ALLOWED_ATTR)?Ei({},Ce.ALLOWED_ATTR,Di):le,ma=Aa(Ce,"ALLOWED_NAMESPACES")&&Sl(Ce.ALLOWED_NAMESPACES)?Ei({},Ce.ALLOWED_NAMESPACES,Aq):Qa,to=Aa(Ce,"ADD_URI_SAFE_ATTR")&&Sl(Ce.ADD_URI_SAFE_ATTR)?Ei(Hc(no),Ce.ADD_URI_SAFE_ATTR,Di):no,so=Aa(Ce,"ADD_DATA_URI_TAGS")&&Sl(Ce.ADD_DATA_URI_TAGS)?Ei(Hc(jo),Ce.ADD_DATA_URI_TAGS,Di):jo,Ln=Aa(Ce,"FORBID_CONTENTS")&&Sl(Ce.FORBID_CONTENTS)?Ei({},Ce.FORBID_CONTENTS,Di):Nn,ae=Aa(Ce,"FORBID_TAGS")&&Sl(Ce.FORBID_TAGS)?Ei({},Ce.FORBID_TAGS,Di):Hc({}),be=Aa(Ce,"FORBID_ATTR")&&Sl(Ce.FORBID_ATTR)?Ei({},Ce.FORBID_ATTR,Di):Hc({}),st=Aa(Ce,"USE_PROFILES")?Ce.USE_PROFILES&&typeof Ce.USE_PROFILES=="object"?Hc(Ce.USE_PROFILES):Ce.USE_PROFILES:!1,we=Ce.ALLOW_ARIA_ATTR!==!1,Ee=Ce.ALLOW_DATA_ATTR!==!1,Be=Ce.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=Ce.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ge=Ce.SAFE_FOR_TEMPLATES||!1,rt=Ce.SAFE_FOR_XML!==!1,et=Ce.WHOLE_DOCUMENT||!1,ut=Ce.RETURN_DOM||!1,Ct=Ce.RETURN_DOM_FRAGMENT||!1,en=Ce.RETURN_TRUSTED_TYPE||!1,Ye=Ce.FORCE_BODY||!1,Gt=Ce.SANITIZE_DOM!==!1,yt=Ce.SANITIZE_NAMED_PROPS||!1,xn=Ce.KEEP_CONTENT!==!1,at=Ce.IN_PLACE||!1,J=l8e(Ce.ALLOWED_URI_REGEXP)?Ce.ALLOWED_URI_REGEXP:Ele,Qn=typeof Ce.NAMESPACE=="string"?Ce.NAMESPACE:sn,Ba=Aa(Ce,"MATHML_TEXT_INTEGRATION_POINTS")&&Ce.MATHML_TEXT_INTEGRATION_POINTS&&typeof Ce.MATHML_TEXT_INTEGRATION_POINTS=="object"?Hc(Ce.MATHML_TEXT_INTEGRATION_POINTS):Ei({},["mi","mo","mn","ms","mtext"]),$a=Aa(Ce,"HTML_INTEGRATION_POINTS")&&Ce.HTML_INTEGRATION_POINTS&&typeof Ce.HTML_INTEGRATION_POINTS=="object"?Hc(Ce.HTML_INTEGRATION_POINTS):Ei({},["annotation-xml"]);let ot=Aa(Ce,"CUSTOM_ELEMENT_HANDLING")&&Ce.CUSTOM_ELEMENT_HANDLING&&typeof Ce.CUSTOM_ELEMENT_HANDLING=="object"?Hc(Ce.CUSTOM_ELEMENT_HANDLING):RC(null);if(me=RC(null),Aa(ot,"tagNameCheck")&&uc(ot.tagNameCheck)&&(me.tagNameCheck=ot.tagNameCheck),Aa(ot,"attributeNameCheck")&&uc(ot.attributeNameCheck)&&(me.attributeNameCheck=ot.attributeNameCheck),Aa(ot,"allowCustomizedBuiltInElements")&&typeof ot.allowCustomizedBuiltInElements=="boolean"&&(me.allowCustomizedBuiltInElements=ot.allowCustomizedBuiltInElements),Ge&&(Ee=!1),Ct&&(ut=!0),st&&(H=Ei({},ble),K=RC(null),st.html===!0&&(Ei(H,xle),Ei(K,Tle)),st.svg===!0&&(Ei(H,yq),Ei(K,Tq),Ei(K,MF)),st.svgFilters===!0&&(Ei(H,xq),Ei(K,Tq),Ei(K,MF)),st.mathMl===!0&&(Ei(H,bq),Ei(K,Cle),Ei(K,MF))),ge.tagCheck=null,ge.attributeCheck=null,Aa(Ce,"ADD_TAGS")&&(typeof Ce.ADD_TAGS=="function"?ge.tagCheck=Ce.ADD_TAGS:Sl(Ce.ADD_TAGS)&&(H===Z&&(H=Hc(H)),Ei(H,Ce.ADD_TAGS,Di))),Aa(Ce,"ADD_ATTR")&&(typeof Ce.ADD_ATTR=="function"?ge.attributeCheck=Ce.ADD_ATTR:Sl(Ce.ADD_ATTR)&&(K===le&&(K=Hc(K)),Ei(K,Ce.ADD_ATTR,Di))),Aa(Ce,"ADD_URI_SAFE_ATTR")&&Sl(Ce.ADD_URI_SAFE_ATTR)&&Ei(to,Ce.ADD_URI_SAFE_ATTR,Di),Aa(Ce,"FORBID_CONTENTS")&&Sl(Ce.FORBID_CONTENTS)&&(Ln===Nn&&(Ln=Hc(Ln)),Ei(Ln,Ce.FORBID_CONTENTS,Di)),Aa(Ce,"ADD_FORBID_CONTENTS")&&Sl(Ce.ADD_FORBID_CONTENTS)&&(Ln===Nn&&(Ln=Hc(Ln)),Ei(Ln,Ce.ADD_FORBID_CONTENTS,Di)),xn&&(H["#text"]=!0),et&&Ei(H,["html","head","body"]),H.table&&(Ei(H,["tbody"]),delete ae.tbody),Ce.TRUSTED_TYPES_POLICY){if(typeof Ce.TRUSTED_TYPES_POLICY.createHTML!="function")throw MI('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ce.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw MI('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=Ce.TRUSTED_TYPES_POLICY,P=w.createHTML("")}else w===void 0&&(w=T8e(d,o)),w!==null&&typeof P=="string"&&(P=w.createHTML(""));(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&H===Z&&(H=Hc(H)),I.uponSanitizeAttribute.length>0&&K===le&&(K=Hc(K)),wl&&wl(Ce),ai=Ce},Uu=Ei({},[...yq,...xq,...u8e]),ks=Ei({},[...bq,...f8e]),Ug=function(Ce){let ot=x(Ce);(!ot||!ot.tagName)&&(ot={namespaceURI:Qn,tagName:"template"});let Kt=BI(Ce.tagName),co=BI(ot.tagName);return ma[Ce.namespaceURI]?Ce.namespaceURI===Gn?ot.namespaceURI===sn?Kt==="svg":ot.namespaceURI===jn?Kt==="svg"&&(co==="annotation-xml"||Ba[co]):!!Uu[Kt]:Ce.namespaceURI===jn?ot.namespaceURI===sn?Kt==="math":ot.namespaceURI===Gn?Kt==="math"&&$a[co]:!!ks[Kt]:Ce.namespaceURI===sn?ot.namespaceURI===Gn&&!$a[co]||ot.namespaceURI===jn&&!Ba[co]?!1:!ks[Kt]&&(lr[Kt]||!Uu[Kt]):!!(ii==="application/xhtml+xml"&&ma[Ce.namespaceURI]):!1},Go=function(Ce){DC(t.removed,{element:Ce});try{x(Ce).removeChild(Ce)}catch{m(Ce)}},ur=function(Ce,ot){try{DC(t.removed,{attribute:ot.getAttributeNode(Ce),from:ot})}catch{DC(t.removed,{attribute:null,from:ot})}if(ot.removeAttribute(Ce),Ce==="is")if(ut||Ct)try{Go(ot)}catch{}else try{ot.setAttribute(Ce,"")}catch{}},Qd=function(Ce){let ot=null,Kt=null;if(Ye)Ce="<remove></remove>"+Ce;else{let Ho=gle(Ce,/^[\r\n\t ]+/);Kt=Ho&&Ho[0]}ii==="application/xhtml+xml"&&Qn===sn&&(Ce='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ce+"</body></html>");let co=w?w.createHTML(Ce):Ce;if(Qn===sn)try{ot=new f().parseFromString(co,ii)}catch{}if(!ot||!ot.documentElement){ot=B.createDocument(Qn,"template",null);try{ot.documentElement.innerHTML=Tr?P:co}catch{}}let Mi=ot.body||ot.documentElement;return Ce&&Kt&&Mi.insertBefore(n.createTextNode(Kt),Mi.childNodes[0]||null),Qn===sn?C.call(ot,et?"html":"body")[0]:et?ot.documentElement:Mi},Nr=function(Ce){return L.call(Ce.ownerDocument||Ce,Ce,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Pc=function(Ce){Ce.normalize();let ot=L.call(Ce.ownerDocument||Ce,Ce,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),Kt=ot.nextNode();for(;Kt;){let co=Kt.data;IC([M,N,j],Mi=>{co=PC(co,Mi," ")}),Kt.data=co,Kt=ot.nextNode()}},Rc=function(Ce){let ot=S?S(Ce):null;return typeof ot!="string"||Di(ot)!=="form"?!1:typeof Ce.nodeName!="string"||typeof Ce.textContent!="string"||typeof Ce.removeChild!="function"||Ce.attributes!==T(Ce)||typeof Ce.removeAttribute!="function"||typeof Ce.setAttribute!="function"||typeof Ce.namespaceURI!="string"||typeof Ce.insertBefore!="function"||typeof Ce.hasChildNodes!="function"||Ce.nodeType!==E(Ce)||Ce.childNodes!==y(Ce)},fc=function(Ce){if(!E||typeof Ce!="object"||Ce===null)return!1;try{return E(Ce)===Bm.documentFragment}catch{return!1}},_o=function(Ce){if(!E||typeof Ce!="object"||Ce===null)return!1;try{return typeof E(Ce)=="number"}catch{return!1}};function La(gn,Ce,ot){IC(gn,Kt=>{Kt.call(t,Ce,ot,ai)})}let Vg=function(Ce){let ot=null;if(La(I.beforeSanitizeElements,Ce,null),Rc(Ce))return Go(Ce),!0;let Kt=Di(Ce.nodeName);if(La(I.uponSanitizeElement,Ce,{tagName:Kt,allowedTags:H}),rt&&Ce.hasChildNodes()&&!_o(Ce.firstElementChild)&&pc(/<[/\w!]/g,Ce.innerHTML)&&pc(/<[/\w!]/g,Ce.textContent)||rt&&Ce.namespaceURI===sn&&Kt==="style"&&_o(Ce.firstElementChild)||Ce.nodeType===Bm.progressingInstruction||rt&&Ce.nodeType===Bm.comment&&pc(/<[/\w]/g,Ce.data))return Go(Ce),!0;if(ae[Kt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(Kt))&&!H[Kt]){if(!ae[Kt]&&AT(Kt)&&(me.tagNameCheck instanceof RegExp&&pc(me.tagNameCheck,Kt)||me.tagNameCheck instanceof Function&&me.tagNameCheck(Kt)))return!1;if(xn&&!Ln[Kt]){let Mi=x(Ce),Ho=y(Ce);if(Ho&&Mi){let Oc=Ho.length;for(let ys=Oc-1;ys>=0;--ys){let Mc=g(Ho[ys],!0);Mi.insertBefore(Mc,A(Ce))}}}return Go(Ce),!0}return(E?E(Ce):Ce.nodeType)===Bm.element&&!Ug(Ce)||(Kt==="noscript"||Kt==="noembed"||Kt==="noframes")&&pc(/<\/no(script|embed|frames)/i,Ce.innerHTML)?(Go(Ce),!0):(Ge&&Ce.nodeType===Bm.text&&(ot=Ce.textContent,IC([M,N,j],Mi=>{ot=PC(ot,Mi," ")}),Ce.textContent!==ot&&(DC(t.removed,{element:Ce.cloneNode()}),Ce.textContent=ot)),La(I.afterSanitizeElements,Ce,null),!1)},Tw=function(Ce,ot,Kt){if(be[ot]||Gt&&(ot==="id"||ot==="name")&&(Kt in n||Kt in Oo))return!1;let co=K[ot]||ge.attributeCheck instanceof Function&&ge.attributeCheck(ot,Ce);if(!(Ee&&!be[ot]&&pc(k,ot))){if(!(we&&pc(V,ot))){if(!co||be[ot]){if(!(AT(Ce)&&(me.tagNameCheck instanceof RegExp&&pc(me.tagNameCheck,Ce)||me.tagNameCheck instanceof Function&&me.tagNameCheck(Ce))&&(me.attributeNameCheck instanceof RegExp&&pc(me.attributeNameCheck,ot)||me.attributeNameCheck instanceof Function&&me.attributeNameCheck(ot,Ce))||ot==="is"&&me.allowCustomizedBuiltInElements&&(me.tagNameCheck instanceof RegExp&&pc(me.tagNameCheck,Kt)||me.tagNameCheck instanceof Function&&me.tagNameCheck(Kt))))return!1}else if(!to[ot]){if(!pc(J,PC(Kt,W,""))){if(!((ot==="src"||ot==="xlink:href"||ot==="href")&&Ce!=="script"&&_le(Kt,"data:")===0&&so[Ce])){if(!(Be&&!pc(F,PC(Kt,W,"")))){if(Kt)return!1}}}}}}return!0},S9=Ei({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),AT=function(Ce){return!S9[BI(Ce)]&&pc(q,Ce)},IO=function(Ce){La(I.beforeSanitizeAttributes,Ce,null);let ot=Ce.attributes;if(!ot||Rc(Ce))return;let Kt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K,forceKeepAttr:void 0},co=ot.length;for(;co--;){let Mi=ot[co],Ho=Mi.name,Oc=Mi.namespaceURI,ys=Mi.value,Mc=Di(Ho),xT=ys,Ja=Ho==="value"?xT:i8e(xT);if(Kt.attrName=Mc,Kt.attrValue=Ja,Kt.keepAttr=!0,Kt.forceKeepAttr=void 0,La(I.uponSanitizeAttribute,Ce,Kt),Ja=Kt.attrValue,yt&&(Mc==="id"||Mc==="name")&&_le(Ja,wt)!==0&&(ur(Ho,Ce),Ja=wt+Ja),rt&&pc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ja)){ur(Ho,Ce);continue}if(Mc==="attributename"&&gle(Ja,"href")){ur(Ho,Ce);continue}if(Kt.forceKeepAttr)continue;if(!Kt.keepAttr){ur(Ho,Ce);continue}if(!ke&&pc(/\/>/i,Ja)){ur(Ho,Ce);continue}Ge&&IC([M,N,j],ue=>{Ja=PC(Ja,ue," ")});let vy=Di(Ce.nodeName);if(!Tw(vy,Mc,Ja)){ur(Ho,Ce);continue}if(w&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Oc)switch(d.getAttributeType(vy,Mc)){case"TrustedHTML":{Ja=w.createHTML(Ja);break}case"TrustedScriptURL":{Ja=w.createScriptURL(Ja);break}}if(Ja!==xT)try{Oc?Ce.setAttributeNS(Oc,Ho,Ja):Ce.setAttribute(Ho,Ja),Rc(Ce)?Go(Ce):ple(t.removed)}catch{ur(Ho,Ce)}}La(I.afterSanitizeAttributes,Ce,null)},yT=function(Ce){let ot=null,Kt=Nr(Ce);for(La(I.beforeSanitizeShadowDOM,Ce,null);ot=Kt.nextNode();)if(La(I.uponSanitizeShadowNode,ot,null),Vg(ot),IO(ot),fc(ot.content)&&yT(ot.content),(E?E(ot):ot.nodeType)===Bm.element){let Mi=b?b(ot):ot.shadowRoot;fc(Mi)&&(jg(Mi),yT(Mi))}La(I.afterSanitizeShadowDOM,Ce,null)},jg=function(Ce){let ot=E?E(Ce):Ce.nodeType;if(ot===Bm.element){let Mi=b?b(Ce):Ce.shadowRoot;fc(Mi)&&(jg(Mi),yT(Mi))}let Kt=y?y(Ce):Ce.childNodes;if(!Kt)return;let co=[];IC(Kt,Mi=>{DC(co,Mi)});for(let Mi of co)jg(Mi);if(ot===Bm.element){let Mi=S?S(Ce):null;if(typeof Mi=="string"&&Di(Mi)==="template"){let Ho=Ce.content;fc(Ho)&&jg(Ho)}}};return t.sanitize=function(gn){let Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ot=null,Kt=null,co=null,Mi=null;if(Tr=!gn,Tr&&(gn="<!-->"),typeof gn!="string"&&!_o(gn)&&(gn=c8e(gn),typeof gn!="string"))throw MI("dirty is not a string, aborting");if(!t.isSupported)return gn;if(Pe||Jr(Ce),t.removed=[],typeof gn=="string"&&(at=!1),at){let ys=S?S(gn):gn.nodeName;if(typeof ys=="string"){let Mc=Di(ys);if(!H[Mc]||ae[Mc])throw MI("root node is forbidden and cannot be sanitized in-place")}if(Rc(gn))throw MI("root node is clobbered and cannot be sanitized in-place");jg(gn)}else if(_o(gn))ot=Qd("<!---->"),Kt=ot.ownerDocument.importNode(gn,!0),Kt.nodeType===Bm.element&&Kt.nodeName==="BODY"||Kt.nodeName==="HTML"?ot=Kt:ot.appendChild(Kt),jg(Kt);else{if(!ut&&!Ge&&!et&&gn.indexOf("<")===-1)return w&&en?w.createHTML(gn):gn;if(ot=Qd(gn),!ot)return ut?null:en?P:""}ot&&Ye&&Go(ot.firstChild);let Ho=Nr(at?gn:ot);for(;co=Ho.nextNode();)Vg(co),IO(co),fc(co.content)&&yT(co.content);if(at)return Ge&&Pc(gn),gn;if(ut){if(Ge&&Pc(ot),Ct)for(Mi=_.call(ot.ownerDocument);ot.firstChild;)Mi.appendChild(ot.firstChild);else Mi=ot;return(K.shadowroot||K.shadowrootmode)&&(Mi=v.call(i,Mi,!0)),Mi}let Oc=et?ot.outerHTML:ot.innerHTML;return et&&H["!doctype"]&&ot.ownerDocument&&ot.ownerDocument.doctype&&ot.ownerDocument.doctype.name&&pc(y8e,ot.ownerDocument.doctype.name)&&(Oc="<!DOCTYPE "+ot.ownerDocument.doctype.name+`>
  5463. `+Oc),Ge&&IC([M,N,j],ys=>{Oc=PC(Oc,ys," ")}),w&&en?w.createHTML(Oc):Oc},t.setConfig=function(){let gn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Jr(gn),Pe=!0},t.clearConfig=function(){ai=null,Pe=!1},t.isValidAttribute=function(gn,Ce,ot){ai||Jr({});let Kt=Di(gn),co=Di(Ce);return Tw(Kt,co,ot)},t.addHook=function(gn,Ce){typeof Ce=="function"&&DC(I[gn],Ce)},t.removeHook=function(gn,Ce){if(Ce!==void 0){let ot=t8e(I[gn],Ce);return ot===-1?void 0:n8e(I[gn],ot,1)[0]}return ple(I[gn])},t.removeHooks=function(gn){I[gn]=[]},t.removeAllHooks=function(){I=vle()},t}var Dle=Ile();var C8e=0,vq={},Sq=class e{constructor(t,n){let i,o=t;l(vq[o])?i=vq[o]:(i=C8e++,vq[o]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=Dle.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let o=0;o<i.length;o++)i[o].setAttribute("target","_blank");this._element=n}return this._element}static equals(t,n){return t===n||l(t)&&l(n)&&t._id===n._id&&t._showOnScreen===n._showOnScreen}equals(t){return e.equals(this,t)}isIon(){return this.html.indexOf("ion-credit.png")!==-1}static getIonCredit(t){let n=l(t.collapsible)&&!t.collapsible;return new e(t.html,n)}static clone(t){if(l(t))return new e(t.html,t.showOnScreen)}},xt=Sq;function E8e(e,t){_t(e,t)}var Hs=E8e;function Zy(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 ye}Object.defineProperties(Zy.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}}});Zy.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function wq(e){e._cubeMapBuffers=void 0}Zy.prototype.update=function(e){let{context:t}=e;if(!Zy.isSupported(t))return;if(l(this._texture)){wq(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(wq(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Hu(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT);let o=Xe.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let a=n[0].positiveX.width,s=Math.log2(a)+1;if(r!==s){let f={};Object.values(oa.FaceName).forEach(d=>{f[d]=void 0});for(let d=r;d<s;d++)n.push(f)}let c=new jt({minificationFilter:Vt.LINEAR_MIPMAP_LINEAR}),u=new oa({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Zy.prototype.isDestroyed=function(){return!1};Zy.prototype.destroy=function(){return wq(this),this._texture=this._texture&&this._texture.destroy(),fe(this)};var Nm=Zy;function LI(e){e=e??G.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?z.clone(e.imageBasedLightingFactor):new z(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._previousFrameContext=void 0,this._previousImageBasedLightingFactor=z.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(LI.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=z.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 v8e(e,t){if(Nm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Nm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}LI.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;z.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=z.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&&(v8e(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,a=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,s=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||a||s,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};LI.prototype.isDestroyed=function(){return!1};LI.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),fe(this)};var OC=LI;var Dq=Na(ju(),1);var Iq,Ple="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxMDYxM2JlMS00NTIzLTQ0YWItYTg5My00NzRkMDgwNThiZDciLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0MiBSZWxlYXNlIC0gRGVsZXRlIG9uIEF1Z3VzdCAxLCAyMDI2IiwiaWF0IjoxNzc5NjkwODE2fQ.Eq05fkRTh1lFGZUqr9vZZorz4HO_6rY_UmYi3fIHYaU",BF={};BF.defaultAccessToken=Ple;BF.defaultServer=new De({url:"https://api.cesium.com/"});BF.getDefaultTokenCredit=function(e){if(e===Ple){if(!l(Iq)){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>`;Iq=new xt(t,!0)}return Iq}};var Fm=BF;function Il(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:S8e};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new re("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new Dq.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o,this.refreshCallback=void 0}l(Object.create)&&(Il.prototype=Object.create(De.prototype),Il.prototype.constructor=Il);Il.fromAssetId=function(e,t){let n=Il._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Il(i,n)})};Object.defineProperties(Il.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Il.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Il.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(xt.getIonCredit),i=Fm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(xt.clone(i)),n};Il.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new Il(t._ionEndpoint,t._ionEndpointResource)),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Il.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};Il.prototype._makeRequest=function(e){return this._isExternal||new Dq.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=Rle(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};Il._createEndpointResource=function(e,t){t=t??G.EMPTY_OBJECT;let n=t.server??Fm.defaultServer,i=t.accessToken??Fm.defaultAccessToken;n=De.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),l(t.queryParameters)&&(o.queryParameters={...o.queryParameters,...t.queryParameters}),o.headers=Rle(o.headers),n.getDerivedResource(o)};function Rle(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}function S8e(e,t){let n=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){let a=e.refreshCallback??n.refreshCallback;return l(a)&&a(n,r),n._ionEndpoint=r,n._ionEndpoint}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var ya=Il;function km(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(km.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}}});km.prototype.get=function(e){return this._array[e]};km.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};km.prototype.peek=function(){return this._array[this._length-1]};km.prototype.push=function(e){let t=this.length++;this._array[t]=e};km.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};km.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};km.prototype.resize=function(e){this.length=e};km.prototype.trim=function(e){e=e??this._length,this._array.length=e};var lu=km;var zm={X:0,Y:1,Z:2};zm.Y_UP_TO_Z_UP=R.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));zm.Z_UP_TO_Y_UP=R.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));zm.X_UP_TO_Z_UP=R.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));zm.Z_UP_TO_X_UP=R.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));zm.X_UP_TO_Y_UP=R.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));zm.Y_UP_TO_X_UP=R.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));zm.fromName=function(e){return zm[e]};Object.freeze(zm);var Fi=zm;function Ole(e){e=e??G.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Ole.prototype,{metadata:{get:function(){return this._metadata}}});var MC=Ole;function __(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),__.decode(e)}__.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};__.decodeWithFromCharCode=function(e){let t="",n=w8e(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 NI(e,t,n){return t<=e&&e<=n}function w8e(e){let t=0,n=0,i=0,o=128,r=191,a=[],s=e.length;for(let c=0;c<s;++c){let u=e[c];if(i===0){if(NI(u,0,127)){a.push(u);continue}if(NI(u,194,223)){i=1,t=u&31;continue}if(NI(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(NI(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new re("String decoding failed.")}if(!NI(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(a.push(t),t=i=n=0)}return a}typeof TextDecoder<"u"?__.decode=__.decodeWithTextDecoder:__.decode=__.decodeWithFromCharCode;var Ku=__;function I8e(e,t){return t=t??0,Ku(e,t,Math.min(4,e.length))}var Um=I8e;var Pq=class e{constructor(t,n,i,o){this._tileset=t,this._tile=n,this._resource=i,l(o)||(o=[]),this._contents=o,this._metadata=void 0,this._group=void 0,this._ready=!1}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t;let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].metadata=t}get batchTable(){}get group(){return this._group}set group(t){this._group=t;let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].group=t}static async fromTileType(t,n,i,o,r,a){r=r??0;let s=new Uint8Array(o),c=new DataView(o);r+=FI;let u=c.getUint32(r,!0);if(u!==1)throw new re(`Only Composite Tile version 1 is supported. Version ${u} is not.`);r+=FI,r+=FI;let f=c.getUint32(r,!0);r+=FI;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let A=0;A<f;++A){let y=Um(s,r),x=c.getUint32(r+FI*2,!0),b=a[y],T=`${d}${A}`,E=i.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(b))p[A]=Promise.resolve(b(t,n,E,o,r));else throw new re(`Unknown tile content type, ${y}, inside Composite tile`);r+=x}let g=await Promise.all(p);return new e(t,n,i,g)}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,o=i.length;for(let r=0;r<o;++r)i[r].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyStyle(t)}update(t,n){let i=this._contents,o=i.length,r=!0;for(let a=0;a<o;++a)i[a].update(t,n),r=r&&i[a].ready;!this._ready&&r&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let o,r=Number.POSITIVE_INFINITY,a=this._contents,s=a.length;for(let c=0;c<s;++c){let u=a[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<r&&(o=u,r=f)}if(l(o))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return fe(this)}},FI=Uint32Array.BYTES_PER_ELEMENT,LF=Pq;function D8e(e,t,n){return JSON.parse(Ku(e,t,n))}var Sr=D8e;function Wc(e){this._id=Hn();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,Mt.maximumTextureSize),r=Math.ceil(t/Mt.maximumTextureSize),a=1/o,s=a*.5,c=1/r,u=c*.5;n=new z(o,r),i=new se(a,s,c,u)}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(Wc.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}}});Wc.DEFAULT_COLOR_VALUE=U.WHITE;Wc.DEFAULT_SHOW_VALUE=!0;function Mle(e){let t=e._textureDimensions;return t.x*t.y*4}function Ble(e){if(!l(e._batchValues)){let t=Mle(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Lle(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Wc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Lle(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Ble(this),a=e*4+3;r[a]=t?n[i+1]:0,this._batchValuesDirty=!0}};Wc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Wc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var P8e=new Array(4);Wc.prototype.setColor=function(e,t){if(U.equals(t,Wc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(P8e),i=n[3],o=Ble(this),r=e*4,a=Lle(this),s=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||a[s+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=a[s+1]!==255,u=a[s]!==0;o[r+3]=u?i:0,a[s+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Wc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Wc.prototype.getColor=function(e,t){if(!l(this._batchValues))return U.clone(Wc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return U.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Wc.prototype.getPickColor=function(e){return this._pickIds[e]};function Nle(e,t,n){let i=e._textureDimensions;return new Dt({context:t,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:jt.NEAREST})}function R8e(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=Mle(e),r=new Uint8Array(o),a=e._owner,s=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(a.getFeature(c));i.push(u);let f=u.color,d=c*4;r[d]=U.floatToByte(f.red),r[d+1]=U.floatToByte(f.green),r[d+2]=U.floatToByte(f.blue),r[d+3]=U.floatToByte(f.alpha)}e._pickTexture=Nle(e,t,r),l(s)&&(s.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function O8e(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Wc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&R8e(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Nle(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),O8e(this))};Wc.prototype.isDestroyed=function(){return!1};Wc.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 fe(this)};var uu=Wc;var M8e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},B8e={SCALAR:void 0,VEC2:z,VEC3:h,VEC4:se,MAT2:Wi,MAT3:$,MAT4:R};function L8e(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=M8e[e.type],o=B8e[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,a,s){return Y.createArrayBufferView(n,r,a,i*s)}}}var uh=L8e;function x0(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,N8e(this,e.extension,e.binaryBody)}Object.defineProperties(x0.prototype,{byteLength:{get:function(){return this._byteLength}}});function N8e(e,t,n){let i,o,r,a=t.instancesLength,s=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=a,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??Y.UNSIGNED_SHORT,c.type=Ft.SCALAR,r=uh(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,a),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??Y.UNSIGNED_SHORT,u.type=Ft.SCALAR,r=uh(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,a),p+=u.byteLength),g=new Uint16Array(a),d=0,i=0;i<a;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??Y.UNSIGNED_SHORT,f.type=Ft.SCALAR,r=uh(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=s.length;for(i=0;i<m;++i){let x=s[i].length,b=s[i].instances,T=Vm.getBinaryProperties(x,b,n);p+=F8e(T),s[i].instances=It(T,b)}let A=new Array(m).fill(0),y=new Uint16Array(a);for(i=0;i<a;++i)o=c[i],y[i]=A[o],++A[o];p+=y.byteLength,e._classes=s,e._classIds=c,e._classIndexes=y,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function F8e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var k8e=[],z8e=[],U8e=0;function V8e(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,a=e._parentIndexes,s=i.length,c=k8e;c.length=Math.max(c.length,s);let u=++U8e,f=z8e;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=o[t],g=a[t];for(let m=0;m<p;++m){let A=r[g+m];A!==t&&f.push(A)}}}function j8e(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 kI(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return V8e(e,t,n)}else return n(e,t);return j8e(e,t,n)}x0.prototype.hasProperty=function(e,t){let n=kI(this,e,function(i,o){let r=i._classIds[o],a=i._classes[r].instances;if(l(a[t]))return!0});return l(n)};x0.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};x0.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,kI(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let a in r)r.hasOwnProperty(a)&&t.indexOf(a)===-1&&t.push(a)}),t};x0.prototype.getProperty=function(e,t){return kI(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],a=n._classIndexes[i],s=r.instances[t];if(l(s))return l(s.typedArray)?G8e(s,a):qe(s[a],!0)})};function G8e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}x0.prototype.setProperty=function(e,t,n){let i=kI(this,e,function(o,r){let a=o._classIds[r],s=o._classes[a],c=o._classIndexes[r],u=s.instances[t];if(l(u))return l(u.typedArray)?H8e(u,c,n):u[c]=qe(n,!0),!0});return l(i)};function H8e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}x0.prototype.isClass=function(e,t){let n=kI(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};x0.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var BC=x0;var Fle={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(Fle);var Qu=Fle;var Rq=uu.DEFAULT_COLOR_VALUE,Oq=uu.DEFAULT_SHOW_VALUE;function Mo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=r??{};let a=W8e(n);this._properties=a,this._batchTableHierarchy=q8e(this,n,i);let s=zle(t,a,i);this._binaryPropertiesByteLength=Y8e(s),this._batchTableBinaryProperties=s,this._content=e,this._batchTexture=new uu({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}Mo._deprecationWarning=Hs;Object.defineProperties(Mo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function W8e(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=qe(e[n],!0));return t}function q8e(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(Mo._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 BC({extension:i,binaryBody:n})}function zle(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],a=r.byteOffset;if(l(a)){let s=r.componentType,c=r.type;if(!l(s))throw new re("componentType is required.");if(!l(c))throw new re("type is required.");if(!l(n))throw new re(`Property ${o} requires a batch table binary.`);let u=uh(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+a,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function Y8e(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Mo.getBinaryProperties=function(e,t,n){return zle(e,t,n)};Mo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Mo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Mo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Mo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Mo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Mo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Mo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var X8e=new U;Mo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Rq),this.setAllShow(Oq);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?e.color.evaluateColor(o,X8e)??Rq:Rq,a=l(e.show)?e.show.evaluate(o)??Oq:Oq;this.setColor(i,r),this.setShow(i,a)}};function K8e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Q8e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Mo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Mo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Mo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Mo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Mo.prototype.hasPropertyBySemantic=function(){return!1};Mo.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Jn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Jn(t,i)}return t};Mo.prototype.getPropertyBySemantic=function(e,t){};Mo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return K8e(i,e)}let n=this._properties[t];if(l(n))return qe(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Mo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){Q8e(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]=qe(n,!0)};function $8e(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep;
  5464. vec2 computeSt(float batchId)
  5465. {
  5466. float stepX = tile_textureStep.x;
  5467. float centerX = tile_textureStep.y;
  5468. return vec2(centerX + (batchId * stepX), 0.5);
  5469. }
  5470. `:`uniform vec4 tile_textureStep;
  5471. uniform vec2 tile_textureDimensions;
  5472. vec2 computeSt(float batchId)
  5473. {
  5474. float stepX = tile_textureStep.x;
  5475. float centerX = tile_textureStep.y;
  5476. float stepY = tile_textureStep.z;
  5477. float centerY = tile_textureStep.w;
  5478. float xId = mod(batchId, tile_textureDimensions.x);
  5479. float yId = floor(batchId / tile_textureDimensions.x);
  5480. return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
  5481. }
  5482. `}Mo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Ule(o,n,!1),a;return Mt.maximumVertexTextureImageUnits>0?(a="",e&&(a+=`uniform bool tile_translucentCommand;
  5483. `),a+=`uniform sampler2D tile_batchTexture;
  5484. out vec4 tile_featureColor;
  5485. out vec2 tile_featureSt;
  5486. void main()
  5487. {
  5488. vec2 st = computeSt(${t});
  5489. vec4 featureProperties = texture(tile_batchTexture, st);
  5490. tile_color(featureProperties);
  5491. float show = ceil(featureProperties.a);
  5492. gl_Position *= show;
  5493. `,e&&(a+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
  5494. if (czm_pass == czm_passTranslucent)
  5495. {
  5496. if (!isStyleTranslucent && !tile_translucentCommand)
  5497. {
  5498. gl_Position *= 0.0;
  5499. }
  5500. }
  5501. else
  5502. {
  5503. if (isStyleTranslucent)
  5504. {
  5505. gl_Position *= 0.0;
  5506. }
  5507. }
  5508. `),a+=` tile_featureColor = featureProperties;
  5509. tile_featureSt = st;
  5510. }`):a=`out vec2 tile_featureSt;
  5511. void main()
  5512. {
  5513. tile_color(vec4(1.0));
  5514. tile_featureSt = computeSt(${t});
  5515. }`,`${r}
  5516. ${$8e(i)}${a}`}};function kle(e,t){return e=He.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend;
  5517. void tile_color(vec4 tile_featureColor)
  5518. {
  5519. tile_main();
  5520. tile_featureColor = czm_gammaCorrect(tile_featureColor);
  5521. out_FragColor.a *= tile_featureColor.a;
  5522. float highlight = ceil(tile_colorBlend);
  5523. out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
  5524. }
  5525. `:`${e}void tile_color(vec4 tile_featureColor)
  5526. {
  5527. tile_main();
  5528. }
  5529. `}function J8e(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let a=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++a;else if(f===")"&&(--a,a===0)){r=u+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 Ule(e,t,n){if(!l(t))return kle(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return kle(e,n);let r=o[0],a=o[2];e=He.replaceMain(e,"tile_main"),e=e.replace(r,"");let s=`bool isWhite(vec3 color)
  5530. {
  5531. return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
  5532. }
  5533. vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse)
  5534. {
  5535. vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend);
  5536. vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse;
  5537. return vec4(diffuse.rgb, sourceDiffuse.a);
  5538. }
  5539. `,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor);
  5540. out_FragColor.a *= tile_featureColor.a;
  5541. float highlight = ceil(tile_colorBlend);
  5542. out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
  5543. `,u;if(a==="vec3"||a==="vec4"){let f=a==="vec3"?`vec4(${t}, 1.0)`:t,d=a==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f};
  5544. tile_diffuse = tile_diffuse_final(source, tile_featureColor);
  5545. tile_main();
  5546. `}else a==="sampler2D"&&(e=J8e(e,t),u=` tile_diffuse = tile_featureColor;
  5547. tile_main();
  5548. `);return e=`uniform float tile_colorBlend;
  5549. vec4 tile_diffuse = vec4(1.0);
  5550. ${s}${r}
  5551. ${e}
  5552. void tile_color(vec4 tile_featureColor)
  5553. {
  5554. ${u}`,n&&(e+=c),e+=`}
  5555. `,e}Mo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Ule(i,t,!0),Mt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture;
  5556. in vec2 tile_featureSt;
  5557. in vec4 tile_featureColor;
  5558. void main()
  5559. {
  5560. tile_color(tile_featureColor);
  5561. `,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
  5562. `),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand;
  5563. `),i+=`uniform sampler2D tile_pickTexture;
  5564. uniform sampler2D tile_batchTexture;
  5565. in vec2 tile_featureSt;
  5566. void main()
  5567. {
  5568. vec4 featureProperties = texture(tile_batchTexture, tile_featureSt);
  5569. if (featureProperties.a == 0.0) {
  5570. discard;
  5571. }
  5572. `,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
  5573. if (czm_pass == czm_passTranslucent)
  5574. {
  5575. if (!isStyleTranslucent && !tile_translucentCommand)
  5576. {
  5577. discard;
  5578. }
  5579. }
  5580. else
  5581. {
  5582. if (isStyleTranslucent)
  5583. {
  5584. discard;
  5585. }
  5586. }
  5587. `),i+=` tile_color(featureProperties);
  5588. `,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
  5589. `),i+=`}
  5590. `),i}};function Z8e(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Qu.HIGHLIGHT)return 0;if(n===Qu.REPLACE)return 1;if(n===Qu.MIX)return D.clamp(i,D.EPSILON4,1)}Mo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return It(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return Z8e(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Mo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var A_={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Mo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,a=o.tileset,s=a.isSkippingLevelOfDetail&&a.hasMixedContent&&e.context.stencilBuffer,c=eje(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ie.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=tje(f),f.dirty=!1);let p=d.originalCommand;c!==A_.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=nje(p))),c!==A_.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=ije(p)),s&&(r||(l(d.zback)||(d.zback=rje(e.context,p)),a._backfaceCommands.push(d.zback)),(!l(d.stencil)||o._selectionDepth!==sje(d.stencil))&&(f.renderState.depthMask?d.stencil=aje(p,o._selectionDepth):d.stencil=d.opaque)));let g=s?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===A_.ALL_OPAQUE&&(n[u]=g),c===A_.ALL_TRANSLUCENT&&(n[u]=m),c===A_.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function eje(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?A_.ALL_OPAQUE:t===e.featuresLength?A_.ALL_TRANSLUCENT:A_.OPAQUE_AND_TRANSLUCENT}function tje(e){let t=tt.shallowClone(e),n=t.pass===Ie.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function nje(e){let t=tt.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=cje(e.renderState),t}function ije(e){let t=tt.shallowClone(e);return t.renderState=lje(e.renderState),t}function oje(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 rje(e,t){let n=tt.shallowClone(t),i=qe(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Li.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Ht.setCesium3DTileBit(),i.stencilMask=Ht.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=qe(t.uniformMap);let o=new z(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=oje(e,t.shaderProgram),n}function aje(e,t){let n=tt.shallowClone(e),i=qe(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Ht.SKIP_LOD_MASK,i.stencilTest.reference=Ht.CESIUM_3D_TILE_MASK|t<<Ht.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Xn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=vt.REPLACE,i.stencilTest.backFunction=Xn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=vt.REPLACE,i.stencilMask=Ht.CESIUM_3D_TILE_MASK|Ht.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function sje(e){return(e.renderState.stencilTest.reference&Ht.SKIP_LOD_MASK)>>>Ht.SKIP_LOD_BIT_SHIFT}function cje(e){let t=qe(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=Jt.ALPHA_BLEND,t.stencilTest=Ht.setCesium3DTileBit(),t.stencilMask=Ht.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function lje(e){let t=qe(e,!0);return t.stencilTest=Ht.setCesium3DTileBit(),t.stencilMask=Ht.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}Mo.prototype.update=function(e,t){this._batchTexture.update(e,t)};Mo.prototype.isDestroyed=function(){return!1};Mo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),fe(this)};var Vm=Mo;function uje(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var b0=uje;var zI=`in vec3 position;
  5591. in float a_batchId;
  5592. uniform mat4 u_modifiedModelViewProjection;
  5593. void main()
  5594. {
  5595. gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
  5596. }
  5597. `;var Mq=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new U),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,o=t.batchTable){if(l(o)){if(o.hasPropertyBySemantic(n,i))return o.getPropertyBySemantic(n,i);if(o.hasProperty(n,i))return o.getProperty(n,i)}let r=t.metadata;if(l(r)){if(r.hasPropertyBySemantic(i))return r.getPropertyBySemantic(i);if(r.hasProperty(i))return r.getProperty(i)}let a=t.tile,s=a.metadata;if(l(s)){if(s.hasPropertyBySemantic(i))return s.getPropertyBySemantic(i);if(s.hasProperty(i))return s.getProperty(i)}let c;if(l(a.implicitSubtree)&&(c=a.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},as=Mq;var Bq=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)})}},Lq=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)})}},fu=class e{static get version(){return"1.4.0"}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,a,s,c,u;if(a=this.gobbleToken(),!a||(n=this.gobbleBinaryOp(),!n))return a;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+n),o=[a,r,s];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)},u=n;let f=d=>r.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;o.length>2&&f(o[o.length-2]);)s=o.pop(),n=o.pop().value,a=o.pop(),t={type:e.BINARY_EXP,operator:n,left:a,right:s},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),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+=`
  5598. `;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 a=n.length;a<o;a++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let a=this.gobbleExpression();(!a||a.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(a)}}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)}}},fje=new Bq;Object.assign(fu,{hooks:fje,plugins:new Lq(fu),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,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});fu.max_unop_len=fu.getMaxKeyLen(fu.unary_ops);fu.max_binop_len=fu.getMaxKeyLen(fu.binary_ops);var y_=e=>new fu(e).parse(),dje=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(fu).filter(e=>!dje.includes(e)&&y_[e]===void 0).forEach(e=>{y_[e]=fu[e]});y_.Jsep=fu;var hje="ConditionalExpression",mje={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:hje,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let a=i;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;n.node.test=a.right,a.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};y_.plugins.register(mje);var Vle={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};Object.freeze(Vle);var St=Vle;function fh(e,t){this._expression=e,e=wje(e,t),e=Dje(Ije(e)),y_.addBinaryOp("=~",0),y_.addBinaryOp("!~",0);let n;try{n=y_(e)}catch(i){throw new re(i)}this._runtimeAst=ki(this,n)}Object.defineProperties(fh.prototype,{expression:{get:function(){return this._expression}}});var Mn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new z],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 z),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++]}};fh.prototype.evaluate=function(e,t){Mn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof U&&n instanceof se?U.fromCartesian4(n,t):n instanceof z||n instanceof h||n instanceof se?n.clone(t):n};fh.prototype.evaluateColor=function(e,t){Mn.reset();let n=this._runtimeAst.evaluate(e);return U.fromCartesian4(n,t)};fh.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
  5599. {
  5600. return ${o};
  5601. }
  5602. `,o};fh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};fh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var pje=["!","-","+"],jle=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],UI=/\${(.*?)}/g,gje=/\\/g,_je="@#%",Aje=/@#%/g,kF=new U,zF={abs:vs(Math.abs),sqrt:vs(Math.sqrt),cos:vs(Math.cos),sin:vs(Math.sin),tan:vs(Math.tan),acos:vs(Math.acos),asin:vs(Math.asin),atan:vs(Math.atan),radians:vs(D.toRadians),degrees:vs(D.toDegrees),sign:vs(D.sign),floor:vs(Math.floor),ceil:vs(Math.ceil),round:vs(Math.round),exp:vs(Math.exp),exp2:vs(xje),log:vs(Math.log),log2:vs(bje),fract:vs(yje),length:Tje,normalize:Cje},UF={atan2:NF(Math.atan2,!1),pow:NF(Math.pow,!1),min:NF(Math.min,!0),max:NF(Math.max,!0),distance:Eje,dot:vje,cross:Sje},kq={clamp:Gle(D.clamp,!0),mix:Gle(D.lerp,!0)};function yje(e){return e-Math.floor(e)}function xje(e){return Math.pow(2,e)}function bje(e){return D.log2(e)}function vs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof z)return z.fromElements(e(n.x),e(n.y),Mn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Mn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Mn.getCartesian4());throw new re(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function NF(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof z)return z.fromElements(e(i.x,o),e(i.y,o),Mn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Mn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Mn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof z&&o instanceof z)return z.fromElements(e(i.x,o.x),e(i.y,o.y),Mn.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),Mn.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),Mn.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Gle(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 z&&o instanceof z)return z.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Mn.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),Mn.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),Mn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof z&&o instanceof z&&r instanceof z)return z.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Mn.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),Mn.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),Mn.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function Tje(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof z)return z.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Cje(e,t){if(typeof t=="number")return 1;if(t instanceof z)return z.normalize(t,Mn.getCartesian2());if(t instanceof h)return h.normalize(t,Mn.getCartesian3());if(t instanceof se)return se.normalize(t,Mn.getCartesian4());throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Eje(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof z&&n instanceof z)return z.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 re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function vje(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof z&&n instanceof z)return z.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 re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Sje(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Mn.getCartesian3());throw new re(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Pt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,zje(this)}function wje(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 Ije(e){return e.replace(gje,_je)}function Fq(e){return e.replace(Aje,"\\")}function Dje(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),a;if(o>=0&&o<i)a=t.indexOf("'",o+1),n+=t.substr(0,a+1),t=t.substr(a+1),i=t.indexOf("${");else if(r>=0&&r<i)a=t.indexOf('"',r+1),n+=t.substr(0,a+1),t=t.substr(a+1),i=t.indexOf("${");else{n+=t.substr(0,i);let s=t.indexOf("}");if(s<0)throw new re("Unmatched {.");n+=`czm_${t.substr(i+2,s-(i+2))}`,t=t.substr(s+1),i=t.indexOf("${")}}return n+=t,n}function Pje(e){let t=typeof e.value;if(e.value===null)return new Pt(St.LITERAL_NULL,null);if(t==="boolean")return new Pt(St.LITERAL_BOOLEAN,e.value);if(t==="number")return new Pt(St.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Pt(St.VARIABLE_IN_STRING,e.value):new Pt(St.LITERAL_STRING,Fq(e.value))}function Rje(e,t){let n=t.arguments,i=n.length,o,r,a,s;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 re(`${o} is not a function.`);return i===0?o==="test"?new Pt(St.LITERAL_BOOLEAN,!1):new Pt(St.LITERAL_NULL,null):(a=ki(e,c),s=ki(e,n[0]),new Pt(St.FUNCTION_CALL,o,a,s))}else if(o==="toString")return r=ki(e,c),new Pt(St.FUNCTION_CALL,o,r);throw new re(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Pt(St.LITERAL_COLOR,o);if(r=ki(e,n[0]),l(n[1])){let c=ki(e,n[1]);return new Pt(St.LITERAL_COLOR,o,[r,c])}return new Pt(St.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new re(`${o} requires three arguments.`);return r=[ki(e,n[0]),ki(e,n[1]),ki(e,n[2])],new Pt(St.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new re(`${o} requires four arguments.`);return r=[ki(e,n[0]),ki(e,n[1]),ki(e,n[2]),ki(e,n[3])],new Pt(St.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]=ki(e,n[c]);return new Pt(St.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Pt(St.LITERAL_BOOLEAN,!0):new Pt(St.LITERAL_BOOLEAN,!1):(r=ki(e,n[0]),new Pt(St.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new re(`${o} requires exactly one argument.`);return r=ki(e,n[0]),new Pt(St.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new re(`${o} does not take any argument.`);return new Pt(St.UNARY,o)}else if(l(zF[o])){if(i!==1)throw new re(`${o} requires exactly one argument.`);return r=ki(e,n[0]),new Pt(St.UNARY,o,r)}else if(l(UF[o])){if(i!==2)throw new re(`${o} requires exactly two arguments.`);return a=ki(e,n[0]),s=ki(e,n[1]),new Pt(St.BINARY,o,a,s)}else if(l(kq[o])){if(i!==3)throw new re(`${o} requires exactly three arguments.`);a=ki(e,n[0]),s=ki(e,n[1]);let c=ki(e,n[2]);return new Pt(St.TERNARY,o,a,s,c)}else{if(o==="Boolean")return i===0?new Pt(St.LITERAL_BOOLEAN,!1):(r=ki(e,n[0]),new Pt(St.UNARY,o,r));if(o==="Number")return i===0?new Pt(St.LITERAL_NUMBER,0):(r=ki(e,n[0]),new Pt(St.UNARY,o,r));if(o==="String")return i===0?new Pt(St.LITERAL_STRING,""):(r=ki(e,n[0]),new Pt(St.UNARY,o,r));if(o==="regExp")return Oje(e,t)}}throw new re(`Unexpected function call "${o}".`)}function Oje(e,t){let n=t.arguments;if(n.length===0)return new Pt(St.LITERAL_REGEX,new RegExp);let i=ki(e,n[0]),o;if(n.length>1){let r=ki(e,n[1]);if(Nq(i)&&Nq(r)){try{o=new RegExp(Fq(String(i._value)),r._value)}catch(a){throw new re(a)}return new Pt(St.LITERAL_REGEX,o)}return new Pt(St.REGEX,i,r)}if(Nq(i)){try{o=new RegExp(Fq(String(i._value)))}catch(r){throw new re(r)}return new Pt(St.LITERAL_REGEX,o)}return new Pt(St.REGEX,i)}function Mje(e){if(Fje(e.name)){let t=kje(e.name);return t.substr(0,8)==="tiles3d_"?new Pt(St.BUILTIN_VARIABLE,t):new Pt(St.VARIABLE,t)}else{if(e.name==="NaN")return new Pt(St.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Pt(St.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Pt(St.LITERAL_UNDEFINED,void 0)}throw new re(`${e.name} is not defined.`)}function Bje(e){let t=e.property.name;if(t==="PI")return new Pt(St.LITERAL_NUMBER,Math.PI);if(t==="E")return new Pt(St.LITERAL_NUMBER,Math.E)}function Lje(e){if(e.property.name==="POSITIVE_INFINITY")return new Pt(St.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function Nje(e,t){if(t.object.name==="Math")return Bje(t);if(t.object.name==="Number")return Lje(t);let n,i=ki(e,t.object);return t.computed?(n=ki(e,t.property),new Pt(St.MEMBER,"brackets",i,n)):(n=new Pt(St.LITERAL_STRING,t.property.name),new Pt(St.MEMBER,"dot",i,n))}function Nq(e){return e._type>=St.LITERAL_NULL}function Fje(e){return e.substr(0,4)==="czm_"}function kje(e){return e.substr(4)}function ki(e,t){let n,i,o,r;if(t.type==="Literal")n=Pje(t);else if(t.type==="CallExpression")n=Rje(e,t);else if(t.type==="Identifier")n=Mje(t);else if(t.type==="UnaryExpression"){i=t.operator;let a=ki(e,t.argument);if(pje.indexOf(i)>-1)n=new Pt(St.UNARY,i,a);else throw new re(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=ki(e,t.left),r=ki(e,t.right),jle.indexOf(i)>-1)n=new Pt(St.BINARY,i,o,r);else throw new re(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=ki(e,t.left),r=ki(e,t.right),jle.indexOf(i)>-1&&(n=new Pt(St.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let a=ki(e,t.test);o=ki(e,t.consequent),r=ki(e,t.alternate),n=new Pt(St.CONDITIONAL,"?",o,r,a)}else if(t.type==="MemberExpression")n=Nje(e,t);else if(t.type==="ArrayExpression"){let a=[];for(let s=0;s<t.elements.length;s++)a[s]=ki(e,t.elements[s]);n=new Pt(St.ARRAY,a)}else throw t.type==="Compound"?new re("Provide exactly one expression."):new re("Cannot parse expression.");return n}function zje(e){e._type===St.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===St.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===St.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(zF[e._value])&&(e.evaluate=Vje(e._value)):e._type===St.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(UF[e._value])&&(e.evaluate=jje(e._value)):e._type===St.TERNARY?e.evaluate=Gje(e._value):e._type===St.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===St.ARRAY?e.evaluate=e._evaluateArray:e._type===St.VARIABLE?e.evaluate=e._evaluateVariable:e._type===St.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===St.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===St.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===St.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===St.REGEX?e.evaluate=e._evaluateRegExp:e._type===St.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=Uje):e.evaluate=e._evaluateLiteral}function Uje(e){return l(e)?e.content.tileset.timeSinceLoad:0}function Vje(e){let t=zF[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function jje(e){let t=UF[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function Gje(e){let t=kq[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 VF(e,t){if(l(e))return e.getPropertyInherited(t)}Pt.prototype._evaluateLiteral=function(){return this._value};Pt.prototype._evaluateLiteralColor=function(e){let t=kF,n=this._left;if(this._value==="color")l(n)?n.length>1?(U.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):U.fromCssColorString(n[0].evaluate(e),t):U.fromBytes(255,255,255,255,t);else if(this._value==="rgb")U.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;U.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Mn.getCartesian4())};Pt.prototype._evaluateLiteralVector=function(e){let t=Mn.getArray(),n=this._value,i=this._left,o=i.length;for(let s=0;s<o;++s){let c=i[s].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof z)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 re(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,a=parseInt(n.charAt(3));if(r===0)throw new re(`Invalid ${n} constructor. No valid arguments.`);if(r<a&&r>1)throw new re(`Invalid ${n} constructor. Not enough arguments.`);if(r>a&&o>1)throw new re(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let s=t[0];t.push(s,s,s)}if(n==="vec2")return z.fromArray(t,0,Mn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Mn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Mn.getCartesian4())};Pt.prototype._evaluateLiteralString=function(){return this._value};Pt.prototype._evaluateVariableString=function(e){let t=this._value,n=UI.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=VF(e,o);l(r)||(r=""),t=t.replace(i,r),UI.lastIndex+=r.length-i.length,n=UI.exec(t)}return t};Pt.prototype._evaluateVariable=function(e){return VF(e,this._value)};function ex(e){return e._value==="feature"}Pt.prototype._evaluateMemberDot=function(e){if(ex(this._left))return VF(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof z||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]};Pt.prototype._evaluateMemberBrackets=function(e){if(ex(this._left))return VF(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof z||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]};Pt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Pt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Pt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof z)return z.negate(t,Mn.getCartesian2());if(t instanceof h)return h.negate(t,Mn.getCartesian3());if(t instanceof se)return se.negate(t,Mn.getCartesian4());if(typeof t=="number")return-t;throw new re(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Pt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof z||t instanceof h||t instanceof se||typeof t=="number"))throw new re(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Pt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Pt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Pt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Pt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Pt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Pt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Pt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.add(t,n,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Mn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Mn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new re(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Pt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.subtract(t,n,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Mn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new re(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Pt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.multiplyComponents(t,n,Mn.getCartesian2());if(n instanceof z&&typeof t=="number")return z.multiplyByScalar(n,t,Mn.getCartesian2());if(t instanceof z&&typeof n=="number")return z.multiplyByScalar(t,n,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Mn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Mn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Mn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Mn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Mn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new re(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Pt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.divideComponents(t,n,Mn.getCartesian2());if(t instanceof z&&typeof n=="number")return z.divideByScalar(t,n,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Mn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Mn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Mn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new re(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Pt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.fromElements(t.x%n.x,t.y%n.y,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Mn.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,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new re(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Pt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};Pt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Pt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new re(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Pt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Pt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Pt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Pt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Pt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Pt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Pt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Pt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Pt.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 re(o)}return i};Pt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`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)};Pt.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 re(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Pt.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 re(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Pt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`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};Pt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof z||t instanceof h||t instanceof se)return String(t);throw new re(`Unexpected function call "${this._value}".`)};function Hle(e){let t=e._left,n=t.length;for(let s=0;s<n;++s)if(t[s]._type!==St.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,a=n===4?t[3]._value:1;return U.fromHsl(i,o,r,a,kF)}function Wle(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==St.LITERAL_NUMBER)return;let i=kF;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 x_(e){return e%1===0?e.toFixed(1):e.toString()}function Hje(e){let t=x_(e.red),n=x_(e.green),i=x_(e.blue);return`vec3(${t}, ${n}, ${i})`}function FF(e){let t=x_(e.red),n=x_(e.green),i=x_(e.blue),o=x_(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function qle(e,t,n,i){let o=e.length,r=new Array(o);for(let a=0;a<o;++a)r[a]=e[a].getShaderExpression(t,n,i);return r}function Yle(e,t){return l(t[e])?t[e]:fh.NULL_SENTINEL}fh.NULL_SENTINEL="czm_infinity";Pt.prototype.getShaderExpression=function(e,t,n){let i,o,r,a,s=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=qle(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)&&(a=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=qle(this._value,e,t,this));let u,f,d;switch(s){case St.VARIABLE:return ex(this)?void 0:Yle(c,e);case St.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(zF[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 re(`Error generating style shader: "${c}" is not supported.`);return c+o;case St.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(UF[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case St.TERNARY:if(l(kq[c]))return`${c}(${o}, ${r}, ${a})`;break;case St.CONDITIONAL:return`(${a} ? ${o} : ${r})`;case St.MEMBER:return ex(this._left)?Yle(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 St.FUNCTION_CALL:throw new re(`Error generating style shader: "${c}" is not supported.`);case St.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 re("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case St.REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case St.VARIABLE_IN_STRING:throw new re("Error generating style shader: Converting a variable to a string is not supported.");case St.LITERAL_NULL:return fh.NULL_SENTINEL;case St.LITERAL_BOOLEAN:return c?"true":"false";case St.LITERAL_NUMBER:return x_(c);case St.LITERAL_STRING:if(l(n)&&n._type===St.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||ex(n._left)))return c;if(i=U.fromCssColorString(c,kF),l(i))return Hje(i);throw new re("Error generating style shader: String literals are not supported.");case St.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Wle(this),l(i)?FF(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Wle(this),l(i)?FF(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Hle(this),l(i)?FF(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Hle(this),l(i)?(i.alpha!==1&&(t.translucent=!0),FF(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case St.LITERAL_VECTOR:f=o.length,d=`${c}(`;for(let p=0;p<f;++p)d+=o[p],p<f-1&&(d+=", ");return d+=")",d;case St.LITERAL_REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case St.LITERAL_UNDEFINED:return fh.NULL_SENTINEL;case St.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Pt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,a=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 s;switch(r){case St.VARIABLE:ex(this)||e.push(a);break;case St.VARIABLE_IN_STRING:for(s=UI.exec(a);s!==null;)e.push(s[1]),s=UI.exec(a);break;case St.LITERAL_STRING:l(t)&&t._type===St.MEMBER&&ex(t._left)&&e.push(a);break}};var dh=fh;function T0(e){e=e??G.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=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=U.clone(U.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=e.classificationType??Yn.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(T0.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var Wje={position:0,a_batchId:1};function qje(e,t){if(l(e._va))return;let n=Ke.createVertexBuffer({context:t,typedArray:e._positions,usage:Oe.STATIC_DRAW}),i=Ke.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Oe.STATIC_DRAW}),o=Ke.createIndexBuffer({context:t,typedArray:e._indices,usage:Oe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:Y.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Y.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new Fn({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new Fn({context:t,attributes:r,indexBuffer:Ke.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Oe.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function Yje(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??Wje,o=e._pickId,r=e._vertexShaderSource,a=e._fragmentShaderSource;if(l(r)){e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:i}),e._spStencil=e._sp,a=He.replaceMain(a,"czm_non_pick_main"),a=`${a}void main()
  5603. {
  5604. czm_non_pick_main();
  5605. out_FragColor = ${o};
  5606. }
  5607. `,e._spPick=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:i});return}let s=n.getVertexShaderCallback(!1,"a_batchId",void 0)(zI),c=n.getFragmentShaderCallback(!1,void 0,!0)(Hy);o=n.getPickId();let u=new He({sources:[s]}),f=new He({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new He({sources:[zI]}),f=new He({defines:["VECTOR_TILE"],sources:[Hy]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=He.replaceMain(c,"czm_non_pick_main"),c=`${c}
  5608. void main()
  5609. {
  5610. czm_non_pick_main();
  5611. out_FragColor = ${o};
  5612. }
  5613. `;let d=new He({sources:[s]}),p=new He({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function Xle(e){let t=e?Xn.EQUAL:Xn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:vt.KEEP,zFail:vt.DECREMENT_WRAP,zPass:vt.KEEP},backFunction:t,backOperation:{fail:vt.KEEP,zFail:vt.INCREMENT_WRAP,zPass:vt.KEEP},reference:Ht.CESIUM_3D_TILE_MASK,mask:Ht.CESIUM_3D_TILE_MASK},stencilMask:Ht.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},depthMask:!1}}var Xje={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},reference:0,mask:Ht.CLASSIFICATION_MASK},stencilMask:Ht.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:Jt.PRE_MULTIPLIED_ALPHA_BLEND},Kje={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},reference:0,mask:Ht.CLASSIFICATION_MASK},stencilMask:Ht.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Qje(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(Xle(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(Xle(!0)),e._rsColorPass=Ve.fromCache(Xje),e._rsPickPass=Ve.fromCache(Kje))}var tx=new R,Kle=new h;function $je(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return R.clone(i,tx),R.multiplyByPoint(tx,e._center,Kle),R.setTranslation(tx,Kle,tx),R.multiply(o,tx,tx),tx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function zq(e,t,n,i,o,r,a){let s=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=a[f],p=i[d],g=o[d],m=new e.constructor(e.buffer,s*p,g);t.set(m,n),i[d]=n,n+=g}return n}function Jje(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,a=new n.constructor(n.length),s=t.pop(),c=[s],u=zq(n,a,0,i,o,s.batchIds,r);for(s.offset=0,s.count=u;t.length>0;){let f=t.pop();if(U.equals(f.color,s.color))u=zq(n,a,u,i,o,f.batchIds,r),s.batchIds=s.batchIds.concat(f.batchIds),s.count=u-s.offset;else{let d=u;u=zq(n,a,u,i,o,f.batchIds,r),f.offset=d,f.count=u-d,c.push(f),s=f}}e._va.indexBuffer.copyFromArrayView(a),e._indices=a,e._batchedIndices=c}function Uq(e,t,n,i,o,r,a){let s=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=a[f],p=i[d],g=o[d];t.copyFromBuffer(e,p*s,n*s,g*s),i[d]=n,n+=g}return n}function Zje(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),a=[r],s=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=Uq(s,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let d=t.pop();if(U.equals(d.color,r.color))u=Uq(s,c,u,n,i,d.batchIds,o),r.batchIds=r.batchIds.concat(d.batchIds),r.count=u-r.offset;else{let p=u;u=Uq(s,c,u,n,i,d.batchIds,o),d.offset=p,d.count=u-p,a.push(d),r=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=a}function eGe(e,t){return t.color.toRgba()-e.color.toRgba()}function tGe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let a=0;a<i;++a){let c=n[a].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(eGe),t.webgl2?Zje(e,n):Jje(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function nGe(e,t){let n=tGe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,a=r*2;if(l(i)&&!n&&i.length===a)return;i.length=a;let s=e._va,c=e._sp,u=e._modelMatrix??R.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,m=o[p].count,A=i[p*2];l(A)||(A=i[p*2]=new tt({owner:e})),A.vertexArray=s,A.modelMatrix=u,A.offset=g,A.count=m,A.renderState=e._rsStencilDepthPass,A.shaderProgram=c,A.uniformMap=f,A.boundingVolume=d,A.cull=!1,A.pass=Ie.TERRAIN_CLASSIFICATION;let y=tt.shallowClone(A,A.derivedCommands.tileset);y.renderState=e._rsStencilDepthPass3DTiles,y.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,A.derivedCommands.tileset=y;let x=i[p*2+1];l(x)||(x=i[p*2+1]=new tt({owner:e})),x.vertexArray=s,x.modelMatrix=u,x.offset=g,x.count=m,x.renderState=e._rsColorPass,x.shaderProgram=c,x.uniformMap=f,x.boundingVolume=d,x.cull=!1,x.pass=Ie.TERRAIN_CLASSIFICATION;let b=tt.shallowClone(x,x.derivedCommands.tileset);b.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=b}e._commandsDirty=!0}function iGe(e,t){if(e.classificationType===Yn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,a=i.length=r/2,s=0;for(let c=0;c<a;++c){let u=i[c]=tt.shallowClone(n[s],i[c]);u.shaderProgram=o,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,s+=2}e._commandsDirty=!1}function oGe(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,a=e._modelMatrix??R.IDENTITY,s=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=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=a,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=s,p.boundingVolume=d,p.pass=Ie.TERRAIN_CLASSIFICATION;let g=tt.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new tt({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=a,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=s,m.boundingVolume=d,m.pass=Ie.TERRAIN_CLASSIFICATION;let A=tt.shallowClone(m,m.derivedCommands.tileset);A.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=A}e._pickCommandsDirty=!1}T0.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 as(e,r)}};T0.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function rGe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let a=n[o],s=t[a];s.show=!0,s.color=U.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=U.clone(U.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var aGe=new U,sGe=U.WHITE,cGe=!0,lGe=/\$/;T0.prototype.applyStyle=function(e,t){if(!l(e)){rGe(this,t);return}let n=e.color,i=n instanceof dh&&!lGe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,a;for(a=0;a<r;++a){let s=o[a],c=t[s];c.color=l(e.color)?e.color.evaluateColor(c,aGe):sGe,c.show=l(e.show)?e.show.evaluate(c):cGe}if(i){let s=this._batchedIndices;for(r=s.length,a=0;a<r;++a)s[a].color=U.clone(U.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};T0.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,a=o[i],s=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let A=c[f].offset,y=c[f].count;if(a>=A&&a<A+y)break}c.push(new b0({color:U.clone(t),offset:a,count:s,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let A=0;A<m;++A){let y=g[A];if(y===e)continue;let x=n[y];o[x]<a?d.push(y):p.push(y)}p.length!==0&&c.push(new b0({color:U.clone(c[f].color),offset:a+s,count:c[f].offset+c[f].count-(a+s),batchIds:p})),d.length!==0?(c[f].count=a-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function Qle(e,t,n,i){let o=e.classificationType,r=o!==Yn.CESIUM_3D_TILE,a=o!==Yn.TERRAIN,s=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=Ie.TERRAIN_CLASSIFICATION,s.push(u)),a&&(u=n[f].derivedCommands.tileset,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,s.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)s.push(i[f])}function uGe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Ie.OPAQUE,n.push(r)}}function fGe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Re.LINES):(n=e._rsColorPass,i=Re.TRIANGLES);let o=e._commands,r=o.length;for(let a=0;a<r;a+=2){let s=o[a+1];s.renderState=n,s.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}T0.prototype.update=function(e){let t=e.context;qje(this,t),Yje(this,t),Qje(this),$je(this,t);let n=e.passes;n.render&&(nGe(this,t),iGe(this,e),fGe(this),this._debugWireframe?uGe(e,this._commands):Qle(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(oGe(this),Qle(this,e,this._pickCommands))};T0.prototype.isDestroyed=function(){return!1};T0.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(),fe(this)};var LC=T0;function $u(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=Yn.BOTH}Object.defineProperties($u.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}}});$u.packedBoxLength=R.packedLength+h.packedLength;$u.packedCylinderLength=R.packedLength+2;$u.packedEllipsoidLength=R.packedLength+h.packedLength;$u.packedSphereLength=h.packedLength+1;function dGe(e){let t=new Float64Array(R.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,R.pack(e._modelMatrix,t,n),t}function hGe(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 a=t[n++],s=e._batchedIndices=new Array(a);for(let c=0;c<a;++c){let u=U.unpack(t,n);n+=U.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];s[c]=new b0({color:u,offset:f,count:d,batchIds:g})}return i}var mGe=new Wn("createVectorTileGeometries",5),pGe=new U;function gGe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,a=e._ellipsoidBatchIds,s=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),a=e._ellipsoidBatchIds=a.slice(),m+=a.length),l(e._spheres)&&(s=e._sphere=s.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let A=e._batchTable;for(let y=0;y<m;++y){let x=A.getColor(y,pGe);u[y]=x.toRgba()}f=e._packedBuffer=dGe(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,o.buffer),l(r)&&d.push(r.buffer,a.buffer),l(s)&&d.push(s.buffer,c.buffer),d.push(u.buffer,f.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)?a.buffer:void 0,spheres:l(s)?s.buffer:void 0,sphereBatchIds:l(s)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=mGe.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let A=new Float64Array(m.packedBuffer);hGe(e,A)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),_Ge(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function _Ge(e){l(e._primitive)||(e._primitive=new LC({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: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)}$u.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};$u.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};$u.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};$u.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};$u.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=gGe(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)};$u.prototype.isDestroyed=function(){return!1};$u.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var b_=$u;var Vq=class{constructor(t,n,i,o,r){this._tileset=t,this._tile=n,this._resource=i,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,xGe(this,o,r)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return $le(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){$le(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),fe(this)}};function AGe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function yGe(e,t){let n,i,o,r,a,s=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(s>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,s)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(o)||l(r),p=s>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(d&&p)throw new re("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 m=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),a=0;a<s;++a)n[a]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),a=0;a<c;++a)i[a]=m++;if(!l(o)&&u>0)for(o=new Uint16Array(u),a=0;a<u;++a)o[a]=m++;if(!l(r)&&f>0)for(r=new Uint16Array(f),a=0;a<f;++a)r[a]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var nx=Uint32Array.BYTES_PER_ELEMENT;function xGe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=nx;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=nx;let a=o.getUint32(n,!0);if(n+=nx,a===0){e._ready=!0;return}let s=o.getUint32(n,!0);if(n+=nx,s===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=nx;let u=o.getUint32(n,!0);n+=nx;let f=o.getUint32(n,!0);n+=nx;let d=Sr(i,n,s);n+=s;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=Sr(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let A=d.BOXES_LENGTH??0,y=d.CYLINDERS_LENGTH??0,x=d.ELLIPSOIDS_LENGTH??0,b=d.SPHERES_LENGTH??0,T=A+y+x+b,E=new Vm(e,T,g,m,AGe(e));if(e._batchTable=E,T===0)return;let S=e.tile.computedTransform,w;l(d.RTC_CENTER)&&(w=h.unpack(d.RTC_CENTER),R.multiplyByPoint(S,w,w));let P=yGe(d,p);if(A>0||y>0||x>0||b>0){let O,B,L,_;if(A>0){let C=p.byteOffset+d.BOXES.byteOffset;O=new Float32Array(p.buffer,C,b_.packedBoxLength*A)}if(y>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;B=new Float32Array(p.buffer,C,b_.packedCylinderLength*y)}if(x>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,b_.packedEllipsoidLength*x)}if(b>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,b_.packedSphereLength*b)}return e._geometries=new b_({boxes:O,boxBatchIds:P.boxes,cylinders:B,cylinderBatchIds:P.cylinders,ellipsoids:L,ellipsoidBatchIds:P.ellipsoids,spheres:_,sphereBatchIds:P.spheres,center:w,modelMatrix:S,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function $le(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}}var jF=Vq;var jq={};jq.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,a,s,c=BigInt(0);for(s=i/2;s>0;s/=2)r=(o.x&s)>0?1:0,a=(o.y&s)>0?1:0,c+=BigInt((3*r^a)*s*s),Jle(i,o,r,a);return c};jq.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,a,s;for(a=1,s=t;a<n;a*=2)o=1&Number(s/BigInt(2)),r=1&Number(s^BigInt(o)),Jle(a,i,o,r),i.x+=a*o,i.y+=a*r,s/=BigInt(4);return[i.x,i.y]};function Jle(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 VI=jq;var ix=30,bGe=1<<ix,TGe=1<<ix+1>>>0,Gq=2*ix+1,T_=4,tue=[],nue=[],CGe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],C_=1,NC=2,GF=[C_,0,0,C_|NC];function xa(e){if(!cn.supportsBigInt())throw new re("S2 required BigInt support");this._cellId=e,this._level=xa.getLevel(e)}xa.fromToken=function(e){return new xa(xa.getIdFromToken(e))};xa.isValidId=function(e){return!(e<=0||e>>BigInt(Gq)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};xa.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?xa.isValidId(xa.getIdFromToken(e)):!1};xa.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};xa.getTokenFromId=function(e){let t=Math.floor(MGe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};xa.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return ix-(t>>1)};xa.prototype.getChild=function(e){let t=rue(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new xa(n)};xa.prototype.getParent=function(){let e=rue(this._cellId)<<BigInt(2);return new xa(this._cellId&~e+BigInt(1)|e)};xa.prototype.getParentAtLevel=function(e){let t=RGe(e);return new xa(this._cellId&-t|t)};xa.prototype.getCenter=function(e){e=e??te.WGS84;let t=EGe(this._cellId,this._level);t=h.normalize(t,t);let n=de.fromCartesian(t,te.UNIT_SPHERE);return de.toCartesian(n,e,new h)};xa.prototype.getVertex=function(e,t){t=t??te.WGS84;let n=vGe(this._cellId,this._level,e);n=h.normalize(n,n);let i=de.fromCartesian(n,te.UNIT_SPHERE);return de.toCartesian(i,t,new h)};xa.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"),a=Array(Gq-2*n).join("0"),s=BigInt(`0b${i}${r}${o}1${a}`);return new xa(s)};function EGe(e,t){let n=SGe(e,t);return wGe(n[0],n[1],n[2])}function vGe(e,t,n){let i=iue(e,t),o=IGe([i[1],i[2]],t),r=n>>1&1;return oue(i[0],o[0][r^n&1],o[1][r])}function SGe(e,t){let n=iue(e),i=n[0],o=n[1],r=n[2],a=t===30,s=!a&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=a?1:s?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function iue(e){tue.length===0&&PGe();let t=Number(e>>BigInt(Gq)),n=t&C_,i=(1<<T_)-1,o=0,r=0;for(let a=7;a>=0;a--){let c=(1<<2*(a===7?ix-7*T_:T_))-1;n+=Number(e>>BigInt(a*2*T_+1)&BigInt(c))<<2,n=nue[n];let u=a*T_;o+=n>>T_+2<<u,r+=(n>>2&i)<<u,n&=C_|NC}return[t,o,r]}function wGe(e,t,n){let i=Zle(t),o=Zle(n),r=HF(i),a=HF(o);return oue(e,r,a)}function oue(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 HF(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Zle(e){return 1/TGe*e}function IGe(e,t){let n=[[],[]],i=DGe(t);for(let o=0;o<2;++o){let r=e[o]&-i,a=r+i;n[o][0]=HF(eue(r)),n[o][1]=HF(eue(a))}return n}function DGe(e){return 1<<ix-e>>>0}function eue(e){return 1/bGe*e}function E_(e,t,n,i,o,r){if(e===T_){let a=(t<<T_)+n;tue[(a<<2)+i]=(o<<2)+r,nue[(o<<2)+i]=(a<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let a=CGe[r];E_(e,t+(a[0]>>1),n+(a[0]&1),i,o,r^GF[0]),E_(e,t+(a[1]>>1),n+(a[1]&1),i,o+1,r^GF[1]),E_(e,t+(a[2]>>1),n+(a[2]&1),i,o+2,r^GF[2]),E_(e,t+(a[3]>>1),n+(a[3]&1),i,o+3,r^GF[3])}}function PGe(){E_(0,0,0,0,0,0),E_(0,0,0,C_,0,C_),E_(0,0,0,NC,0,NC),E_(0,0,0,C_|NC,0,C_|NC)}function rue(e){return e&~e+BigInt(1)}function RGe(e){return BigInt(1)<<BigInt(2*(ix-e))}var OGe=[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 MGe(e){return OGe[(-e&e)%BigInt(67)]}var v_=xa;function BGe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var vi=BGe;function Hq(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 re(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let a=e.computeAvailableCountEnabled??!1;!l(n)&&a&&(n=LGe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function LGe(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(Hq.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});Hq.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 jI=Hq;function C0(e){e=e??G.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(C0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});C0.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};C0.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};C0.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};C0.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};C0.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};C0.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};C0.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var GI=C0;var HI={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};HI.getBranchingFactor=function(e){switch(e){case HI.OCTREE:return 8;case HI.QUADTREE:return 4}};Object.freeze(HI);var Va=HI;function Ws(){}Object.defineProperties(Ws.prototype,{class:{get:function(){_e.throwInstantiationError()}}});Ws.prototype.hasProperty=function(e){_e.throwInstantiationError()};Ws.prototype.hasPropertyBySemantic=function(e){_e.throwInstantiationError()};Ws.prototype.getPropertyIds=function(e){_e.throwInstantiationError()};Ws.prototype.getProperty=function(e){_e.throwInstantiationError()};Ws.prototype.setProperty=function(e,t){_e.throwInstantiationError()};Ws.prototype.getPropertyBySemantic=function(e){_e.throwInstantiationError()};Ws.prototype.setPropertyBySemantic=function(e,t){_e.throwInstantiationError()};Ws.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))};Ws.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};Ws.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};Ws.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=qe(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};Ws.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};Ws.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return Ws.getProperty(o.id,t,n)};Ws.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?Ws.setProperty(r.id,t,n,i):!1};var Un=Ws;function E0(e){e=e??G.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(E0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});E0.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};E0.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};E0.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};E0.prototype.getProperty=function(e){return Un.getProperty(e,this._properties,this._class)};E0.prototype.setProperty=function(e,t){return Un.setProperty(e,t,this._properties,this._class)};E0.prototype.getPropertyBySemantic=function(e){return Un.getPropertyBySemantic(e,this._properties,this._class)};E0.prototype.setPropertyBySemantic=function(e,t){return Un.setPropertyBySemantic(e,t,this._properties,this._class)};var WF=E0;var an={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},qc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};an.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:qc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:qc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:qc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:qc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:qc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:qc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:qc.INTEGER,downcastFunction:e=>an.clampToLimits(e,an.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:qc.UNSIGNED_INTEGER,downcastFunction:e=>an.clampToLimits(e,an.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:qc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:qc.FLOAT,downcastFunction:e=>Math.fround(e)}};an.getMinimum=function(e){return an.typeInfo[e].minimumValue};an.getMaximum=function(e){return an.typeInfo[e].maximumValue};an.isIntegerType=function(e){return an.typeInfo[e].category!==qc.FLOAT};an.isUnsignedIntegerType=function(e){return an.typeInfo[e].category===qc.UNSIGNED_INTEGER};an.isVectorCompatible=function(e){return an.typeInfo[e].vectorCompatible};an.category=function(e){return an.typeInfo[e].category};an.gpuComponentType=function(e){switch(e){case an.INT64:return"INT32";case an.UINT64:return"UINT32";case an.FLOAT64:return"FLOAT32";default:return e}};an.normalize=function(e,t){return Math.max(Number(e)/Number(an.getMaximum(t)),-1)};an.unnormalize=function(e,t){let n=an.getMaximum(t),i=an.isUnsignedIntegerType(t)?0:-n;return e=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===an.INT64||t===an.UINT64)&&cn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};an.applyValueTransform=function(e,t,n){return n*e+t};an.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};an.getSizeInBytes=function(e){return an.typeInfo[e].size};an.clampToLimits=function(e,t){let n=an.getMinimum(t),i=an.getMaximum(t);if(typeof e=="bigint"){let o=BigInt(n),r=BigInt(i);return e<o?n:e>r?i:Number(e)}return Math.max(n,Math.min(i,e))};an.downcastFunction=function(e){let n=an.typeInfo[e].downcastFunction;return l(n)?n:i=>i};an.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return an.INT8;case Y.UNSIGNED_BYTE:return an.UINT8;case Y.SHORT:return an.INT16;case Y.UNSIGNED_SHORT:return an.UINT16;case Y.INT:return an.INT32;case Y.UNSIGNED_INT:return an.UINT32;case Y.FLOAT:return an.FLOAT32;case Y.DOUBLE:return an.FLOAT64}};an.toComponentDatatype=function(e){switch(e){case an.INT8:return Y.BYTE;case an.UINT8:return Y.UNSIGNED_BYTE;case an.INT16:return Y.SHORT;case an.UINT16:return Y.UNSIGNED_SHORT;case an.INT32:return Y.INT;case an.UINT32:return Y.UNSIGNED_INT;case an.FLOAT32:return Y.FLOAT;case an.FLOAT64:return Y.DOUBLE}};an.getDataViewAccessors=function(e,t){return{[an.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[an.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[an.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,o)=>e.setUint16(i,o,!0)},[an.INT16]:{get:i=>e.getInt16(i,!0),set:(i,o)=>e.setInt16(i,o,!0)},[an.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,o)=>e.setUint32(i,o,!0)},[an.INT32]:{get:i=>e.getInt32(i,!0),set:(i,o)=>e.setInt32(i,o,!0)},[an.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,o)=>e.setFloat32(i,o,!0)},[an.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,o)=>e.setFloat64(i,o,!0)},[an.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,o)=>e.setBigUint64(i,BigInt(o),!0)},[an.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,o)=>e.setBigInt64(i,BigInt(o),!0)}}[t]};Object.freeze(an);var Rt=an;var Xo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Xo.isVectorType=function(e){switch(e){case Xo.VEC2:case Xo.VEC3:case Xo.VEC4:return!0;default:return!1}};Xo.isMatrixType=function(e){switch(e){case Xo.MAT2:case Xo.MAT3:case Xo.MAT4:return!0;default:return!1}};Xo.getComponentCount=function(e){switch(e){case Xo.SCALAR:case Xo.STRING:case Xo.ENUM:case Xo.BOOLEAN:return 1;case Xo.VEC2:return 2;case Xo.VEC3:return 3;case Xo.VEC4:return 4;case Xo.MAT2:return 4;case Xo.MAT3:return 9;case Xo.MAT4:return 16}};Xo.getMathType=function(e){switch(e){case Xo.VEC2:return z;case Xo.VEC3:return h;case Xo.VEC4:return se;case Xo.MAT2:return Wi;case Xo.MAT3:return $;case Xo.MAT4:return R;default:return}};Object.freeze(Xo);var ht=Xo;function Gr(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&(e.normalized??!1)&&Rt.isIntegerType(i);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=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=qe(e.min,!0),this._max=qe(e.max,!0),this._normalized=r;let a=qe(e.offset,!0),s=qe(e.scale,!0),c=l(a)||l(s),u=!0;l(a)||(a=this.expandConstant(0,u)),l(s)||(s=this.expandConstant(1,u)),this._offset=a,this._scale=s,this._hasValueTransform=c,this._noData=qe(e.noData,!0),this._default=qe(e.default,!0),this._required=e.required??!0,this._extras=qe(e.extras,!0),this._extensions=qe(e.extensions,!0)}Gr.fromJson=function(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.property,i=NGe(n),o=FGe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new Gr({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(Gr.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 NGe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===ht.SCALAR||ht.isMatrixType(t)||ht.isVectorType(t))return!1;if(l(Rt[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 FGe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,a,s;o?(r=!0,a=e.componentCount,s=!l(a)):e.array?(r=!0,a=e.count,s=!l(e.count)):(r=!1,a=void 0,s=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===ht.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:s,arrayLength:a};if(o&&i===ht.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:s,arrayLength:a};if(n===ht.SCALAR||ht.isMatrixType(n)||ht.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:s,arrayLength:a};if(n===ht.BOOLEAN||n===ht.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:s,arrayLength:a};if(o&&(i===ht.BOOLEAN||i===ht.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:s,arrayLength:a};if(l(i)&&l(Rt[i]))return{type:ht.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:s,arrayLength:a};if(l(Rt[n]))return{type:ht.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:s,arrayLength:a}}Gr.prototype.normalize=function(e){return this._normalized?Wq(e,this._valueType,Rt.normalize):e};Gr.prototype.unnormalize=function(e){return this._normalized?Wq(e,this._valueType,Rt.unnormalize):e};Gr.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Gr.valueTransformInPlace(e,this._offset,this._scale,Rt.applyValueTransform)};Gr.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Gr.valueTransformInPlace(e,this._offset,this._scale,Rt.unapplyValueTransform)};Gr.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=ht.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 a=new Array(o).fill(e);return new Array(this._arrayLength).fill(a)};Gr.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!lue(e,t))return e};function lue(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(!lue(e[n],t[n]))return!1;return!0}Gr.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=ht.getMathType(this._type),i=this._isArray,o=ht.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(a){return n.unpack(a)}):i?n.unpackArray(e):n.unpack(e):e};Gr.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=ht.getMathType(this._type),i=this._isArray,o=ht.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(a){return n.pack(a,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Gr.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?kGe(this,e):uue(this,e)};function kGe(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=uue(e,t[i]);if(l(o))return o}}function uue(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return ht.isVectorType(n)?zGe(t,n,i):ht.isMatrixType(n)?UGe(t,n,i):n===ht.STRING?VGe(t):n===ht.BOOLEAN?jGe(t):n===ht.ENUM?GGe(t,o):HGe(t,i,r)}function zGe(e,t,n){if(!Rt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===ht.VEC2&&!(e instanceof z))return`vector value ${e} must be a Cartesian2`;if(t===ht.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===ht.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function UGe(e,t,n){if(!Rt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===ht.MAT2&&!(e instanceof Wi))return`matrix value ${e} must be a Matrix2`;if(t===ht.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===ht.MAT4&&!(e instanceof R))return`matrix value ${e} must be a Matrix4`}function VGe(e){if(typeof e!="string")return qF(e,ht.STRING)}function jGe(e){if(typeof e!="boolean")return qF(e,ht.BOOLEAN)}function GGe(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 HGe(e,t,n){let i=typeof e;switch(t){case Rt.INT8:case Rt.UINT8:case Rt.INT16:case Rt.UINT16:case Rt.INT32:case Rt.UINT32:case Rt.FLOAT32:case Rt.FLOAT64:return i!=="number"?qF(e,t):isFinite(e)?sue(e,t,n):cue(e,t);case Rt.INT64:case Rt.UINT64:return i!=="number"&&i!=="bigint"?qF(e,t):i==="number"&&!isFinite(e)?cue(e,t):sue(e,t,n)}}function qF(e,t){return`value ${e} does not match type ${t}`}function aue(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function sue(e,t,n){if(n){let i=Rt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?aue(e,t,n):void 0}if(e<Rt.getMinimum(t)||e>Rt.getMaximum(t))return aue(e,t,n)}function cue(e,t){return`value ${e} of type ${t} must be finite`}function Wq(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=Wq(e[i],t,n);return e}Gr.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]=Gr.valueTransformInPlace(e[o],t[o],n[o],i);return e};Gr.prototype.cpuBytesPerElement=function(){return fue(this,this.valueType)};Gr.prototype.gpuBytesPerElement=function(){let e=Rt.gpuComponentType(this.valueType);return fue(this,e)};function fue(e,t){let n=e.type,i=ht.getComponentCount(n),o=e.isArray?e.arrayLength:1,r=Rt.getSizeInBytes(t);return i*o*r}Gr.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===ht.STRING||t===ht.BOOLEAN||this.gpuBytesPerElement()>e)};var qq=[void 0,"float","vec2","vec3","vec4"],due=[void 0,"int","ivec2","ivec3","ivec4"],WGe=[void 0,"uint","uvec2","uvec3","uvec4"],qGe={[qc.FLOAT]:"uintBitsToFloat",[qc.INTEGER]:"int",[qc.UNSIGNED_INTEGER]:""};Gr.prototype.getGlslTypeWebGL1=function(){let e=ht.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?qq[e]:due[e]};Gr.prototype.getGlslType=function(){let e=this.valueType,t=ht.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Rt.isIntegerType(e)||this.normalized?qq[t]:Rt.isUnsignedIntegerType(e)?WGe[t]:due[t]};Gr.prototype.unpackTextureInShader=function(e,t,n,i){let o=this.getGlslType(),r=Rt.gpuComponentType(this.valueType),a=t.length,s=this.type,c=ht.getComponentCount(s)*(this.isArray?this.arrayLength:1),u=Math.floor(a/c),f=`${n}_rawChannels`,d=`${n}_rawBits`,p=`${n}_unpackedValue`,g=`${o} ${p};`,m=`uint ${d};`;i.push(g),i.push(m);let A=`${qq[a]} ${f} = ${e};`;i.push(A);let y=qGe[Rt.category(r)],x=c>1;for(let b=0;b<c;b++){let T="rgba".slice(b*u,(b+1)*u),E=a>1?`.${T}`:"",S=`${d} = czm_unpackTexture(${f}${E});`,w="";x&&(w=`[${b}]`);let P="",O="";if(this.normalized){let L=Rt.getMaximum(r);P=` * ${1/Number(L)}`,O="float"}let B=`${p}${w} = ${O}(${y}(${d}))${P};`;i.push(S),i.push(B)}return p};Gr.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var v0=Gr;function WI(e){e=e??G.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,a=i.isArray,s=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===ht.STRING,d=r===ht.BOOLEAN,p=0,g;if(s){let _=n.arrayOffsetType??n.offsetType;_=Rt[_]??Rt.UINT32;let C=n.arrayOffsets??n.arrayOffsetBufferView;g=new Yq(o[C],_,t+1),p+=g.typedArray.byteLength}let m=ht.getComponentCount(r),A;s?A=g.get(t)-g.get(0):a?A=t*i.arrayLength:A=t;let y=m*A,x;if(f){let _=n.stringOffsetType??n.offsetType;_=Rt[_]??Rt.UINT32;let C=n.stringOffsets??n.stringOffsetBufferView;x=new Yq(o[C],_,y+1),p+=x.typedArray.byteLength}(f||d)&&(c=Rt.UINT8);let b;f?b=x.get(y)-x.get(0):d?b=Math.ceil(y/8):b=y;let T=n.values??n.bufferView,E=new Yq(o[T],c,b);p+=E.typedArray.byteLength;let S=n.offset,w=n.scale,P=i.hasValueTransform||l(S)||l(w);S=S??i.offset,w=w??i.scale,S=hue(S),w=hue(w);let O,B,L=this;f?O=function(_){return KGe(_,L._values,L._stringOffsets)}:d?(O=function(_){return QGe(_,L._values)},B=function(_,C){$Ge(_,L._values,C)}):l(u)?(O=function(_){let C=L._values.get(_);return u.namesByValue[C]},B=function(_,C){let v=u.valuesByName[C];L._values.set(_,v)}):(O=function(_){return L._values.get(_)},B=function(_,C){L._values.set(_,C)}),this._arrayOffsets=g,this._stringOffsets=x,this._values=E,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=S,this._scale=w,this._hasValueTransform=P,this._getValue=O,this._setValue=B,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(WI.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}},classProperty:{get:function(){return this._classProperty}}});WI.prototype.get=function(e){let t=YGe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=r6e(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};WI.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=a6e(this,t),t=n.unnormalize(t),XGe(this,e,t)};WI.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function hue(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?Jn(t,i):t.push(i)}return t}function YGe(e,t){pue(e)&&gue(e);let n=e._classProperty,i=n.isArray,o=n.type,r=ht.getComponentCount(o);if(l(e._unpackedValues)){let a=e._unpackedValues[t];return i?qe(a,!0):a}return!i&&r===1?e._getValue(t):mue(e,n,t)}function mue(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let a=ht.getComponentCount(t.type);i*=a,o*=a}else{let s=(t.arrayLength??1)*e._vectorComponentCount;i=n*s,o=s}let r=new Array(o);for(let a=0;a<o;a++)r[a]=e._getValue(i+a);return r}function XGe(e,t,n){i6e(e,t,n)&&gue(e);let i=e._classProperty,o=i.isArray,r=i.type,a=ht.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=qe(n,!0)),e._unpackedValues[t]=n;return}if(!o&&a===1){e._setValue(t,n);return}let s,c;if(i.isVariableLengthArray)s=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-s;else{let f=(i.arrayLength??1)*e._vectorComponentCount;s=t*f,c=f}for(let u=0;u<c;++u)e._setValue(s+u,n[u])}function KGe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Ku(t.typedArray,i,o)}function QGe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function $Ge(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function JGe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,a=!0;for(let s=0;s<8;++s){let c=n.getUint8(i+s);r&&(a?c!==0&&(c=~(c-1)&255,a=!1):c=~c&255),o+=c*Math.pow(256,s)}return r&&(o=-o),o}function ZGe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,a=!0;for(let s=0;s<8;++s){let c=n.getUint8(i+s);r&&(a?c!==0&&(c=~(c-1)&255,a=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(s*8))}return r&&(o=-o),o}function e6e(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 t6e(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 n6e(e){switch(e){case Rt.INT8:return Y.BYTE;case Rt.UINT8:return Y.UNSIGNED_BYTE;case Rt.INT16:return Y.SHORT;case Rt.UINT16:return Y.UNSIGNED_SHORT;case Rt.INT32:return Y.INT;case Rt.UINT32:return Y.UNSIGNED_INT;case Rt.FLOAT32:return Y.FLOAT;case Rt.FLOAT64:return Y.DOUBLE}}function pue(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===ht.STRING||i===Rt.INT64&&!cn.supportsBigInt64Array()||i===Rt.UINT64&&!cn.supportsBigUint64Array()}function i6e(e,t,n){if(pue(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 gue(e){e._unpackedValues=o6e(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function o6e(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,a=ht.getComponentCount(r);if(!o&&a===1){for(let s=0;s<t;++s)n[s]=e._getValue(s);return n}for(let s=0;s<t;s++)n[s]=mue(e,i,s);return n}function r6e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:v0.valueTransformInPlace(t,e._offset,e._scale,Rt.applyValueTransform)}function a6e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:v0.valueTransformInPlace(t,e._offset,e._scale,Rt.unapplyValueTransform)}function Yq(e,t,n){let i=this,o,r,a;if(t===Rt.INT64)cn.supportsBigInt()?cn.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),a=function(s,c){i.typedArray[s]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(s){return ZGe(s,i)}):(_t("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(s){return JGe(s,i)});else if(t===Rt.UINT64)cn.supportsBigInt()?cn.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),a=function(s,c){i.typedArray[s]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(s){return t6e(s,i)}):(_t("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(s){return e6e(s,i)});else{let s=n6e(t);o=Y.createArrayBufferView(s,e.buffer,e.byteOffset,n),a=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(s){return i.typedArray[s]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=a,this._componentType=t}var YF=WI;function hh(e){e=e??G.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 a=new YF({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=a,i+=a.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(hh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});hh.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};hh.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};hh.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};hh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=s6e(this._class,t),i};hh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};hh.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)};hh.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};hh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};hh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function s6e(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=qe(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var mh=hh;var Xq=class{get cacheKey(){_e.throwInstantiationError()}load(){_e.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=`
  5614. ${n.message}`);let i=new re(t);return l(n)&&(i.stack=`Original stack:
  5615. ${n.stack}
  5616. Handler stack:
  5617. ${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),fe(this)}},Ki=Xq;var _ue={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(_ue);var gt=_ue;var XF=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,o=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=o,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=c6e(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function c6e(e){let t=e._resource;e._state=gt.LOADING;try{let n=await XF._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var FC=XF;var hmn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:8f8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo: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;Pviwue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndnavcd9hmbarTmbaohdarhwinadc:CuBdbadclfhdawcufgwmbkaeTmdarcdthDalhqcbhkinaohdaqhwarhxinadadydbgmcbawIdbgP:8cL4cFeGc:cufaPJbbbb9BEgsamas9kEBdbawclfhwadclfhdaxcufgxmbkaqaDfhqakcefgkae9hmbxdkkaeTmekarcdthqavce9hhDcbhkindndndnaDmbarTmdc:CuhwalhdarhxinawcbadIdbgP:8cL4cFeGc:cufaPJbbbb9BEgmawam9kEhwadclfhdaxcufgxmbxdkkdndndndnavPleddbdkarTmlaohdalhwarhxinadcbcbawIdbgP:8cL4cFeGgmc:cufgsasam0EaPJbbbb9BEBdbadclfhdawclfhwaxcufgxmbxikkarTmicbhdarhwinaoadfcbaladfIdbgP:8cL4cFeGgxc8Aaxc8A0Ec:cufaPJbbbb9BEBdbadclfhdawcufgwmbxdkkarTmdkc:CuhwkcbhdarhminawhxdnavceSmbaoadfydbhxkdndnaladfIdbgPcjjj;8iaxai9RcefgxcLt9R::NJbbbZJbbb:;aPJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohsxekcjjjj94hskabadfascFFFrGaxcKtVBdbadclfhdamcufgmmbkkabaqfhbalaqfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb: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:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",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(1),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var m=new Uint8Array(g.length),A=0;A<g.length;++A){var y=g.charCodeAt(A);m[A]=y>96?y-97:y>64?y-39:y+4}for(var x=0,A=0;A<g.length;++A)m[x++]=m[A]<60?t[m[A]]:(m[A]-60)*64+m[++A];return m.buffer.slice(0,x)}function r(g){if(!g)throw new Error("Assertion failed")}function a(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function s(g,m,A,y){var x=n.exports.sbrk,b=x(m.length*4),T=x(A*4),E=new Uint8Array(n.exports.memory.buffer),S=a(m);E.set(S,b),y&&y(b,b,m.length,A);var w=g(T,b,m.length,A);E=new Uint8Array(n.exports.memory.buffer);var P=new Uint32Array(A);new Uint8Array(P.buffer).set(E.subarray(T,T+A*4)),S.set(E.subarray(b,b+m.length*4)),x(b-x(0));for(var O=0;O<m.length;++O)m[O]=P[m[O]];return[P,w]}function c(g,m,A,y){var x=n.exports.sbrk,b=x(A*4),T=x(A*y),E=new Uint8Array(n.exports.memory.buffer);E.set(a(m),T),g(b,T,A,y),E=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(A);return new Uint8Array(S.buffer).set(E.subarray(b,b+A*4)),x(b-x(0)),S}function u(g,m,A,y,x,b,T){var E=n.exports.sbrk,S=E(m),w=E(y*x),P=new Uint8Array(n.exports.memory.buffer);P.set(a(A),w);var O=g(S,m,w,y,x,b,T),B=new Uint8Array(O);return B.set(P.subarray(S,S+O)),E(S-E(0)),B}function f(g){for(var m=0,A=0;A<g.length;++A){var y=g[A];m=m<y?y:m}return m}function d(g,m){if(r(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var A=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(A)}function p(g,m,A,y,x,b,T){var E=n.exports.sbrk,S=E(A*y),w=E(A*b),P=new Uint8Array(n.exports.memory.buffer);P.set(a(m),w),g(S,A,y,x,w,T);var O=new Uint8Array(A*y);return O.set(P.subarray(S,S+A*y)),E(S-E(0)),O}return{ready:i,supported:!0,reorderMesh:function(g,m,A){r(g instanceof Uint32Array||g instanceof Int32Array),r(!m||g.length%3==0);var y=m?A?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return s(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,y)},reorderPoints:function(g,m){return r(g instanceof Float32Array),r(g.length%m==0),r(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,A){r(A>0&&A<=256),r(A%4==0);var y=n.exports.meshopt_encodeVertexBufferBound(m,A);return u(n.exports.meshopt_encodeVertexBuffer,y,g,m,A)},encodeVertexBufferLevel:function(g,m,A,y,x){r(A>0&&A<=256),r(A%4==0),r(y>=0&&y<=3),r(x===void 0||x==0||x==1);var b=n.exports.meshopt_encodeVertexBufferBound(m,A);return u(n.exports.meshopt_encodeVertexBufferLevel,b,g,m,A,y,x===void 0?-1:x)},encodeIndexBuffer:function(g,m,A){r(A==2||A==4),r(m%3==0);var y=d(g,A),x=n.exports.meshopt_encodeIndexBufferBound(m,f(y)+1);return u(n.exports.meshopt_encodeIndexBuffer,x,y,m,4)},encodeIndexSequence:function(g,m,A){r(A==2||A==4);var y=d(g,A),x=n.exports.meshopt_encodeIndexSequenceBound(m,f(y)+1);return u(n.exports.meshopt_encodeIndexSequence,x,y,m,4)},encodeGltfBuffer:function(g,m,A,y,x){var b={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(b[y]),b[y](g,m,A,2,x===void 0?0:x)},encodeFilterOct:function(g,m,A,y){return r(A==4||A==8),r(y>=2&&y<=16),p(n.exports.meshopt_encodeFilterOct,g,m,A,y,16)},encodeFilterQuat:function(g,m,A,y){return r(A==8),r(y>=4&&y<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,A,y,16)},encodeFilterExp:function(g,m,A,y,x){r(A>0&&A%4==0),r(y>=1&&y<=24);var b={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return r(!x||x in b),p(n.exports.meshopt_encodeFilterExp,g,m,A,y,A,x?b[x]:1)},encodeFilterColor:function(g,m,A,y){return r(A==4||A==8),r(y>=2&&y<=16),p(n.exports.meshopt_encodeFilterColor,g,m,A,y,16)}}})();var S_=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq:VZkdbk:XYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbh5dnawTmbaxa8Acd4fRbbh5kcbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk: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:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:W9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:JBl8Aud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fhOaPaDfhAasaeaH9RaHasfae6EgCcsfgocl4cifcd4hXavcj;cbfaoc9WGgQcetfhLavcj;cbfaQci2fhKavcj;cbfaQfhYcbh8Aaoc;ab6hEincbh3dnawTmbaPa8Acd4fRbbh3kcbh5avcj;cbfh8Eindndndndna3a5cet4ciGgoc9:fPdebdkaxaA9RaQ6mwdnaQTmbavcj;cbfa5aQ2faAaQ;8qbbkaAaCfhAxdkaQTmeavcj;cbfa5aQ2fcbaQ;8kbxekaxaA9RaX6moaoclVcbawEhraAaXfhocbhidnaEmbaxao9Rc;Gb6mbcbhlina8EalfhidndndndndndnaAalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiczfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaicafaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaQ0meaihlaxao9Rc;Fb0mbkkdnaiaQ9pmbaici4hlinaxao9RcK6mwa8EaifhqdndndndndndnaAaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaoclffagRb:q:W:cjbfhoxikaqaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaocwffagRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbahaocdffagRb:q:W:cjbfhokalcdfhlaiczfgiaQ6mbkkaohAaoTmoka8EaQfh8Ea5cefg5cl9hmbkdndndndnawTmbaza8Acd4fRbbglciGPlbedwbkaQTmdavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep9Ta8Fpxeeeeeeeeeeeeeeeegap9op9Hp9rg8Fa8Jp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ugap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp9Ugap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp9Ugap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9AbbbaladfhlaoczfgoaQ6mbxikkaQTmeavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep:nea8Fpxebebebebebebebebgap9op:bep9rg8Fa8Jp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oegap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp:oegap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp:oegap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9AbbbaladfhlaoczfgoaQ6mbxdkkaQTmbcbhocbalcl4gl9Rc8FGhiavcjdfa8Afhrava8Afpbdbhainaravcj;cbfaofpblbg8JaYaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaLaofpblbg8MaKaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Tep9qg8Faap9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8LaypmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Tep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9AbbbaradfhraoczfgoaQ6mbkka8Aclfg8Aad6mbkdnaCad2goTmbaOavcjdfao;8qbbkdnammbavavcjdfaCcufad2fad;8qbbkaCaHfhHc9:hoaAhPaAmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",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)?s(t):s(e),r,a=WebAssembly.instantiate(o,{}).then(function(x){r=x.instance,r.exports.__wasm_call_ctors()});function s(x){for(var b=new Uint8Array(x.length),T=0;T<x.length;++T){var E=x.charCodeAt(T);b[T]=E>96?E-97:E>64?E-39:E+4}for(var S=0,T=0;T<x.length;++T)b[S++]=b[T]<60?i[b[T]]:(b[T]-60)*64+b[++T];return b.buffer.slice(0,S)}function c(x,b,T,E,S,w,P){var O=x.exports.sbrk,B=E+3&-4,L=O(B*S),_=O(w.length),C=new Uint8Array(x.exports.memory.buffer);C.set(w,_);var v=b(L,E,S,_,w.length);if(v==0&&P&&P(L,B,S),T.set(C.subarray(L,L+E*S)),O(L-O(0)),v!=0)throw new Error("Malformed buffer data: "+v)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(x){var b={object:new Worker(x),pending:0,requests:{}};return b.object.onmessage=function(T){var E=T.data;b.pending-=E.count,b.requests[E.id][E.action](E.value),delete b.requests[E.id]},b}function m(x){for(var b="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+y.name+";"+c.toString()+y.toString(),T=new Blob([b],{type:"text/javascript"}),E=URL.createObjectURL(T),S=d.length;S<x;++S)d[S]=g(E);for(var S=x;S<d.length;++S)d[S].object.postMessage({});d.length=x,URL.revokeObjectURL(E)}function A(x,b,T,E,S){for(var w=d[0],P=1;P<d.length;++P)d[P].pending<w.pending&&(w=d[P]);return new Promise(function(O,B){var L=new Uint8Array(T),_=++p;w.pending+=x,w.requests[_]={resolve:O,reject:B},w.object.postMessage({id:_,count:x,size:b,source:L,mode:E,filter:S},[L.buffer])})}function y(x){var b=x.data;self.ready.then(function(T){if(!b.id)return self.close();try{var E=new Uint8Array(b.count*b.size);c(T,T.exports[b.mode],E,b.count,b.size,b.source,T.exports[b.filter]),self.postMessage({id:b.id,count:b.count,action:"resolve",value:E},[E.buffer])}catch(S){self.postMessage({id:b.id,count:b.count,action:"reject",value:S})}})}return{ready:a,supported:!0,useWorkers:function(x){m(x)},decodeVertexBuffer:function(x,b,T,E,S){c(r,r.exports.meshopt_decodeVertexBuffer,x,b,T,E,r.exports[u[S]])},decodeIndexBuffer:function(x,b,T,E){c(r,r.exports.meshopt_decodeIndexBuffer,x,b,T,E)},decodeIndexSequence:function(x,b,T,E){c(r,r.exports.meshopt_decodeIndexSequence,x,b,T,E)},decodeGltfBuffer:function(x,b,T,E,S,w){c(r,r.exports[f[S]],x,b,T,E,r.exports[u[w]])},decodeGltfBufferAsync:function(x,b,T,E,S){return d.length>0?A(x,b,T,f[E],u[S]):a.then(function(){var w=new Uint8Array(x*b);return c(r,r.exports[f[E]],w,x,b,T,r.exports[u[S]]),w})}}})();var gmn=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbkkcualc8S2gHalc;D;O;f8U0EgXcbyd1:H:cjbHjjjjbbheasc:Cefasyd;8egAcdtfaeBdbasaAcefBd;8eaecbaHz:tjjjbhIcbh8RcbhgdnaCTmbcbh8MaXcbyd1:H:cjbHjjjjbbhgasc:Cefasyd;8egecdtfagBdbasaecefBd;8eagcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1:H:cjbHjjjjbbh8Rasc:Cefasyd;8egecdtfa8RBdbasaecefBd;8ea8RcbaHz:tjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:H:cjbHjjjjbbh8Masc:Cefasyd;8egHcdtfa8MBdbasaHcefBd;8ea8Mcbaez:tjjjb8AkdnadTmbcbhKabhHina8NaHclfydbg8Fcx2fgeIdba8NaHydbgacx2fgAIdbg8S:tgRa8NaHcwfydbghcx2fgXIdlaAIdlg8U:tg8VNaeIdla8U:tg8WaXIdba8S:tg8XN:tg8Ya8YNa8WaXIdwaAIdwg8Z:tg80NaeIdwa8Z:tg8Wa8VN:tg81a81Na8Wa8XNaRa80N:tg80a80NMMg8V:rhBa8Yh8Xa80h8Wa81hRdna8VJbbbb9EgATmba8YaB:vh8Xa80aB:vh8Wa81aB:vhRkaIaOaacdtfydbgXc8S2fgeaRaB:rg8VaRNNg83aeIdbMUdbaea8Wa8Va8WNgUNg85aeIdlMUdlaea8Xa8Va8XNg86Ng87aeIdwMUdwaeaRaUNgUaeIdxMUdxaea86aRNg88aeIdzMUdzaea8Wa86Ng89aeIdCMUdCaeaRa8Va8Xa8ZNaRa8SNa8Ua8WNMM:mg8:Ng86NgRaeIdKMUdKaea8Wa86Ng8WaeId3MUd3aea8Xa86Ng8XaeIdaMUdaaea86a8:Ng86aeId8KMUd8Kaea8VaeIdyMUdyaIaOa8Fcdtfydbg8Fc8S2fgea83aeIdbMUdbaea85aeIdlMUdlaea87aeIdwMUdwaeaUaeIdxMUdxaea88aeIdzMUdzaea89aeIdCMUdCaeaRaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea86aeId8KMUd8Kaea8VaeIdyMUdyaIaOahcdtfydbgac8S2fgea83aeIdbMUdbaea85aeIdlMUdlaea87aeIdwMUdwaeaUaeIdxMUdxaea88aeIdzMUdzaea89aeIdCMUdCaeaRaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea86aeId8KMUd8Kaea8VaeIdyMUdydna8MTmbdnaATmba8YaB:vh8Ya80aB:vh80a81aB:vh81ka8MaXcltfgeaBJbbbZNgRa80Ng8VaeIdlMUdlaeaRa8YNg8WaeIdwMUdwaeaRa81Ng8XaeIdbMUdbaeaRa8S:ma81Na8Ua80N:ta8Za8YN:tNgRaeIdxMUdxa8Ma8Fcltfgea8VaeIdlMUdlaea8WaeIdwMUdwaea8XaeIdbMUdbaeaRaeIdxMUdxa8Maacltfgea8VaeIdlMUdlaea8WaeIdwMUdwaea8XaeIdbMUdbaeaRaeIdxMUdxkaHcxfhHaKcifgKad6mbkkdnalTmbJq;x8J88J;n;m;m89J:v:;;w8ZamczGEamc;abGEh80cbhHaOhXazhKaIhea8NhAindnaHaXydb9hmbaHh8FdnazTmbaKydbh8Fka80hRdnaqTmbJbbjZa80aqa8FfRbbclGEhRkaecxfg8Fa8FIdbJbbbbMUdbaeczfg8Fa8FIdbJbbbbMUdbaecCfg8Fa8FIdbJbbbbMUdbaeaRaecyfg8FIdbg8YNgRaeIdbMUdbaeclfgaaRaaIdbMUdbaecwfgaaRaaIdbMUdbaecKfgaaaIdbaAIdbg8WaRN:tUdbaAcwfIdbh8Vaec3fgaaaIdbaRaAclfIdbg8XN:tUdbaecafgaaaIdbaRa8VN:tUdbaec8KfgaIdbh81a8Fa8YaRMUdbaaa81aRa8Va8VNa8Wa8WNa8Xa8XNMMNMUdbkaXclfhXaKclfhKaec8SfheaAcxfhAalaHcefgH9hmbkkdnadTmbcbh8Aabhainaba8Acdtfh8FcbhHinaYa8FaHc:G:G:cjbfydbcdtfydbgAfRbbhedndnaYaaaHfydbgXfRbbgKc99fcFeGcpe0mbaec99fcFeGc;:e6mekdnaKcufcFeGce0mba5aXcdtfydbaA9hmekdnaecufcFeGce0mba8EaAcdtfydbaX9hmekJbbacJbbacJbbbZaecFeGceSEaKcFeGceSEhUdna8Na8FaHc:K:G:cjbfydbcdtfydbcx2fgeIdwa8NaXcx2fgKIdwg86:tg8Sa8NaAcx2fghIdwa86:tg8Xa8XNahIdbaKIdbg8U:tg80a80NahIdlaKIdlg8Z:tg8Va8VNMMg81Na8Xa8Sa8XNaeIdba8U:tg83a80Na8VaeIdla8Z:tg85NMMg8WN:tg8Ya8YNa83a81Na80a8WN:tgRaRNa85a81Na8Va8WN:tg8Wa8WNMMgBJbbbb9ETmba8YaB:rgB:vh8Ya8WaB:vh8WaRaB:vhRkaUa81:rNgBa8Ya86NaRa8UNa8Za8WNMM:mg81Ng87a81Nh88a80a85Na8Va83N:tg81a81Na8Va8SNa8Xa85N:tg8Va8VNa8Xa83Na80a8SN:tg8Xa8XNMMg83:rh80a8Ya87Nh85a8Wa87Nh89aRa87Nh87a8WaBa8YNg8SNh8:a8SaRNhZaRaBa8WNgnNhca8Ya8SNh8Ya8WanNh8WaRaBaRNNh8Sdna83Jbbbb9ETmba81a80:vh81a8Xa80:vh8Xa8Va80:vh8VkaIaOaXcdtfydbc8S2fgeaeIdba8Sa8VaUa80:rNgRa8VNNMg80MUdbaea8Wa8XaRa8XNg8SNMg83aeIdlMUdlaea8Ya81aRa81Ng8WNMg8YaeIdwMUdwaeaca8Va8SNMg8SaeIdxMUdxaeaZa8Wa8VNMgUaeIdzMUdzaea8:a8Xa8WNMg8WaeIdCMUdCaea87a8VaRa81a86Na8Va8UNa8Za8XNMMg86:mNgRNMg8VaeIdKMUdKaea89a8XaRNMg8XaeId3MUd3aea85a81aRNMg81aeIdaMUdaaea88a86aRN:tgRaeId8KMUd8KaeaBaeIdyMUdyaIaOaAcdtfydbc8S2fgea80aeIdbMUdbaea83aeIdlMUdlaea8YaeIdwMUdwaea8SaeIdxMUdxaeaUaeIdzMUdzaea8WaeIdCMUdCaea8VaeIdKMUdKaea8XaeId3MUd3aea81aeIdaMUdaaeaRaeId8KMUd8KaeaBaeIdyMUdykaHclfgHcx9hmbkaacxfhaa8Acifg8Aad6mbkaCTmbcbhainJbbbbh80a8Nabaacdtfgeclfydbg8Fcx2fgHIdwa8Naeydbghcx2fgAIdwg8Z:tg8Va8VNaHIdbaAIdbg83:tg8Wa8WNaHIdlaAIdlg85:tg8Xa8XNMMg8Sa8Naecwfydbg8Acx2fgeIdwa8Z:tg8YNa8Va8YNa8WaeIdba83:tg81Na8XaeIdla85:tgBNMMgRa8VN:tJbbbbJbbjZa8Sa8Ya8YNa81a81NaBaBNMMg8UNaRaRN:tg86:va86Jbbbb9BEg86Nh88a8Ua8VNaRa8YN:ta86Nh89a8SaBNaRa8XN:ta86Nh8:a8Ua8XNaRaBN:ta86NhZa8Sa81NaRa8WN:ta86Nhna8Ua8WNaRa81N:ta86Nhca8WaBNa8Xa81N:tgRaRNa8Xa8YNa8VaBN:tgRaRNa8Va81Na8Wa8YN:tgRaRNMM:rJbbbZNhRa8PahaC2g8JcdtfhHa8Pa8AaC2gDcdtfhAa8Pa8FaC2g8KcdtfhXa8Z:mh9ca85:mhJa83:mh9eascjdfheaChKJbbbbhBJbbbbh86Jbbbbh8SJbbbbh8UJbbbbh8ZJbbbbh83Jbbbbh85Jbbbbh87JbbbbhUinaecwfaRa89aXIdbaHIdbg8Y:tg8XNa88aAIdba8Y:tg81NMg8VNUdbaeclfaRaZa8XNa8:a81NMg8WNUdbaeaRaca8XNana81NMg8XNUdbaecxfaRa9ca8VNaJa8WNa8Ya9ea8XNMMMg8YNUdbaRa8Va8WNNa8ZMh8ZaRa8Va8XNNa8UMh8UaRa8Wa8XNNa8SMh8SaRa8Ya8YNNaUMhUaRa8Va8YNNa87Mh87aRa8Wa8YNNa85Mh85aRa8Xa8YNNa83Mh83aRa8Va8VNNa86Mh86aRa8Wa8WNNaBMhBaRa8Xa8XNNa80Mh80aHclfhHaXclfhXaAclfhAaeczfheaKcufgKmbkagahc8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Fc8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Ac8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8Aa9qcifa69nmekka9qTmdcbh8KinaIaOa9ka8Kcx2fghydbgKcdtgXfydbg8Ac8S2fgeIdwa8Nahydlg8Fcx2fgHIdwg8WNaeIdzaHIdbg8XNaeIdaMgRaRMMa8WNaeIdlaHIdlg8YNaeIdCa8WNaeId3MgRaRMMa8YNaeIdba8XNaeIdxa8YNaeIdKMgRaRMMa8XNaeId8KMMM:lhRJbbbbJbbjZaeIdyg8V:va8VJbbbb9BEh8VdndnahydwgDmbJFFuuh86xekJbbbbJbbjZaIaOa8Fcdtfydbc8S2fgeIdyg81:va81Jbbbb9BEaeIdwa8NaKcx2fgHIdwg81NaeIdzaHIdbg80NaeIdaMgBaBMMa81NaeIdlaHIdlgBNaeIdCa81NaeId3Mg81a81MMaBNaeIdba80NaeIdxaBNaeIdKMg81a81MMa80NaeId8KMMM:lNh86ka8VaRNhBdnaCTmbagaKc8S2fgAIdwa8WNaAIdza8XNaAIdaMgRaRMMa8WNaAIdla8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8Pa8FaC2gacdtfhHa8RaKaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8Vxekaga8Fc8S2fgAIdwa8NaKcx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8RaacltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86dndndnaYaKfRbbc9:fPddbekaQaXfydbgXaKSmbaOa8Fcdtfydbh8Jindndna5aXcdtgafydbgecuSmbaOaecdtfydba8JSmekdna8EaafydbgecuSmbaOaecdtfydba8JSmeka8FhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkaBaR:lMhBaQaafydbgXaK9hmbkkaYa8FfRbbci9hmeaDTmeaQa8FcdtfydbgXa8FSmeindndna5aXcdtgafydbgecuSmbaOaecdtfydba8ASmekdna8EaafydbgecuSmbaOaecdtfydba8ASmekaKhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbka86aR:lMh86aQaafydbgXa8F9hmbxdkkdna8Ea5a5aXfydba8FSEaQaXfydbgacdtfydbgXcu9hmbaQa8FcdtfydbhXkagaac8S2fgAIdwa8NaXcx2fgeIdwg8WNaAIdzaeIdbg8XNaAIdaMgRaRMMa8WNaAIdlaeIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaXaC2g8AcdtfhHa8RaaaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8VxekagaXc8S2fgAIdwa8Naacx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8Ra8AcltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya8MTmba8Ma8Acltfgea8MahcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxkaCTmbagaAc8S2fgeagahc8S2gDfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9oaA2haa8RhHaChXinaHaafgeaHa8FfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8JmbJbbbbJbbjZaIaDfgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8VNaRN:thBa86a8Xa8WNaRN:th86a8Sa8Va8VNaRN:th8Sa8Ua8Wa8WNaRN:th8UaeczfheaHcufgHmbkaQaAcdtfydbgAaX9hmbka8MTmba8MaXcltfgeIdxhxaeIdwh9caeIdlhJaeIdbhRxekJbbbbhxJbbbbh9cJbbbbhJJbbbbhRkaBa81:vg8Wa80Na8Z:ta85aBa86a81:vg8VN:tg8Za8Ua86a8VN:tg8Y:vg8Xa8Va80Na83:tg8UN:th83a9caRa8WN:taJaRa8VN:tg86a8XN:tg85a8SaBa8WN:ta8Za8XN:tgB:vg8S:mh8Za86a8Y:vg9c:mhJdnJbbbbaRaRa81:vg9eN:ta86a9cN:ta85a8SN:tg86:la87J:983:g81NgR9ETmba8Za83NaJa8UNa9ea80Nax:tMMa86:vhnka81:laR9ETmba8Y:laR9ETmbaB:laR9ETmba9e:manNa8W:ma8ZanNa83aB:vMgBNa8V:maJanNa8X:maBNa8Ua8Y:vMMg85Na80:ma81:vMMMh87aLa8FfgeclfydbgHaeydbge9RhhaEaecitfh8FJbbbbhRdnaHaeSgDmbJbbbbhRa8FheahhAina8Naeclfydbcx2fgHIdwa88:tg8Va8VNaHIdba8::tg8Va8VNaHIdla89:tg8Va8VNMMg8Va8Naeydbcx2fgHIdwa88:tg8Wa8WNaHIdba8::tg8Wa8WNaHIdla89:tg8Wa8WNMMg8WaRaRa8W9DEgRaRa8V9DEhRaecwfheaAcufgAmbkaR:rgRaRNhRkaBa88:tg8Va8VNa87a8::tg8Va8VNa85a89:tg8Va8VNMMaR9EmbaKId8KhndnaDmbina8Na8Fclfydbcx2fgeIdba8Na8Fydbcx2fgHIdbg8W:tgRa89aHIdlg8X:tg80NaeIdla8X:tg8Va8:a8W:tg86N:tg8YaRa85a8X:tg8SNa8Va87a8W:tg8UN:tg8XNa8Va88aHIdwg81:tg8ZNaeIdwa81:tg8Wa80N:tg80a8VaBa81:tg83Na8Wa8SN:tg8VNa8Wa86NaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9Fmda8Fcwfh8FahcufghmbkkJbbbbJbbjZac:vacJbbbb9BEgRa9BaBNa9Ia87Na9EMg8Va8VMMaBNa9Ca85Na9HaBNa9FMg8Va8VMMa85Na9Da87Na9Ja85Na9GMg8Va8VMMa87NanMMM:lNaRa9Ba88Na9Ia8:Na9EMg8Va8VMMa88Na9Ca89Na9Ha88Na9FMg8Va8VMMa89Na9Da8:Na9Ja89Na9GMg8Va8VMMa8:NanMMM:lNJbb;aZNJ:983:g81M9Emba8JaBUdwa8Ja85Udla8Ja87UdbkaXcefgXal9hmbkdnaCmbcbhCxdkcbhXindna8AaXfRbbTmbaOaXcdtgefydbaX9hmbaYaXfhhaQaefh8Ja8NaXcx2fhAa8PaXaC2cdtfhDcbhEincuhLdnahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR:vaRJbbbb9BEa8FaHaC2cltfgHIdwaAIdwNaHIdbaAIdbNaHIdlaAIdlNMMaHIdxMNUdbaQaecdtfydbgeaX9hmbkaEcefgEaC9hmbkkaXcefgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:tNMg8EJbbbb9BmbaCaE:ta5a8Aa3aL:tNNNa8E:vawMhwkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdnawJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhOcdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgYavcFFFFi0Ecbyd1:H:cjbHjjjjbbgKBdCaqciBd2aqamcbyd1:H:cjbHjjjjbbgzBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihAaxhHindndnaoaOfRbbceGTmbaOcjjjjlVhXxekdndnaHclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqthXdndnaHcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarVhXdndnaHIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarcCtVhXkaAaXBdbaAclfhAaHcxfhHalaOcefgO9hmbxikkaKcFeaYz:tjjjb8AcbhPcbhvxdkaxhOaihHalhAindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcCthXdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kdnaQ:ZgKaH:taD:YgOaC:Y:tg8ENaX:Zg8Fa3:Zga:tNa8FaH:taOaP:Y:tghNaaaK:tNMggJbbbb9BmbaKa8F:taha8EaaaH:tNNNag:vaOMhOkaPaDa3ar0giEhPaXa3aiEhXdna3arSmbaDaCaiEgCaP9Rcd9imbdndnaLcl0mbdnaOJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaCfcd9Theka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",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(b){n=b.instance,n.exports.__wasm_call_ctors()});function o(b){for(var T=new Uint8Array(b.length),E=0;E<b.length;++E){var S=b.charCodeAt(E);T[E]=S>96?S-97:S>64?S-39:S+4}for(var w=0,E=0;E<b.length;++E)T[w++]=T[E]<60?t[T[E]]:(T[E]-60)*64+T[++E];return T.buffer.slice(0,w)}function r(b){if(!b)throw new Error("Assertion failed")}function a(b){return new Uint8Array(b.buffer,b.byteOffset,b.byteLength)}function s(b,T,E,S){var w=n.exports.sbrk,P=w(E*4),O=w(E*S*4),B=new Uint8Array(n.exports.memory.buffer);B.set(a(T),O),b(P,O,E,S*4),B=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(E);return new Uint8Array(L.buffer).set(B.subarray(P,P+E*4)),w(P-w(0)),L}function c(b,T,E){var S=n.exports.sbrk,w=S(T.length*4),P=S(E*4),O=new Uint8Array(n.exports.memory.buffer),B=a(T);O.set(B,w);var L=b(P,w,T.length,E);O=new Uint8Array(n.exports.memory.buffer);var _=new Uint32Array(E);new Uint8Array(_.buffer).set(O.subarray(P,P+E*4)),S(w-S(0));for(var C=0;C<T.length;++C)T[C]=_[T[C]];return[_,L]}function u(b){for(var T=0,E=0;E<b.length;++E){var S=b[E];T=T<S?S:T}return T}function f(b,T,E,S,w,P,O,B,L){var _=n.exports.sbrk,C=_(4),v=_(E*4),I=_(w*P),M=_(E*4),N=new Uint8Array(n.exports.memory.buffer);N.set(a(S),I),N.set(a(T),M);var j=b(v,M,E,I,w,P,O,B,L,C);N=new Uint8Array(n.exports.memory.buffer);var k=new Uint32Array(j);a(k).set(N.subarray(v,v+j*4));var V=new Float32Array(1);return a(V).set(N.subarray(C,C+4)),_(C-_(0)),[k,V[0]]}function d(b,T,E,S,w,P,O,B,L,_,C,v,I){var M=n.exports.sbrk,N=M(4),j=M(E*4),k=M(w*P),V=M(w*B),F=M(L.length*4),W=M(E*4),q=_?M(w):0,J=new Uint8Array(n.exports.memory.buffer);J.set(a(S),k),J.set(a(O),V),J.set(a(L),F),J.set(a(T),W),_&&J.set(a(_),q);var H=b(j,W,E,k,w,P,V,B,F,L.length,q,C,v,I,N);J=new Uint8Array(n.exports.memory.buffer);var Z=new Uint32Array(H);a(Z).set(J.subarray(j,j+H*4));var K=new Float32Array(1);return a(K).set(J.subarray(N,N+4)),M(N-M(0)),[Z,K[0]]}function p(b,T,E,S,w,P,O,B,L,_,C,v,I){var M=n.exports.sbrk,N=M(4),j=M(w*P),k=M(w*B),V=M(L.length*4),F=M(E*4),W=_?M(w):0,q=new Uint8Array(n.exports.memory.buffer);q.set(a(S),j),q.set(a(O),k),q.set(a(L),V),q.set(a(T),F),_&&q.set(a(_),W);var J=b(F,E,j,w,P,k,B,V,L.length,W,C,v,I,N);q=new Uint8Array(n.exports.memory.buffer),a(T).set(q.subarray(F,F+J*4)),a(S).set(q.subarray(j,j+w*P)),a(O).set(q.subarray(k,k+w*B));var H=new Float32Array(1);return a(H).set(q.subarray(N,N+4)),M(N-M(0)),[J,H[0]]}function g(b,T,E,S){var w=n.exports.sbrk,P=w(E*S),O=new Uint8Array(n.exports.memory.buffer);O.set(a(T),P);var B=b(P,E,S);return w(P-w(0)),B}function m(b,T,E,S,w,P,O,B){var L=n.exports.sbrk,_=L(B*4),C=L(E*S),v=w?L(E*P):0,I=new Uint8Array(n.exports.memory.buffer);I.set(a(T),C),w&&I.set(a(w),v);var M=b(_,C,E,S,v,P,O,B);I=new Uint8Array(n.exports.memory.buffer);var N=new Uint32Array(M);return a(N).set(I.subarray(_,_+M*4)),L(_-L(0)),N}function A(b,T,E,S,w,P,O,B,L){var _=n.exports.sbrk,C=_(4),v=_(E*4),I=_(w*P),M=_(E*4),N=O?_(w):0,j=new Uint8Array(n.exports.memory.buffer);j.set(a(S),I),j.set(a(T),M),O&&j.set(a(O),N);var k=b(v,M,E,I,w,P,N,B,L,C);j=new Uint8Array(n.exports.memory.buffer);var V=new Uint32Array(k);a(V).set(j.subarray(v,v+k*4));var F=new Float32Array(1);return a(F).set(j.subarray(C,C+4)),_(C-_(0)),[V,F[0]]}function y(b,T,E,S,w,P,O){var B=n.exports.sbrk,L=B(E*4),_=B(w*P),C=B(E*4),v=new Uint8Array(n.exports.memory.buffer);v.set(a(S),_),v.set(a(T),C);var I=b(L,C,E,_,w,P,O);v=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(I);return a(M).set(v.subarray(L,L+I*4)),B(L-B(0)),M}var x={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(b){r(b instanceof Uint32Array||b instanceof Int32Array||b instanceof Uint16Array||b instanceof Int16Array),r(b.length%3==0);var T=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b),E=c(n.exports.meshopt_optimizeVertexFetchRemap,T,u(b)+1);if(b!==T)for(var S=0;S<T.length;++S)b[S]=T[S];return E},generatePositionRemap:function(b,T){return r(b instanceof Float32Array),r(b.length%T==0),r(T>=3),s(n.exports.meshopt_generatePositionRemap,b,b.length/T,T)},simplify:function(b,T,E,S,w,P){r(b instanceof Uint32Array||b instanceof Int32Array||b instanceof Uint16Array||b instanceof Int16Array),r(b.length%3==0),r(T instanceof Float32Array),r(T.length%E==0),r(E>=3),r(S>=0&&S<=b.length),r(S%3==0),r(w>=0);for(var O=0,B=0;B<(P?P.length:0);++B)r(P[B]in x),O|=x[P[B]];var L=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b),_=f(n.exports.meshopt_simplify,L,b.length,T,T.length/E,E*4,S,w,O);return _[0]=b instanceof Uint32Array?_[0]:new b.constructor(_[0]),_},simplifyWithAttributes:function(b,T,E,S,w,P,O,B,L,_){r(b instanceof Uint32Array||b instanceof Int32Array||b instanceof Uint16Array||b instanceof Int16Array),r(b.length%3==0),r(T instanceof Float32Array),r(T.length%E==0),r(E>=3),r(S instanceof Float32Array),r(S.length==w*(T.length/E)),r(w>=0),r(O==null||O instanceof Uint8Array),r(O==null||O.length==T.length/E),r(B>=0&&B<=b.length),r(B%3==0),r(L>=0),r(Array.isArray(P)),r(w>=P.length),r(P.length<=32);for(var C=0;C<P.length;++C)r(P[C]>=0);for(var v=0,C=0;C<(_?_.length:0);++C)r(_[C]in x),v|=x[_[C]];var I=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b),M=d(n.exports.meshopt_simplifyWithAttributes,I,b.length,T,T.length/E,E*4,S,w*4,new Float32Array(P),O,B,L,v);return M[0]=b instanceof Uint32Array?M[0]:new b.constructor(M[0]),M},simplifyWithUpdate:function(b,T,E,S,w,P,O,B,L,_){r(b instanceof Uint32Array||b instanceof Int32Array||b instanceof Uint16Array||b instanceof Int16Array),r(b.length%3==0),r(T instanceof Float32Array),r(T.length%E==0),r(E>=3),r(S instanceof Float32Array),r(S.length==w*(T.length/E)),r(w>=0),r(O==null||O instanceof Uint8Array),r(O==null||O.length==T.length/E),r(B>=0&&B<=b.length),r(B%3==0),r(L>=0),r(Array.isArray(P)),r(w>=P.length),r(P.length<=32);for(var C=0;C<P.length;++C)r(P[C]>=0);for(var v=0,C=0;C<(_?_.length:0);++C)r(_[C]in x),v|=x[_[C]];var I=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b),M=p(n.exports.meshopt_simplifyWithUpdate,I,b.length,T,T.length/E,E*4,S,w*4,new Float32Array(P),O,B,L,v);if(b!==I)for(var C=0;C<M[0];++C)b[C]=I[C];return M},getScale:function(b,T){return r(b instanceof Float32Array),r(b.length%T==0),r(T>=3),g(n.exports.meshopt_simplifyScale,b,b.length/T,T*4)},simplifyPoints:function(b,T,E,S,w,P){return r(b instanceof Float32Array),r(b.length%T==0),r(T>=3),r(E>=0&&E<=b.length/T),S?(r(S instanceof Float32Array),r(S.length%w==0),r(w>=3),r(b.length/T==S.length/w),m(n.exports.meshopt_simplifyPoints,b,b.length/T,T*4,S,w*4,P||0,E)):m(n.exports.meshopt_simplifyPoints,b,b.length/T,T*4,void 0,0,0,E)},simplifySloppy:function(b,T,E,S,w,P){r(b instanceof Uint32Array||b instanceof Int32Array||b instanceof Uint16Array||b instanceof Int16Array),r(b.length%3==0),r(T instanceof Float32Array),r(T.length%E==0),r(E>=3),r(S==null||S instanceof Uint8Array),r(S==null||S.length==T.length/E),r(w>=0&&w<=b.length),r(w%3==0),r(P>=0);var O=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b),B=A(n.exports.meshopt_simplifySloppy,O,b.length,T,T.length/E,E*4,S,w,P);return B[0]=b instanceof Uint32Array?B[0]:new b.constructor(B[0]),B},simplifyPrune:function(b,T,E,S){r(b instanceof Uint32Array||b instanceof Int32Array||b instanceof Uint16Array||b instanceof Int16Array),r(b.length%3==0),r(T instanceof Float32Array),r(T.length%E==0),r(E>=3),r(S>=0);var w=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b),P=y(n.exports.meshopt_simplifyPrune,w,b.length,T,T.length/E,E*4,S);return P=b instanceof Uint32Array?P:new b.constructor(P),P}}})();var Amn=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgzaBa81:tg8Xa80a8Z:tg8YNaUa83:tg8Za8XNa8Za8YNMMUdbazaYfaPId8KaPIdC:tg8XaPIdyaPIdK:tg8YNaPIdaaPIdz:tg8Za8XNa8Za8YNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",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(A){n=A.instance,n.exports.__wasm_call_ctors()});function o(A){for(var y=new Uint8Array(A.length),x=0;x<A.length;++x){var b=A.charCodeAt(x);y[x]=b>96?b-97:b>64?b-39:b+4}for(var T=0,x=0;x<A.length;++x)y[T++]=y[x]<60?t[y[x]]:(y[x]-60)*64+y[++x];return y.buffer.slice(0,T)}function r(A){if(!A)throw new Error("Assertion failed")}function a(A){return new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}var s=48,c=16;function u(A,y){var x=A.meshlets[y*4+0],b=A.meshlets[y*4+1],T=A.meshlets[y*4+2],E=A.meshlets[y*4+3];return{vertices:A.vertices.subarray(x,x+T),triangles:A.triangles.subarray(b,b+E*3)}}function f(A,y,x,b,T,E,S,w,P,O){var B=n.exports.sbrk,L=n.exports.meshopt_buildMeshletsBound(y.length,E,S),_=B(L*c),C=B(y.length*4),v=B(y.length),I=B(y.byteLength),M=B(x.byteLength),N=new Uint8Array(n.exports.memory.buffer);N.set(a(y),I),N.set(a(x),M);var j=A(_,C,v,I,y.length,M,b,T,E,S,w,P,O);N=new Uint8Array(n.exports.memory.buffer);for(var k=N.subarray(_,_+j*c),V=new Uint32Array(k.buffer,k.byteOffset,k.byteLength/4).slice(),F=0;F<j;++F){var W=V[F*4+0],q=V[F*4+1],b=V[F*4+2],J=V[F*4+3];n.exports.meshopt_optimizeMeshlet(C+W*4,v+q,J,b)}var H=j?V[(j-1)*4+0]+V[(j-1)*4+2]:0,Z=j?V[(j-1)*4+1]+V[(j-1)*4+3]*3:0,K={meshlets:V,vertices:new Uint32Array(N.buffer,C,H).slice(),triangles:new Uint8Array(N.buffer,v,Z).slice(),meshletCount:j};return B(_-B(0)),K}function d(A){var y=new Float32Array(n.exports.memory.buffer,A,s/4);return{centerX:y[0],centerY:y[1],centerZ:y[2],radius:y[3],coneApexX:y[4],coneApexY:y[5],coneApexZ:y[6],coneAxisX:y[7],coneAxisY:y[8],coneAxisZ:y[9],coneCutoff:y[10]}}function p(A,y,x,b){var T=n.exports.sbrk,E=[],S=T(y.byteLength),w=T(A.vertices.byteLength),P=T(A.triangles.byteLength),O=T(s),B=new Uint8Array(n.exports.memory.buffer);B.set(a(y),S),B.set(a(A.vertices),w),B.set(a(A.triangles),P);for(var L=0;L<A.meshletCount;++L){var _=A.meshlets[L*4+0],C=A.meshlets[L*4+1],v=A.meshlets[L*4+3];n.exports.meshopt_computeMeshletBounds(O,w+_*4,P+C,v,S,x,b),E.push(d(O))}return T(S-T(0)),E}function g(A,y,x,b){var T=n.exports.sbrk,E=T(s),S=T(A.byteLength),w=T(y.byteLength),P=new Uint8Array(n.exports.memory.buffer);P.set(a(A),S),P.set(a(y),w),n.exports.meshopt_computeClusterBounds(E,S,A.length,w,x,b);var O=d(E);return T(E-T(0)),O}function m(A,y,x,b,T){var E=n.exports.sbrk,S=E(s),w=E(A.byteLength),P=b?E(b.byteLength):0,O=new Uint8Array(n.exports.memory.buffer);O.set(a(A),w),b&&O.set(a(b),P),n.exports.meshopt_computeSphereBounds(S,w,y,x,P,b?T:0);var B=d(S);return E(S-E(0)),B}return{ready:i,supported:!0,buildMeshlets:function(A,y,x,b,T,E){r(A.length%3==0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),r(b>=3&&b<=256),r(T>=1&&T<=512),E=E||0;var S=A.BYTES_PER_ELEMENT==4?A:new Uint32Array(A);return f(n.exports.meshopt_buildMeshletsFlex,S,y,y.length/x,x*4,b,T,T,E,0)},buildMeshletsFlex:function(A,y,x,b,T,E,S,w){r(A.length%3==0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),r(b>=3&&b<=256),r(T>=1&&E<=512),r(T<=E),S=S||0,w=w||0;var P=A.BYTES_PER_ELEMENT==4?A:new Uint32Array(A);return f(n.exports.meshopt_buildMeshletsFlex,P,y,y.length/x,x*4,b,T,E,S,w)},buildMeshletsSpatial:function(A,y,x,b,T,E,S){r(A.length%3==0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),r(b>=3&&b<=256),r(T>=1&&E<=512),r(T<=E),S=S||0;var w=A.BYTES_PER_ELEMENT==4?A:new Uint32Array(A);return f(n.exports.meshopt_buildMeshletsSpatial,w,y,y.length/x,x*4,b,T,E,S)},extractMeshlet:function(A,y){return r(y>=0&&y<A.meshletCount),u(A,y)},computeClusterBounds:function(A,y,x){r(A.length%3==0),r(A.length/3<=512),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3);var b=A.BYTES_PER_ELEMENT==4?A:new Uint32Array(A);return g(b,y,y.length/x,x*4)},computeMeshletBounds:function(A,y,x){return r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),p(A,y,y.length/x,x*4)},computeSphereBounds:function(A,y,x,b){return r(A instanceof Float32Array),r(A.length%y==0),r(y>=3),r(!x||x instanceof Float32Array),r(!x||x.length%b==0),r(!x||b>=1),r(!x||A.length/y==x.length/b),b=b||0,m(A,A.length/y,y*4,x,b*4)}}})();var Kq=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.bufferViewId,r=t.gltfResource,a=t.baseResource,s=t.cacheKey,c=i.bufferViews[o],u=c.buffer,f=c.byteOffset,d=c.byteLength,p=!1,g,m,A,y;if(vi(c,"EXT_meshopt_compression")){let b=c.extensions.EXT_meshopt_compression;u=b.buffer,f=b.byteOffset??0,d=b.byteLength,p=!0,g=b.byteStride,m=b.count,A=b.mode,y=b.filter??"NONE"}let x=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=g,this._meshoptCount=m,this._meshoptMode=A,this._meshoptFilter=y,this._resourceCache=n,this._gltfResource=r,this._baseResource=a,this._buffer=x,this._bufferId=u,this._byteOffset=f,this._byteLength=d,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=l6e(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function l6e(e){try{let t=u6e(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,a=new Uint8Array(o*r);S_.decodeGltfBuffer(a,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=a}return e._state=gt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load buffer view",t)}}function u6e(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var qI=Kq;var ox=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new Wn("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new re("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};ox._maxDecodingConcurrency=Math.max(cn.hardwareConcurrency-1,1);ox._decoderTaskProcessor=void 0;ox._taskProcessorReady=!1;ox._error=void 0;var w_=ox;var In={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function f6e(e){switch(e){case In.POSITION:return"positionMC";case In.NORMAL:return"normalMC";case In.TANGENT:return"tangentMC";case In.TEXCOORD:return"texCoord";case In.COLOR:return"color";case In.JOINTS:return"joints";case In.WEIGHTS:return"weights";case In.FEATURE_ID:return"featureId";case In.SCALE:return"scale";case In.ROTATION:return"rotation";case In.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}In.hasSetIndex=function(e){switch(e){case In.POSITION:case In.NORMAL:case In.TANGENT:case In.CUMULATIVE_DISTANCE:return!1;case In.TEXCOORD:case In.COLOR:case In.JOINTS:case In.WEIGHTS:case In.FEATURE_ID:case In.SCALE:case In.ROTATION:return!0}};In.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return In.POSITION;case"NORMAL":return In.NORMAL;case"TANGENT":return In.TANGENT;case"TEXCOORD":return In.TEXCOORD;case"COLOR":return In.COLOR;case"JOINTS":return In.JOINTS;case"WEIGHTS":return In.WEIGHTS;case"_FEATURE_ID":return In.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return In.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return In.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return In.CUMULATIVE_DISTANCE}};In.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return In.POSITION;case"RGBA":case"RGB":case"RGB565":return In.COLOR;case"NORMAL":case"NORMAL_OCT16P":return In.NORMAL;case"BATCH_ID":return In.FEATURE_ID}};In.getGlslType=function(e){switch(e){case In.POSITION:case In.NORMAL:case In.TANGENT:return"vec3";case In.TEXCOORD:return"vec2";case In.COLOR:return"vec4";case In.JOINTS:return"ivec4";case In.WEIGHTS:return"vec4";case In.FEATURE_ID:return"int";case In.SCALE:return"vec3";case In.ROTATION:return"vec4";case In.CUMULATIVE_DISTANCE:return"float";case In.OPACITY:return"float"}};In.getVariableName=function(e,t){let n=f6e(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(In);var it=In;var Qq=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.draco,a=t.gltfResource,s=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=a,this._baseResource=s,this._gltf=i,this._primitive=o,this._draco=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=gt.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=d6e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(l(this._dracoError)&&Aue(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,o=this._gltf,r=o.bufferViews,a=n.bufferView,s=r[a],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let g=m6e(p);l(g)&&o.accessors[i.attributes[p]].componentType===Y.FLOAT&&(u.includes(g)||u.push(g))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},d=w_.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=h6e(this,d)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function d6e(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=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Aue(e,n)}}function Aue(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load Draco",t)}async function h6e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var rx={};rx[it.POSITION]="POSITION";rx[it.NORMAL]="NORMAL";rx[it.COLOR]="COLOR";rx[it.TEXCOORD]="TEX_COORD";function m6e(e){for(let t in rx)if(rx.hasOwnProperty(t)&&e.startsWith(t))return rx[t]}var YI=Qq;function p6e(e){let{uint8Array:t,format:n,request:i}=e,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1,a=new Blob([t],{type:n}),s;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(a,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(s=window.URL.createObjectURL(a),new De({url:s,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(s)&&window.URL.revokeObjectURL(s),c}).catch(function(c){return l(s)&&window.URL.revokeObjectURL(s),Promise.reject(c)})}var I_=p6e;var XI=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.imageId,r=t.gltfResource,a=t.baseResource,s=t.cacheKey,c=i.images[o],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=r,this._baseResource=a,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=g6e(this),this._promise):(this._promise=_6e(this),this._promise)}unload(){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}};function yue(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 g6e(e){e._state=gt.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 y6e(i);if(e.isDestroyed())return;let r=yue(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(n){return e.isDestroyed()?void 0:xue(e,n,"Failed to load embedded image")}}async function _6e(e){e._state=gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await b6e(i);if(e.isDestroyed())return;let r=yue(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(o){return e.isDestroyed()?void 0:xue(e,o,`Failed to load image: ${n}`)}}function xue(e,t,n){return e.unload(),e._state=gt.FAILED,Promise.reject(e.getError(n,t))}function A6e(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 re("Image format is not recognized")}async function y6e(e){let t=A6e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Hu(n)}return XI._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var x6e=/(^data:image\/ktx2)|(\.ktx2$)/i;function b6e(e){let t=e.getUrlComponent(!1,!0);return x6e.test(t)?Hu(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}XI._loadImageFromTypedArray=I_;var KI=XI;var bue={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(bue);var Yc=bue;var $q=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.accessorId,r=t.gltfResource,a=t.baseResource,s=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,d=t.loadBuffer??!1,p=t.loadTypedArray??!1,g=i.accessors[o].componentType;this._resourceCache=n,this._gltfResource=r,this._baseResource=a,this._gltf=i,this._accessorId=o,this._indexDatatype=g,this._primitive=s,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=C6e(this),this._promise):(this._promise=E6e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=Y.fromTypedArray(n),this._indexDatatype=i)}catch(r){Zq(this,r)}if(!l(n))return!1;let o;if(this._loadBuffer&&this._asynchronous){let r=T6e;if(r.set(n,i,t.context),!t.jobScheduler.execute(r,Yc.BUFFER))return!1;o=r.buffer}else this._loadBuffer&&(o=Tue(n,i,t.context));return this.unload(),this._buffer=o,this._typedArray=this._loadTypedArray?n:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}},Jq=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=Tue(this.typedArray,this.indexDatatype,this.context)}};function Tue(e,t,n){let i=Ke.createIndexBuffer({typedArray:e,context:n,usage:Oe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var T6e=new Jq;async function C6e(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;Zq(e,n)}}async function E6e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=gt.LOADING;let r=e._resourceCache;try{let a=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=a,await a.load(),e.isDestroyed())return;let s=a.typedArray;return e._typedArray=v6e(e,s),e._state=gt.PROCESSING,e}catch(a){if(e.isDestroyed())return;Zq(e,a)}}function v6e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,a=o.componentType,s=Ue.getSizeInBytes(a),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%s!==0){let d=r*s,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Hs("index-buffer-unaligned",`The index array is not aligned to a ${s}-byte boundary.`)}let f;return a===Ue.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):a===Ue.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):a===Ue.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function Zq(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load index buffer",t)}var QI=$q;function S6e(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Ss=S6e;function w6e(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Hr=w6e;function Zt(){}Zt.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}}};Zt.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}}};Zt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Zt.objectLegacy(i,n):Zt.object(i,n)};Zt.accessor=function(e,t){return Zt.topLevel(e,"accessors",t)};Zt.accessorWithSemantic=function(e,t,n){let i={};return Zt.mesh(e,function(o){return Zt.meshPrimitive(o,function(r){let a=Zt.meshPrimitiveAttribute(r,function(s,c){if(c.indexOf(t)===0&&!l(i[s])){i[s]=!0;let u=n(s);if(l(u))return u}});return l(a)?a:Zt.meshPrimitiveTarget(r,function(s){return Zt.meshPrimitiveTargetAttribute(s,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};Zt.accessorContainingVertexAttributeData=function(e,t){let n={};return Zt.mesh(e,function(i){return Zt.meshPrimitive(i,function(o){let r=Zt.meshPrimitiveAttribute(o,function(a){if(!l(n[a])){n[a]=!0;let s=t(a);if(l(s))return s}});return l(r)?r:Zt.meshPrimitiveTarget(o,function(a){return Zt.meshPrimitiveTargetAttribute(a,function(s){if(!l(n[s])){n[s]=!0;let c=t(s);if(l(c))return c}})})})})};Zt.accessorContainingIndexData=function(e,t){let n={};return Zt.mesh(e,function(i){return Zt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let a=t(r);if(l(a))return a}})})};Zt.animation=function(e,t){return Zt.topLevel(e,"animations",t)};Zt.animationChannel=function(e,t){let n=e.channels;return Zt.object(n,t)};Zt.animationSampler=function(e,t){let n=e.samplers;return Zt.object(n,t)};Zt.buffer=function(e,t){return Zt.topLevel(e,"buffers",t)};Zt.bufferView=function(e,t){return Zt.topLevel(e,"bufferViews",t)};Zt.camera=function(e,t){return Zt.topLevel(e,"cameras",t)};Zt.image=function(e,t){return Zt.topLevel(e,"images",t)};Zt.material=function(e,t){return Zt.topLevel(e,"materials",t)};Zt.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}};Zt.mesh=function(e,t){return Zt.topLevel(e,"meshes",t)};Zt.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],a=t(r,o);if(l(a))return a}}};Zt.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}};Zt.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}}};Zt.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}};Zt.node=function(e,t){return Zt.topLevel(e,"nodes",t)};Zt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let a=t[r],s=i[a];if(l(s)){let c=n(s,a);if(l(c))return c;let u=s.children;if(l(u)&&(c=Zt.nodeInTree(e,u,n),l(c)))return c}}}};Zt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Zt.nodeInTree(e,i,n)};Zt.program=function(e,t){return Hr(e,"KHR_techniques_webgl")?Zt.object(e.extensions.KHR_techniques_webgl.programs,t):Zt.topLevel(e,"programs",t)};Zt.sampler=function(e,t){return Zt.topLevel(e,"samplers",t)};Zt.scene=function(e,t){return Zt.topLevel(e,"scenes",t)};Zt.shader=function(e,t){return Hr(e,"KHR_techniques_webgl")?Zt.object(e.extensions.KHR_techniques_webgl.shaders,t):Zt.topLevel(e,"shaders",t)};Zt.skin=function(e,t){return Zt.topLevel(e,"skins",t)};Zt.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],a=t(r);if(l(a))return a}}};Zt.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}};Zt.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}};Zt.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}};Zt.technique=function(e,t){return Hr(e,"KHR_techniques_webgl")?Zt.object(e.extensions.KHR_techniques_webgl.techniques,t):Zt.topLevel(e,"techniques",t)};Zt.texture=function(e,t){return Zt.topLevel(e,"textures",t)};var Fe=Zt;function I6e(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 Zf=I6e;function D6e(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 Y.getSizeInBytes(t.componentType)*Zf(t.type)}var Ju=D6e;function P6e(e){Fe.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Fe.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Fe.mesh(e,function(n){Fe.meshPrimitive(n,function(i){if(i.mode=i.mode??ee.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Ss(e.materials,o)}})}),Fe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,l(o)){let r=e.bufferViews[o];r.byteStride=Ju(e,i),r.target=ee.ARRAY_BUFFER}}),Fe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ee.ELEMENT_ARRAY_BUFFER}}),Fe.material(e,function(n){let i=n.extensions??{},o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;l(r)&&Fe.materialValue(n,function(c){l(c.index)&&ax(c)}),ax(n.emissiveTexture),ax(n.normalTexture),ax(n.occlusionTexture);let a=n.pbrMetallicRoughness;l(a)&&(a.baseColorFactor=a.baseColorFactor??[1,1,1,1],a.metallicFactor=a.metallicFactor??1,a.roughnessFactor=a.roughnessFactor??1,ax(a.baseColorTexture),ax(a.metallicRoughnessTexture));let s=i.KHR_materials_pbrSpecularGlossiness;l(s)&&(s.diffuseFactor=s.diffuseFactor??[1,1,1,1],s.specularFactor=s.specularFactor??[1,1,1],s.glossinessFactor=s.glossinessFactor??1,ax(s.specularGlossinessTexture))}),Fe.animation(e,function(n){Fe.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=R6e(e);return Fe.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),Fe.sampler(e,function(n){n.wrapS=n.wrapS??ee.REPEAT,n.wrapT=n.wrapT??ee.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function R6e(e){let t={};return Fe.animation(e,function(n){Fe.animationChannel(n,function(i){let o=i.target,r=o.node,a=o.path;(a==="translation"||a==="rotation"||a==="scale")&&(t[r]=!0)})}),t}function ax(e){l(e)&&(e.texCoord=e.texCoord??0)}var KF=P6e;function O6e(e){return Fe.shader(e,function(t){QF(t)}),Fe.buffer(e,function(t){QF(t)}),Fe.image(e,function(t){QF(t)}),QF(e),e}function QF(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var sx=O6e;function M6e(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 $F=M6e;function B6e(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),$F(e,t),n.length===0&&delete e.extensionsUsed}}var kC=B6e;var L6e=4;function N6e(e){if(Um(e)!=="glTF")throw new re("File is not valid binary glTF");let n=Cue(e,0,5),i=n[1];if(i!==1&&i!==2)throw new re("Binary glTF version is not 1 or 2");return i===1?F6e(e,n):k6e(e,n)}function Cue(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*L6e,!0);return o}function F6e(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new re("Binary glTF scene format is not JSON");let r=20,a=r+i,s=Ku(e,r,i),c=JSON.parse(s);sx(c);let u=e.subarray(a,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return kC(c,"KHR_binary_glTF"),c}function k6e(e,t){let n=t[2],i=12,o,r;for(;i<n;){let a=Cue(e,i,2),s=a[0],c=a[1];i+=8;let u=e.subarray(i,i+s);if(i+=s,c===1313821514){let f=Ku(u);o=JSON.parse(f),sx(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let a=o.buffers;if(l(a)&&a.length>0){let s=a[0];s.extras._pipeline.source=r}}return o}var zC=N6e;function z6e(e){return Fe.shader(e,function(t){JF(t)}),Fe.buffer(e,function(t){JF(t)}),Fe.image(e,function(t){JF(t)}),JF(e),e}function JF(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var ZF=z6e;function U6e(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Ss(n,t,!0)}var ph=U6e;function V6e(e){switch(e){case Y.BYTE:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getInt8(n+a*o)};case Y.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getUint8(n+a*o)};case Y.SHORT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getInt16(n+a*o,!0)};case Y.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getUint16(n+a*o,!0)};case Y.INT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getInt32(n+a*o,!0)};case Y.UNSIGNED_INT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getUint32(n+a*o,!0)};case Y.FLOAT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getFloat32(n+a*o,!0)};case Y.DOUBLE:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getFloat64(n+a*o,!0)}}}var D_=V6e;function j6e(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Zf(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let a=new Array(r).fill(Number.POSITIVE_INFINITY),s=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=Ju(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,A=t.componentType,y=Y.getSizeInBytes(A),x=new DataView(d.buffer),b=new Array(r),T=D_(A);for(let E=0;E<p;E++){T(x,m,r,y,b);for(let S=0;S<r;S++){let w=b[S];a[S]=Math.min(a[S],w),s[S]=Math.max(s[S],w)}m+=g}return{min:a,max:s}}var UC=j6e;var G6e=[ee.FUNC_ADD,ee.FUNC_ADD],H6e=[ee.ONE,ee.ZERO,ee.ONE,ee.ZERO];function Eue(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var W6e=[ee.ZERO,ee.ONE,ee.SRC_COLOR,ee.ONE_MINUS_SRC_COLOR,ee.SRC_ALPHA,ee.ONE_MINUS_SRC_ALPHA,ee.DST_ALPHA,ee.ONE_MINUS_DST_ALPHA,ee.DST_COLOR,ee.ONE_MINUS_DST_COLOR];function q6e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(W6e.indexOf(e[n])===-1)return t;return e}function Y6e(e){let t={},n={},i=e.techniques;return l(i)&&(Fe.technique(e,function(o,r){let a=o.states;if(l(a)){let s=n[r]={};if(Eue(a,ee.BLEND)){s.alphaMode="BLEND";let c=a.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??G6e,blendFactors:q6e(c.blendFuncSeparate,H6e)})}Eue(a,ee.CULL_FACE)||(s.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),ph(e,"KHR_blend")),Fe.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Fe.objectLegacy(r,function(s,c){o[c]=s});let a=t[o.technique];l(a)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=a)}})),e}var e2=Y6e;function X6e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Ss(n,t,!0),ph(e,t)}var t2=X6e;function K6e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},a=e.glExtensionsUsed;delete e.glExtensionsUsed,Fe.technique(e,function(s,c){let u={name:s.name,program:void 0,attributes:{},uniforms:{}},f;if(Fe.techniqueAttribute(s,function(d,p){f=s.parameters[d],u.attributes[p]={semantic:f.semantic}}),Fe.techniqueUniform(s,function(d,p){f=s.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(o[s.program]))u.program=o[s.program];else{let d=e.programs[s.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:a},g=e.shaders[d.fragmentShader];p.fragmentShader=Ss(r.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Ss(r.shaders,m,!0),u.program=Ss(r.programs,p),o[s.program]=u.program}i[c]=Ss(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,ph(e,"KHR_techniques_webgl"),t2(e,"KHR_techniques_webgl"))}return Fe.material(e,function(r){if(l(r.technique)){let a={technique:i[r.technique]};Fe.objectLegacy(r.values,function(s,c){l(a.values)||(a.values={});let u=n[r.technique][c];l(u)&&(a.values[u]=s)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=a}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var n2=K6e;function Q6e(e,t){No.typeOf.object("material",e),No.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,a=t(r.index,r);if(l(a))return a}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,a=t(r.index,r);if(l(a))return a}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let a=i.KHR_materials_specular;if(l(a)){let{specularTexture:c,specularColorTexture:u}=a;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let s=i.KHR_materials_common;if(l(s)&&l(s.values)){let{diffuse:c,ambient:u,emission:f,specular:d}=s.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(f)&&l(f.index)){let p=t(f.index,f);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}}}let o=Fe.materialValue(e,function(r){if(l(r.index)){let a=t(r.index,r);if(l(a))return a}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,a=t(r.index,r);if(l(a))return a}if(l(e.normalTexture)){let r=e.normalTexture,a=t(r.index,r);if(l(a))return a}if(l(e.occlusionTexture)){let r=e.occlusionTexture,a=t(r.index,r);if(l(a))return a}}var $I=Q6e;var vue=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function $6e(e,t){return t=t??vue,vue.forEach(function(n){t.indexOf(n)>-1&&Z6e(e,n)}),e}var J6e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function Z6e(e,t){let n=J6e[t],i=e[n];if(l(i)){let o=0,r=Gm[t](e),a=i.length;for(let s=0;s<a;++s)r[s]||(jm[t](e,s-o),o++)}}function jm(){}jm.accessor=function(e,t){e.accessors.splice(t,1),Fe.mesh(e,function(i){Fe.meshPrimitive(i,function(o){Fe.meshPrimitiveAttribute(o,function(s,c){s>t&&o.attributes[c]--}),Fe.meshPrimitiveTarget(o,function(s){Fe.meshPrimitiveTargetAttribute(s,function(c,u){c>t&&s[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let a=o.extensions;l(a)&&l(a.CESIUM_primitive_outline)&&a.CESIUM_primitive_outline.indices>t&&--a.CESIUM_primitive_outline.indices})}),Fe.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Fe.animation(e,function(i){Fe.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};jm.buffer=function(e,t){e.buffers.splice(t,1),Fe.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--})};jm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Fe.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Fe.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Fe.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Hr(e,"KHR_draco_mesh_compression")&&Fe.mesh(e,function(i){Fe.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--})}),Hr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let s=o[r].properties;if(l(s)){for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(Hr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let a=0;a<r;++a){let c=o[a].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};jm.image=function(e,t){e.images.splice(t,1),Fe.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})};jm.mesh=function(e,t){e.meshes.splice(t,1),Fe.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};jm.node=function(e,t){e.nodes.splice(t,1),Fe.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})}),Fe.animation(e,function(i){Fe.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Fe.technique(e,function(i){Fe.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Fe.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}))}),Fe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};jm.material=function(e,t){e.materials.splice(t,1),Fe.mesh(e,function(i){Fe.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};jm.sampler=function(e,t){e.samplers.splice(t,1),Fe.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};jm.texture=function(e,t){if(e.textures.splice(t,1),Fe.material(e,function(i){$I(i,function(o,r){r.index>t&&--r.index})}),Hr(e,"EXT_feature_metadata")){Fe.mesh(e,function(r){Fe.meshPrimitive(r,function(a){let s=a.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let u=s.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].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 s=o[r].properties;if(l(s)){for(let c in s)if(s.hasOwnProperty(c)){let f=s[c].texture;f.index>t&&--f.index}}}}if(Hr(e,"EXT_mesh_features")&&Fe.mesh(e,function(i){Fe.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let c=s.length;for(let u=0;u<c;++u){let f=s[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Hr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let a=0;a<r;++a){let c=o[a].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function Gm(){}Gm.accessor=function(e){let t={};return Fe.mesh(e,function(n){Fe.meshPrimitive(n,function(i){Fe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Fe.meshPrimitiveTarget(i,function(r){Fe.meshPrimitiveTargetAttribute(r,function(a){t[a]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Fe.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Fe.animation(e,function(n){Fe.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Hr(e,"EXT_mesh_gpu_instancing")&&Fe.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})}),Hr(e,"CESIUM_primitive_outline")&&Fe.mesh(e,function(n){Fe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let a=o.CESIUM_primitive_outline.indices;l(a)&&(t[a]=!0)}})}),t};Gm.buffer=function(e){let t={};return Fe.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};Gm.bufferView=function(e){let t={};if(Fe.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Fe.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Fe.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Hr(e,"KHR_draco_mesh_compression")&&Fe.mesh(e,function(n){Fe.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Hr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let a=i[o].properties;if(l(a)){for(let s in a)if(a.hasOwnProperty(s)){let c=a[s];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(Hr(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 s=i[r].properties;for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Gm.image=function(e){let t={};return Fe.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};Gm.mesh=function(e){let t={};return Fe.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 Sue(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!Sue(e,o,n)}).length===0}Gm.node=function(e){let t={};return Fe.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Fe.skinJoint(n,function(i){t[i]=!0})}),Fe.animation(e,function(n){Fe.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Fe.technique(e,function(n){Fe.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Fe.node(e,function(n,i){Sue(e,i,t)||(t[i]=!0)}),t};Gm.material=function(e){let t={};return Fe.mesh(e,function(n){Fe.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Gm.texture=function(e){let t={};if(Fe.material(e,function(n){$I(n,function(i){t[i]=!0})}),Hr(e,"EXT_feature_metadata")){Fe.mesh(e,function(o){Fe.meshPrimitive(o,function(r){let a=r.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let c=a.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let a=i[o].properties;if(l(a)){for(let s in a)if(a.hasOwnProperty(s)){let u=a[s].texture;t[u.index]=!0}}}}if(Hr(e,"EXT_mesh_features")&&Fe.mesh(e,function(n){Fe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let s=a.length;for(let c=0;c<s;++c){let u=a[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),Hr(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 s=i[r].properties;for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];t[u.index]=!0}}}}return t};Gm.sampler=function(e){let t={};return Fe.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var i2=$6e;function eHe(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 o2=eHe;function tHe(e,t){let n=Ju(e,t),i=Y.getSizeInBytes(t.componentType),o=Zf(t.type),r=t.count,a=new Array(o*r);if(!l(t.bufferView))return a.fill(0);let s=e.bufferViews[t.bufferView],c=e.buffers[s.buffer].extras._pipeline.source,u=t.byteOffset+s.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(o),p=D_(t.componentType);for(let g=0;g<r;++g){p(f,u,o,i,d);for(let m=0;m<o;++m)a[g*o+m]=d[m];u+=n}return a}var r2=tHe;function nHe(e){let t;return Fe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?a2(e,i,Y.UNSIGNED_BYTE):t!==ee.UNSIGNED_BYTE&&t!==ee.UNSIGNED_SHORT&&a2(e,i,Y.UNSIGNED_SHORT)}),Fe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?a2(e,i,Y.UNSIGNED_BYTE):t===ee.SHORT&&a2(e,i,Y.UNSIGNED_SHORT)}),e}function a2(e,t,n){let i=Y.createTypedArray(n,r2(e,t)),o=new Uint8Array(i.buffer);t.bufferView=o2(e,o),t.componentType=n,t.byteOffset=0}var s2=nHe;function iHe(e,t){return kC(e,t),t==="CESIUM_RTC"&&oHe(e),eY(e,t)}function oHe(e){Fe.technique(e,function(t){Fe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function eY(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)eY(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)&&eY(e[o],t);return i}}var VC=iHe;var c2={.8:uHe,"1.0":RHe,"2.0":void 0};function rHe(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(c2,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(c2,i)||(i="1.0"));let o=c2[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=c2[i];return t.keepLegacyExtensions||(BHe(e,t),LHe(e)),e}function Due(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 aHe(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 a=0;a<r;++a){let s=o[a],c=s.primitive??ee.TRIANGLES;s.mode=s.mode??c,delete s.primitive}}}}function sHe(e){let t=e.nodes,n=new h,i=new Le;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let s=r.rotation;h.fromArray(s,0,n),Le.fromAxisAngle(n,s[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let a=r.instanceSkin;l(a)&&(r.skeletons=a.skeletons,r.skin=a.skin,r.meshes=a.meshes,delete r.instanceSkin)}}function cHe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},a=new h,s=new Le;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let A=f[m];if(A.target.path==="rotation"){let y=d[p[A.sampler].output];if(l(r[y]))continue;r[y]=!0;let x=n[y],b=i[x.bufferView],E=o[b.buffer].extras._pipeline.source,S=E.byteOffset+b.byteOffset+x.byteOffset,w=x.componentType,P=x.count,O=Zf(x.type),B=x.count*O,L=Y.createArrayBufferView(w,E.buffer,S,B);for(let _=0;_<P;_++){let C=_*O;h.unpack(L,C,a);let v=L[C+3];Le.fromAxisAngle(a,v,s),Le.pack(s,L,C)}}}}}}function lHe(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=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(o,r)){let a=o[r],s=a.instanceProgram;i.attributes=i.attributes??s.attributes,i.program=i.program??s.program,i.uniforms=i.uniforms??s.uniforms,i.states=i.states??a.states}delete i.passes,delete i.pass}}}function uHe(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,Due(e),aHe(e),sHe(e),cHe(e),lHe(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,ph(e,"KHR_materials_common")}}function fHe(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 a in r)if(Object.prototype.hasOwnProperty.call(r,a)){let s=r[a];s.input=o[s.input],s.output=o[s.output]}delete i.parameters}}}function wue(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 dHe(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 a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i=r[a].jointName,l(i)&&(o[i]=a));for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&l(n[a])){let s={},c=e[a];e[a]=wue(c,s),n[a]=s}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]),Fe.bufferView(e,function(a){l(a.buffer)&&(a.buffer=n.buffers[a.buffer])}),Fe.accessor(e,function(a){l(a.bufferView)&&(a.bufferView=n.bufferViews[a.bufferView])}),Fe.shader(e,function(a){let s=a.extensions;if(l(s)){let c=s.KHR_binary_glTF;l(c)&&(a.bufferView=n.bufferViews[c.bufferView],delete s.KHR_binary_glTF),Object.keys(s).length===0&&delete a.extensions}}),Fe.program(e,function(a){l(a.vertexShader)&&(a.vertexShader=n.shaders[a.vertexShader]),l(a.fragmentShader)&&(a.fragmentShader=n.shaders[a.fragmentShader])}),Fe.technique(e,function(a){l(a.program)&&(a.program=n.programs[a.program]),Fe.techniqueParameter(a,function(s){l(s.node)&&(s.node=n.nodes[s.node]);let c=s.value;typeof c=="string"&&(s.value={index:n.textures[c]})})}),Fe.mesh(e,function(a){Fe.meshPrimitive(a,function(s){l(s.indices)&&(s.indices=n.accessors[s.indices]),Fe.meshPrimitiveAttribute(s,function(c,u){s.attributes[u]=n.accessors[c]}),l(s.material)&&(s.material=n.materials[s.material])})}),Fe.node(e,function(a){let s=a.children;if(l(s)){let c=s.length;for(t=0;t<c;++t)s[t]=n.nodes[s[t]]}if(l(a.meshes)){let c=a.meshes,u=c.length;if(u>0)for(a.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=Ss(e.nodes,f);l(s)||(s=[],a.children=s),s.push(d)}delete a.meshes}if(l(a.camera)&&(a.camera=n.cameras[a.camera]),l(a.skin)&&(a.skin=n.skins[a.skin]),l(a.skeletons)){let c=a.skeletons;if(c.length>0&&l(a.skin)){let f=e.skins[a.skin];f.skeleton=n.nodes[c[0]]}delete a.skeletons}l(a.jointName)&&delete a.jointName}),Fe.skin(e,function(a){l(a.inverseBindMatrices)&&(a.inverseBindMatrices=n.accessors[a.inverseBindMatrices]);let s=a.jointNames;if(l(s)){let c=[],u=s.length;for(t=0;t<u;++t)c[t]=o[s[t]];a.joints=c,delete a.jointNames}}),Fe.scene(e,function(a){let s=a.nodes;if(l(s)){let c=s.length;for(t=0;t<c;++t)s[t]=n.nodes[s[t]]}}),Fe.animation(e,function(a){let s={};a.samplers=wue(a.samplers,s),Fe.animationSampler(a,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Fe.animationChannel(a,function(c){c.sampler=s[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Fe.material(e,function(a){l(a.technique)&&(a.technique=n.techniques[a.technique]),Fe.materialValue(a,function(c,u){typeof c=="string"&&(a.values[u]={index:n.textures[c]})});let s=a.extensions;if(l(s)){let c=s.KHR_materials_common;l(c)&&l(c.values)&&Fe.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Fe.image(e,function(a){let s=a.extensions;if(l(s)){let c=s.KHR_binary_glTF;l(c)&&(a.bufferView=n.bufferViews[c.bufferView],a.mimeType=c.mimeType,delete s.KHR_binary_glTF),Object.keys(s).length===0&&delete a.extensions}}),Fe.texture(e,function(a){l(a.sampler)&&(a.sampler=n.samplers[a.sampler]),l(a.source)&&(a.source=n.images[a.source])})}function hHe(e){Fe.animation(e,function(t){Fe.animationSampler(t,function(n){delete n.name})})}function mHe(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]}Fe.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function pHe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var gHe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function _He(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(gHe[o])&&e.extensionsRequired.push(o)}}}function AHe(e){Fe.buffer(e,function(t){delete t.type})}function yHe(e){Fe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function xHe(e){Fe.mesh(e,function(t){Fe.meshPrimitive(t,function(n){Fe.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})}),Fe.technique(e,function(t){Fe.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var bHe={POSITION:!0,NORMAL:!0,TANGENT:!0},THe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function CHe(e){let t={};Fe.mesh(e,function(n){Fe.meshPrimitive(n,function(i){Fe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let a=r.search(/_[0-9]+/g),s=r,c="_0";a>=0&&(s=r.substring(0,a),c=r.substring(a));let u,f=THe[s];l(f)?(u=f+c,t[r]=u):l(bHe[s])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],a=i.attributes[o];l(a)&&(delete i.attributes[o],i.attributes[r]=a)}})}),Fe.technique(e,function(n){Fe.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function EHe(e){Fe.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 nY(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Ju(e,t)}function vHe(e){Fe.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Fe.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=nY(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function SHe(e){let t,n,i,o=e.bufferViews,r={};Fe.accessorContainingVertexAttributeData(e,function(s){let c=e.accessors[s];l(c.bufferView)&&(r[c.bufferView]=!0)});let a={};Fe.accessor(e,function(s){l(s.bufferView)&&(a[s.bufferView]=a[s.bufferView]??[],a[s.bufferView].push(s))});for(let s in a)if(Object.prototype.hasOwnProperty.call(a,s)){i=o[s];let c=a[s];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=nY(e,p),m=p.byteOffset,A=p.count*g;delete p.byteStride;let y=t<d-1,x=y?nY(e,c[t+1]):void 0;if(g!==x){let b=qe(i,!0);r[s]&&(b.byteStride=g),b.byteOffset+=u,b.byteLength=m+A-u;let T=Ss(o,b);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=y?c[t+1].byteOffset:void 0,f=t+1}}}i2(e,["accessor","bufferView","buffer"])}function wHe(e){Fe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=UC(e,n);n.min=i.min,n.max=i.max}})}function Pue(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)||R.fromColumnMajorArray(e.matrix).equals(R.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Rue(e,t){Fe.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}}}),Fe.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Pue(n)&&Rue(e,i))}}),delete e.nodes[t]}function IHe(e){return Fe.node(e,function(t,n){Pue(t)&&Rue(e,n)}),e}function DHe(e){Fe.animation(e,function(t){Fe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=UC(e,i);i.min=o.min,i.max=o.max}})})}function PHe(e){Fe.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=UC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function RHe(e){e.asset=e.asset??{},e.asset.version="2.0",Due(e),fHe(e),IHe(e),dHe(e),hHe(e),pHe(e),_He(e),vHe(e),SHe(e),wHe(e),DHe(e),PHe(e),AHe(e),yHe(e),xHe(e),CHe(e),s2(e),EHe(e),e2(e),n2(e),mHe(e)}var OHe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],MHe=["u_diffuse","u_diffuse_mat"];function iY(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function oY(e){return l(e.index)}function rY(e){return Array.isArray(e)&&e.length===4}function Oue(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 BHe(e,t){t=t??{};let n=t.baseColorTextureNames??OHe,i=t.baseColorFactorNames??MHe;Fe.material(e,function(o){Fe.materialValue(o,function(r,a){n.indexOf(a)!==-1&&oY(r)?(iY(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(a)!==-1&&rY(r)&&(iY(o),o.pbrMetallicRoughness.baseColorFactor=Oue(r))})}),VC(e,"KHR_techniques_webgl"),VC(e,"KHR_blend")}function tY(e,t){l(t)&&(rY(t)?e.pbrMetallicRoughness.baseColorFactor=Oue(t):oY(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Iue(e,t){l(t)&&(rY(t)?e.emissiveFactor=t.slice(0,3):oY(t)&&(e.emissiveTexture=t))}function LHe(e){Fe.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,a=i.emission,s=i.transparency,c=n.doubleSided,u=n.transparent;iY(t),n.technique==="CONSTANT"?(ph(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},tY(t,a),tY(t,o)):(tY(t,r),Iue(t,o),Iue(t,a)),l(c)&&(t.doubleSided=c),l(s)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=s:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,s]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),VC(e,"KHR_materials_common")}var l2=rHe;function Xc(){}Xc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
  5618. ${n.message}`);let o=new re(i);return l(n)&&(o.stack=`Original stack:
  5619. ${n.stack}
  5620. Handler stack:
  5621. ${o.stack}`),o};Xc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:R.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Le.IDENTITY,l(e.scale)?e.scale:h.ONE)};Xc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let a=i[r],s=l(n)?a.setIndex===n:!0;if(a.semantic===t&&s)return a}};Xc.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}};Xc.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}};Xc.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};Xc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=it.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),a=e.type,s=Ft.getGlslType(a);r&&(s="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":Ft.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:s,quantizedGlslType:u}};var NHe=new h,FHe=new h;Xc.getPositionMinMax=function(e,t,n){let i=Xc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=h.add(r,t,FHe),o=h.add(o,n,NHe)),{min:r,max:o}};Xc.getAxisCorrectionMatrix=function(e,t,n){return n=R.clone(R.IDENTITY,n),e===Fi.Y?n=R.clone(Fi.Y_UP_TO_Z_UP,n):e===Fi.X&&(n=R.clone(Fi.X_UP_TO_Z_UP,n)),t===Fi.Z&&(n=R.multiplyTransformation(n,Fi.Z_UP_TO_X_UP,n)),n};var kHe=new $;Xc.getCullFace=function(e,t){if(!Re.isTriangles(t))return Li.BACK;let n=R.getMatrix3(e,kHe);return $.determinant(n)<0?Li.FRONT:Li.BACK};Xc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Xc.supportedExtensions={AGI_articulations:!0,CESIUM_mesh_vector:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_mesh_polygon:!0,EXT_mesh_primitive_edge_visibility:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!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_mesh_primitive_restart:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};Xc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Xc.supportedExtensions[i])throw new re(`Unsupported glTF Extension: ${i}`)}};var mt=Xc;var aY=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,o=t.baseResource,r=t.typedArray,a=t.gltfJson,s=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=o,this._typedArray=r,this._gltfJson=a,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,l(this._gltfJson)?(this._promise=Mue(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Bue(this,this._typedArray),this._promise):(this._promise=zHe(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function zHe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;sY(e,n)}return Bue(e,t)}function sY(e,t){e.unload(),e._state=gt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function UHe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Hr(t,"KHR_techniques_webgl")&&!Hr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Fe.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),a=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(a),n.push(a.load().then(function(){a.isDestroyed()||(i.extras._pipeline.source=a.typedArray)}))}}),await Promise.all(n),l2(t)}function VHe(e){let t=[];return Fe.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&gm(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function jHe(e,t){let n=[];return Fe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let s=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(s),n.push(s.load())}}),Promise.all(n)}async function Mue(e,t){try{sx(t),await VHe(t),await UHe(e,t),KF(t),await jHe(e,t),ZF(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new re(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&mt.checkSupportedExtensions(i),e._gltf=t,e._state=gt.READY,e}catch(n){if(e.isDestroyed())return;sY(e,n)}}async function Bue(e,t){let n;try{Um(t)==="glTF"?n=zC(t):n=Sr(t)}catch(i){if(e.isDestroyed())return;sY(e,i)}return Mue(e,n)}var JI=aY;var Lue={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(Lue);var S0=Lue;var bo={},cY=class{constructor(){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}},lY=class{constructor(){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}},uY=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},fY=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},dY=class{constructor(){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}},hY=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},mY=class{constructor(){this.attributes=[]}},pY=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.polygon=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},gY=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},_Y=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},AY=class{constructor(){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,this.meshVector=void 0}},yY=class{constructor(){this.nodes=[]}},GHe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},xY=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},bY=class{constructor(){this.node=void 0,this.path=void 0}},TY=class{constructor(){this.sampler=void 0,this.target=void 0}},CY=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},EY=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},vY=class{constructor(){this.name=void 0,this.stages=[]}},u2=class{constructor(){this.credits=[]}},SY=class{constructor(){this.asset=new u2,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=R.clone(R.IDENTITY),this.extensions={}}},wY=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},P_=class P_{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(P_.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=P_.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=P_.DEFAULT_ROUGHNESS_FACTOR}};lt(P_,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),lt(P_,"DEFAULT_METALLIC_FACTOR",1),lt(P_,"DEFAULT_ROUGHNESS_FACTOR",1);var f2=P_,R_=class R_{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(R_.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(R_.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=R_.DEFAULT_GLOSSINESS_FACTOR}};lt(R_,"DEFAULT_DIFFUSE_FACTOR",se.ONE),lt(R_,"DEFAULT_SPECULAR_FACTOR",h.ONE),lt(R_,"DEFAULT_GLOSSINESS_FACTOR",1);var IY=R_,jC=class jC{constructor(){this.specularFactor=jC.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(jC.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};lt(jC,"DEFAULT_SPECULAR_FACTOR",1),lt(jC,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var DY=jC,GC=class GC{constructor(){this.anisotropyStrength=GC.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=GC.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};lt(GC,"DEFAULT_ANISOTROPY_STRENGTH",0),lt(GC,"DEFAULT_ANISOTROPY_ROTATION",0);var PY=GC,HC=class HC{constructor(){this.clearcoatFactor=HC.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=HC.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};lt(HC,"DEFAULT_CLEARCOAT_FACTOR",0),lt(HC,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var RY=HC,OY=class{constructor(){lt(this,"width");lt(this,"pattern")}},d2=class d2{constructor(){this.metallicRoughness=new f2,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(d2.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=S0.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.lineStyle=void 0}};lt(d2,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var MY=d2,BY=class{constructor(){lt(this,"count",0);lt(this,"triangleIndices");lt(this,"triangleIndicesOffsets");lt(this,"loopIndices");lt(this,"loopIndicesOffsets")}},LY=class{constructor(){lt(this,"vector",!0);lt(this,"count",0);lt(this,"polygonAttributeOffsets");lt(this,"polygonHoleCounts");lt(this,"polygonHoleOffsets");lt(this,"polygonIndicesOffsets")}};bo.Quantization=cY;bo.Attribute=lY;bo.Indices=uY;bo.FeatureIdAttribute=fY;bo.FeatureIdTexture=hY;bo.FeatureIdImplicitRange=dY;bo.MorphTarget=mY;bo.Primitive=pY;bo.Instances=gY;bo.Skin=_Y;bo.Node=AY;bo.Scene=yY;bo.AnimatedPropertyType=Object.freeze(GHe);bo.AnimationSampler=xY;bo.AnimationTarget=bY;bo.AnimationChannel=TY;bo.Animation=CY;bo.ArticulationStage=EY;bo.Articulation=vY;bo.Asset=u2;bo.Components=SY;bo.TextureReader=wY;bo.MetallicRoughness=f2;bo.SpecularGlossiness=IY;bo.Specular=DY;bo.Anisotropy=PY;bo.Clearcoat=RY;bo.LineStyle=OY;bo.Material=MY;bo.Vector=LY;bo.Polygon=BY;var yn=bo;var h2={};h2.getImageIdFromTexture=function(e){e=e??G.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};h2.createSampler=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=un.REPEAT,r=un.REPEAT,a=Vt.LINEAR,s=ti.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];o=d.wrapS??o,r=d.wrapT??r,a=d.minFilter??a,s=d.magFilter??s}return i&&a!==Vt.LINEAR&&a!==Vt.NEAREST&&(a===Vt.NEAREST_MIPMAP_NEAREST||a===Vt.NEAREST_MIPMAP_LINEAR?a=Vt.NEAREST:a=Vt.LINEAR),new jt({wrapS:o,wrapT:r,minificationFilter:a,magnificationFilter:s})};var HHe=new z(1,1);h2.createModelTextureReader=function(e){e=e??G.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,o=t.texCoord??0,r,a=t.extensions?.KHR_texture_transform;if(l(a)){o=a.texCoord??o;let u=l(a.offset)?z.unpack(a.offset):z.ZERO,f=a.rotation??0,d=l(a.scale)?z.unpack(a.scale):HHe;f=-f,r=new $(Math.cos(f)*d.x,-Math.sin(f)*d.y,u.x,Math.sin(f)*d.x,Math.cos(f)*d.y,u.y,0,0,1)}let s=new yn.TextureReader;s.index=t.index,s.texture=i,s.texCoord=o,s.scale=t.scale,s.transform=r,s.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(s.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?z.unpack(c.offset):z.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),s};var Zu=h2;function WHe(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var cx=WHe;var NY=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.textureInfo,r=t.gltfResource,a=t.baseResource,s=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=o.index,d=Zu.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:s});this._resourceCache=n,this._gltf=i,this._textureInfo=o,this._imageId=d,this._gltfResource=r,this._baseResource=a,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=YHe(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=gt.PROCESSING;let n;if(this._asynchronous){let i=qHe;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Yc.TEXTURE))return!1;n=i.texture}else n=Nue(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=gt.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){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}},FY=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,o,r,a){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=o,this.mipLevels=r,this.context=a}execute(){this.texture=Nue(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function Nue(e,t,n,i,o,r){let a=i.internalFormat,s=!1;Xe.isCompressedFormat(a)&&!l(o)&&(s=!0);let c=Zu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Vt.NEAREST_MIPMAP_NEAREST||u===Vt.NEAREST_MIPMAP_LINEAR||u===Vt.LINEAR_MIPMAP_NEAREST||u===Vt.LINEAR_MIPMAP_LINEAR,g=!l(a)&&p,m=g||f===un.REPEAT||f===un.MIRRORED_REPEAT||d===un.REPEAT||d===un.MIRRORED_REPEAT,A=!D.isPowerOfTwo(i.width)||!D.isPowerOfTwo(i.height),y=m&&A,x;return l(a)?(!r.webgl2&&Xe.isCompressedFormat(a)&&A&&m&&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."),x=Dt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(y&&(i=cx(i)),x=Dt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&x.generateMipmap(),x}var qHe=new FY;async function YHe(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=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load texture",n)}}var ZI=NY;var kY=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.gltfResource,r=t.baseResource,a=t.bufferViewId,s=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,d=t.cacheKey,p=t.spz,g=t.asynchronous??!0,m=t.loadBuffer??!1,A=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=o,this._baseResource=r,this._gltf=i,this._bufferViewId=a,this._primitive=s,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=d,this._asynchronous=g,this._loadBuffer=m,this._loadTypedArray=A,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=QHe(this),this._promise):XHe(this._draco,this._attributeSemantic)?(this._promise=e5e(this),this._promise):(this._promise=n5e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(o){m2(this,o)}t5e(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(o){m2(this,o)}ZHe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let o=i5e;if(o.set(i,t.context),!t.jobScheduler.execute(o,Yc.BUFFER))return!1;n=o.buffer}else this._loadBuffer&&(n=Fue(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function XHe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function KHe(e,t,n,i){let r=(1<<e.quantizationBits)-1,a=1/r,s=new yn.Quantization;if(s.componentDatatype=t,s.octEncoded=e.octEncoded,s.octEncodedZXY=!0,s.type=i,s.octEncoded)s.type=Ft.VEC2,s.normalizationRange=r;else{let c=Ft.getMathType(i);if(c===Number){let u=e.range;s.quantizedVolumeOffset=e.minValues[0],s.quantizedVolumeDimensions=u,s.normalizationRange=r,s.quantizedVolumeStepSize=u*a}else{s.quantizedVolumeOffset=c.unpack(e.minValues),s.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);s.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*a});s.quantizedVolumeStepSize=c.unpack(f)}}return s}async function QHe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch{if(e.isDestroyed())return}}function $He(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function JHe(e){let t=$He(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),a=parseInt(e.slice(o+n.length),10);return{l:r,n:a}}function ZHe(e){e._state=gt.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,o=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let r=0;r<i.length/3;r++)e._typedArray[r*4]=D.clamp(i[r*3]*255,0,255),e._typedArray[r*4+1]=D.clamp(i[r*3+1]*255,0,255),e._typedArray[r*4+2]=D.clamp(i[r*3+2]*255,0,255),e._typedArray[r*4+3]=D.clamp(o[r]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:o}=JHe(e._attributeSemantic),r=n.shDegree,a=0,s=[0,9,24];switch(r){case 1:a=9;break;case 2:a=24;break;case 3:a=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let d=f*a+s[i-1]+o*3;e._typedArray[f*3]=u[d],e._typedArray[f*3+1]=u[d+1],e._typedArray[f*3+2]=u[d+2]}}}async function e5e(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch{if(e.isDestroyed())return;m2(e)}}function t5e(e){e._state=gt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,s=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=KHe(u,o.data.componentDatatype,o.data.componentsPerAttribute,s)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function n5e(e){e._state=gt.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=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;m2(e,n)}}function m2(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load vertex buffer",t)}var zY=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=Fue(this.typedArray,this.context)}};function Fue(e,t){let n=Ke.createVertexBuffer({typedArray:e,context:t,usage:Oe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var i5e=new zY,eD=kY;async function o5e(e={}){var t,n,i,o,r=e,a=!!globalThis.window,s=!!globalThis.WorkerGlobalScope,c=((n=(t=globalThis.process)==null?void 0:t.versions)==null?void 0:n.node)&&((i=globalThis.process)==null?void 0:i.type)!="renderer";if(c){let{createRequire:ue}=await Promise.resolve().then(()=>l5e);var u=ue(import.meta.url)}var f="./this.program",d=import.meta.url;if(c)u("node:fs"),d.startsWith("file:")&&u("node:path").dirname(u("node:url").fileURLToPath(d)),1<process.argv.length&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2);else if(a||s)try{new URL(".",d)}catch{}var p=console.log.bind(console),g=console.error.bind(console),m=!1;function A(ue){for(var ne=0,xe=ue.length,Se=new Uint8Array(xe),We;ne<xe;++ne)We=ue.charCodeAt(ne),Se[ne]=~We>>8&We;return Se}var y,x,b,T,E,S,w,P,O,B,L,_,C=!1;function v(){var ue=Mc.buffer;b=new Int8Array(ue),E=new Int16Array(ue),r.HEAPU8=T=new Uint8Array(ue),S=new Uint16Array(ue),w=new Int32Array(ue),P=new Uint32Array(ue),r.HEAPF32=O=new Float32Array(ue),B=new Float64Array(ue),L=new BigInt64Array(ue),_=new BigUint64Array(ue)}function I(ue){var ne;throw(ne=r.onAbort)==null||ne.call(r,ue),ue="Aborted("+ue+")",g(ue),m=!0,ue=new WebAssembly.RuntimeError(ue+". Build with -sASSERTIONS for more info."),x?.(ue),ue}var M;async function N(ue){return ue}async function j(ue){var ne=M;try{var xe=await N(ne);return await WebAssembly.instantiate(xe,ue)}catch(Se){g(`failed to asynchronously prepare wasm: ${Se}`),I(Se)}}async function k(ue){return j(ue)}var V=ue=>{for(;0<ue.length;)ue.shift()(r)},F=[],W=[],q=()=>{var ue=r.preRun.shift();W.push(ue)},J={},H=ue=>{for(;ue.length;){var ne=ue.pop();ue.pop()(ne)}};function Z(ue){return this.O(P[ue>>2])}var K={},le={},me={},ae=class extends Error{constructor(ue){super(ue),this.name="InternalError"}},be=(ue,ne,xe)=>{function Se(Et){if(Et=xe(Et),Et.length!==ue.length)throw new ae("Mismatched type converter count");for(var bn=0;bn<ue.length;++bn)ke(ue[bn],Et[bn])}ue.forEach(Et=>me[Et]=ne);var We=Array(ne.length),bt=[],ft=0;for(let[Et,bn]of ne.entries())le.hasOwnProperty(bn)?We[Et]=le[bn]:(bt.push(bn),K.hasOwnProperty(bn)||(K[bn]=[]),K[bn].push(()=>{We[Et]=le[bn],++ft,ft===bt.length&&Se(We)}));bt.length===0&&Se(We)},ge=ue=>{for(var ne="";;){var xe=T[ue++];if(!xe)return ne;ne+=String.fromCharCode(xe)}},we=class extends Error{constructor(ue){super(ue),this.name="BindingError"}},Ee=ue=>{throw new we(ue)};function Be(ue,ne,xe={}){var Se=ne.name;if(!ue)throw new we(`type "${Se}" must have a positive integer typeid pointer`);if(le.hasOwnProperty(ue)){if(xe.Aa)return;throw new we(`Cannot register type '${Se}' twice`)}le[ue]=ne,delete me[ue],K.hasOwnProperty(ue)&&(ne=K[ue],delete K[ue],ne.forEach(We=>We()))}function ke(ue,ne,xe={}){return Be(ue,ne,xe)}var Ge=(ue,ne,xe)=>{switch(ne){case 1:return xe?Se=>b[Se]:Se=>T[Se];case 2:return xe?Se=>E[Se>>1]:Se=>S[Se>>1];case 4:return xe?Se=>w[Se>>2]:Se=>P[Se>>2];case 8:return xe?Se=>L[Se>>3]:Se=>_[Se>>3];default:throw new TypeError(`invalid integer width (${ne}): ${ue}`)}},rt=ue=>{throw new we(ue.M.R.N.name+" instance already deleted")},et=!1,Pe=()=>{},Ye=ue=>globalThis.FinalizationRegistry?(et=new FinalizationRegistry(ne=>{ne=ne.M,--ne.count.value,ne.count.value===0&&(ne.V?ne.Y.Z(ne.V):ne.R.N.Z(ne.P))}),Ye=ne=>{var xe=ne.M;return xe.V&&et.register(ne,{M:xe},ne),ne},Pe=ne=>{et.unregister(ne)},Ye(ue)):(Ye=ne=>ne,ue);function ut(){}var Ct=(ue,ne)=>Object.defineProperty(ne,"name",{value:ue}),en={},Gt=(ue,ne,xe)=>{if(ue[ne].U===void 0){var Se=ue[ne];ue[ne]=function(...We){if(!ue[ne].U.hasOwnProperty(We.length))throw new we(`Function '${xe}' called with an invalid number of arguments (${We.length}) - expects one of (${ue[ne].U})!`);return ue[ne].U[We.length].apply(this,We)},ue[ne].U=[],ue[ne].U[Se.$]=Se}},yt=(ue,ne,xe)=>{if(r.hasOwnProperty(ue)){if(xe===void 0||r[ue].U!==void 0&&r[ue].U[xe]!==void 0)throw new we(`Cannot register public name '${ue}' twice`);if(Gt(r,ue,ue),r[ue].U.hasOwnProperty(xe))throw new we(`Cannot register multiple overloads of a function with the same number of arguments (${xe})!`);r[ue].U[xe]=ne}else r[ue]=ne,r[ue].$=xe},wt=ue=>{ue=ue.replace(/[^a-zA-Z0-9_]/g,"$");var ne=ue.charCodeAt(0);return 48<=ne&&57>=ne?`_${ue}`:ue};function xn(ue,ne,xe,Se,We,bt,ft,Et){this.name=ue,this.constructor=ne,this.ba=xe,this.Z=Se,this.W=We,this.va=bt,this.fa=ft,this.ta=Et,this.Ca=[]}var at=(ue,ne,xe)=>{for(;ne!==xe;){if(!ne.fa)throw new we(`Expected null or instance of ${xe.name}, got an instance of ${ne.name}`);ue=ne.fa(ue),ne=ne.W}return ue},st=ue=>{if(ue===null)return"null";var ne=typeof ue;return ne==="object"||ne==="array"||ne==="function"?ue.toString():""+ue};function Ln(ue,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${st(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);return at(ne.M.P,ne.M.R.N,this.N)}function Nn(ue,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);if(this.ha){var xe=this.ka();return ue!==null&&ue.push(this.Z,xe),xe}return 0}if(!ne||!ne.M)throw new we(`Cannot pass "${st(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);if(xe=at(ne.M.P,ne.M.R.N,this.N),this.ha){if(ne.M.V===void 0)throw new we("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(ne.M.Y===this)xe=ne.M.V;else throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);break;case 1:xe=ne.M.V;break;case 2:if(ne.M.Y===this)xe=ne.M.V;else{var Se=ne.clone();xe=this.Da(xe,Oo(()=>Se.delete())),ue!==null&&ue.push(this.Z,xe)}break;default:throw new we("Unsupported sharing policy")}}return xe}function so(ue,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${st(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.R.name} to parameter type ${this.name}`);return at(ne.M.P,ne.M.R.N,this.N)}var jo=(ue,ne,xe)=>ne===xe?ue:xe.W===void 0?null:(ue=jo(ue,ne,xe.W),ue===null?null:xe.ta(ue)),to={},no=(ue,ne)=>{if(ne===void 0)throw new we("ptr should not be undefined");for(;ue.W;)ne=ue.fa(ne),ue=ue.W;return to[ne]},jn=(ue,ne)=>{if(!ne.R||!ne.P)throw new ae("makeClassHandle requires ptr and ptrType");if(!!ne.Y!=!!ne.V)throw new ae("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},Ye(Object.create(ue,{M:{value:ne,writable:!0}}))};function Gn(ue,ne,xe,Se,We,bt,ft,Et,bn,$n,mn){this.name=ue,this.N=ne,this.ia=xe,this.ga=Se,this.ha=We,this.Ba=bt,this.Ha=ft,this.pa=Et,this.ka=bn,this.Da=$n,this.Z=mn,We||ne.W!==void 0?this.S=Nn:(this.S=Se?Ln:so,this.T=null)}var sn=(ue,ne,xe)=>{if(!r.hasOwnProperty(ue))throw new ae("Replacing nonexistent public symbol");r[ue].U!==void 0&&xe!==void 0?r[ue].U[xe]=ne:(r[ue]=ne,r[ue].$=xe)},Qn=(ue,ne)=>{ue=ge(ue);var xe=xT.get(ne);if(typeof xe!="function")throw new we(`unknown function pointer with signature ${ue}: ${ne}`);return xe};class Tr extends Error{}var ma=ue=>{ue=Ho(ue);var ne=ge(ue);return ys(ue),ne},Qa=(ue,ne)=>{function xe(bt){We[bt]||le[bt]||(me[bt]?me[bt].forEach(xe):(Se.push(bt),We[bt]=!0))}var Se=[],We={};throw ne.forEach(xe),new Tr(`${ue}: `+Se.map(ma).join([", "]))},Ba=(ue,ne)=>{for(var xe=[],Se=0;Se<ue;Se++)xe.push(P[ne+4*Se>>2]);return xe};function $a(ue){for(var ne=1;ne<ue.length;++ne)if(ue[ne]!==null&&ue[ne].T===void 0)return!0;return!1}function lr(ue,ne,xe,Se,We,bt){var ft=ne.length;if(2>ft)throw new we("argTypes array size mismatch! Must at least get return value and 'this' types!");var Et=ne[1]!==null&&xe!==null,bn=$a(ne);xe=!ne[0].oa;var $n=ne[0],mn=ne[1];for(Se=[ue,Ee,Se,We,H,$n.O.bind($n),mn?.S.bind(mn)],We=2;We<ft;++We)$n=ne[We],Se.push($n.S.bind($n));if(!bn)for(We=Et?1:2;We<ne.length;++We)ne[We].T!==null&&Se.push(ne[We].T);for(bn=$a(ne),We=ne.length-2,mn=[],$n=["fn"],Et&&$n.push("thisWired"),ft=0;ft<We;++ft)mn.push(`arg${ft}`),$n.push(`arg${ft}Wired`);mn=mn.join(","),$n=$n.join(","),mn=`return function (${mn}) {
  5622. `,bn&&(mn+=`var destructors = [];
  5623. `);var Fr=bn?"destructors":"null",kr="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(Et&&(mn+=`var thisWired = toClassParamWire(${Fr}, this);
  5624. `),ft=0;ft<We;++ft){var xs=`toArg${ft}Wire`;mn+=`var arg${ft}Wired = ${xs}(${Fr}, arg${ft});
  5625. `,kr.push(xs)}if(mn+=(xe||bt?"var rv = ":"")+`invoker(${$n});
  5626. `,bn)mn+=`runDestructors(destructors);
  5627. `;else for(ft=Et?1:2;ft<ne.length;++ft)bt=ft===1?"thisWired":"arg"+(ft-2)+"Wired",ne[ft].T!==null&&(mn+=`${bt}_dtor(${bt});
  5628. `,kr.push(`${bt}_dtor`));return xe&&(mn+=`var ret = fromRetWire(rv);
  5629. return ret;
  5630. `),ne=new Function(kr,mn+`}
  5631. `)(...Se),Ct(ue,ne)}var ii=ue=>{ue=ue.trim();let ne=ue.indexOf("(");return ne===-1?ue:ue.slice(0,ne)},Lr=[],So=[0,1,,1,null,1,!0,1,!1,1],Di=ue=>{9<ue&&--So[ue+1]===0&&(So[ue]=void 0,Lr.push(ue))},ai=ue=>{if(!ue)throw new we(`Cannot use deleted val. handle = ${ue}`);return So[ue]},Oo=ue=>{switch(ue){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=Lr.pop()||So.length;return So[ne]=ue,So[ne+1]=1,ne}},uc={name:"emscripten::val",O:ue=>{var ne=ai(ue);return Di(ue),ne},S:(ue,ne)=>Oo(ne),X:Z,T:null},Jr=(ue,ne,xe)=>{switch(ne){case 1:return xe?function(Se){return this.O(b[Se])}:function(Se){return this.O(T[Se])};case 2:return xe?function(Se){return this.O(E[Se>>1])}:function(Se){return this.O(S[Se>>1])};case 4:return xe?function(Se){return this.O(w[Se>>2])}:function(Se){return this.O(P[Se>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${ue}`)}},Uu=(ue,ne)=>{var xe=le[ue];if(xe===void 0)throw ue=`${ne} has unknown type ${ma(ue)}`,new we(ue);return xe},ks=(ue,ne)=>{switch(ne){case 4:return function(xe){return this.O(O[xe>>2])};case 8:return function(xe){return this.O(B[xe>>3])};default:throw new TypeError(`invalid float width (${ne}): ${ue}`)}},Ug=(ue,ne,xe)=>{let Se=(We,bt)=>{let ft=0;return{next(){if(ft>=We)return{done:!0};let Et=ft;return ft++,{value:bt(Et),done:!1}},[Symbol.iterator](){return this}}};ue[Symbol.iterator]||(ue[Symbol.iterator]=function(){let We=this[ne]();return Se(We,bt=>this[xe](bt))})},Go=Object.assign({optional:!0},uc),ur=(ue,ne,xe)=>{var Se=T;if(!(0<xe))return 0;var We=ne;xe=ne+xe-1;for(var bt=0;bt<ue.length;++bt){var ft=ue.codePointAt(bt);if(127>=ft){if(ne>=xe)break;Se[ne++]=ft}else if(2047>=ft){if(ne+1>=xe)break;Se[ne++]=192|ft>>6,Se[ne++]=128|ft&63}else if(65535>=ft){if(ne+2>=xe)break;Se[ne++]=224|ft>>12,Se[ne++]=128|ft>>6&63,Se[ne++]=128|ft&63}else{if(ne+3>=xe)break;Se[ne++]=240|ft>>18,Se[ne++]=128|ft>>12&63,Se[ne++]=128|ft>>6&63,Se[ne++]=128|ft&63,bt++}}return Se[ne]=0,ne-We},Qd=ue=>{for(var ne=0,xe=0;xe<ue.length;++xe){var Se=ue.charCodeAt(xe);127>=Se?ne++:2047>=Se?ne+=2:55296<=Se&&57343>=Se?(ne+=4,++xe):ne+=3}return ne},Nr=new TextDecoder,Pc=(ue,ne,xe,Se)=>{if(xe=ne+xe,Se)return xe;for(;ue[ne]&&!(ne>=xe);)++ne;return ne},Rc=new TextDecoder("utf-16le"),fc=(ue,ne,xe)=>(ue>>=1,Rc.decode(S.subarray(ue,Pc(S,ue,ne/2,xe)))),_o=(ue,ne,xe)=>{if(xe??(xe=2147483647),2>xe)return 0;xe-=2;var Se=ne;xe=xe<2*ue.length?xe/2:ue.length;for(var We=0;We<xe;++We)E[ne>>1]=ue.charCodeAt(We),ne+=2;return E[ne>>1]=0,ne-Se},La=ue=>2*ue.length,Vg=(ue,ne,xe)=>{var Se="";ue>>=2;for(var We=0;!(We>=ne/4);We++){var bt=P[ue+We];if(!bt&&!xe)break;Se+=String.fromCodePoint(bt)}return Se},Tw=(ue,ne,xe)=>{if(xe??(xe=2147483647),4>xe)return 0;var Se=ne;xe=Se+xe-4;for(var We=0;We<ue.length;++We){var bt=ue.codePointAt(We);if(65535<bt&&We++,w[ne>>2]=bt,ne+=4,ne+4>xe)break}return w[ne>>2]=0,ne-Se},S9=ue=>{for(var ne=0,xe=0;xe<ue.length;++xe)65535<ue.codePointAt(xe)&&xe++,ne+=4;return ne},AT=[],IO=ue=>{var ne=AT.length;return AT.push(ue),ne},yT=(ue,ne)=>{for(var xe=Array(ue),Se=0;Se<ue;++Se)xe[Se]=Uu(P[ne+4*Se>>2],`parameter ${Se}`);return xe},jg=(ue,ne,xe)=>{var Se=[];return ue=ue(Se,xe),Se.length&&(P[ne>>2]=Oo(Se)),ue},gn={},Ce=ue=>{var ne=gn[ue];return ne===void 0?ge(ue):ne},ot={},Kt=()=>{var ue;if(!co){var ne={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((ue=globalThis.navigator)==null?void 0:ue.language)??"C").replace("-","_")+".UTF-8",_:f||"./this.program"},xe;for(xe in ot)ot[xe]===void 0?delete ne[xe]:ne[xe]=ot[xe];var Se=[];for(xe in ne)Se.push(`${xe}=${ne[xe]}`);co=Se}return co},co,Mi=[null,[],[]];if((()=>{let ue=ut.prototype;Object.assign(ue,{isAliasOf:function(xe){if(!(this instanceof ut&&xe instanceof ut))return!1;var Se=this.M.R.N,We=this.M.P;xe.M=xe.M;var bt=xe.M.R.N;for(xe=xe.M.P;Se.W;)We=Se.fa(We),Se=Se.W;for(;bt.W;)xe=bt.fa(xe),bt=bt.W;return Se===bt&&We===xe},clone:function(){if(this.M.P||rt(this),this.M.ea)return this.M.count.value+=1,this;var xe=Ye,Se=Object,We=Se.create,bt=Object.getPrototypeOf(this),ft=this.M;return xe=xe(We.call(Se,bt,{M:{value:{count:ft.count,da:ft.da,ea:ft.ea,P:ft.P,R:ft.R,V:ft.V,Y:ft.Y}}})),xe.M.count.value+=1,xe.M.da=!1,xe},delete(){if(this.M.P||rt(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");Pe(this);var xe=this.M;--xe.count.value,xe.count.value===0&&(xe.V?xe.Y.Z(xe.V):xe.R.N.Z(xe.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||rt(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");return this.M.da=!0,this}});let ne=Symbol.dispose;ne&&(ue[ne]=ue.delete)})(),Object.assign(Gn.prototype,{wa(ue){return this.pa&&(ue=this.pa(ue)),ue},ma(ue){var ne;(ne=this.Z)==null||ne.call(this,ue)},X:Z,O:function(ue){function ne(){return this.ha?jn(this.N.ba,{R:this.Ba,P:xe,Y:this,V:ue}):jn(this.N.ba,{R:this,P:ue})}var xe=this.wa(ue);if(!xe)return this.ma(ue),null;var Se=no(this.N,xe);if(Se!==void 0)return Se.M.count.value===0?(Se.M.P=xe,Se.M.V=ue,Se.clone()):(Se=Se.clone(),this.ma(ue),Se);if(Se=this.N.va(xe),Se=en[Se],!Se)return ne.call(this);Se=this.ga?Se.sa:Se.pointerType;var We=jo(xe,this.N,Se.N);return We===null?ne.call(this):this.ha?jn(Se.N.ba,{R:Se,P:We,Y:this,V:ue}):jn(Se.N.ba,{R:Se,P:We})}}),r.print&&(p=r.print),r.printErr&&(g=r.printErr),r.thisProgram&&(f=r.thisProgram),r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();var Ho,Oc,ys,Mc,xT,Ja={y:()=>I(""),r:ue=>{var ne=J[ue];delete J[ue];var xe=ne.ka,Se=ne.Z,We=ne.na,bt=We.map(ft=>ft.za).concat(We.map(ft=>ft.Fa));be([ue],bt,ft=>{var Et={},bn,$n;for([bn,$n]of We.entries()){let mn=ft[bn],Fr=$n.xa,kr=$n.ya,xs=ft[bn+We.length],fl=$n.Ea,Nf=$n.Ga;Et[$n.ua]={read:n0=>mn.O(Fr(kr,n0)),write:(n0,Cw)=>{var Vu=[];fl(Nf,n0,xs.S(Vu,Cw)),H(Vu)},optional:mn.optional}}return[{name:ne.name,O:mn=>{var Fr={},kr;for(kr in Et)Fr[kr]=Et[kr].read(mn);return Se(mn),Fr},S:(mn,Fr)=>{for(var kr in Et)if(!(kr in Fr||Et[kr].optional))throw new TypeError(`Missing field: "${kr}"`);var xs=xe();for(kr in Et)Et[kr].write(xs,Fr[kr]);return mn!==null&&mn.push(Se,xs),xs},X:Z,T:Se}]})},o:(ue,ne,xe,Se,We)=>{ne=ge(ne),Se=Se===0n;let bt=ft=>ft;if(Se){let ft=8*xe;bt=Et=>BigInt.asUintN(ft,Et),We=bt(We)}ke(ue,{name:ne,O:bt,S:(ft,Et)=>(typeof Et=="number"&&(Et=BigInt(Et)),Et),X:Ge(ne,xe,!Se),T:null})},C:(ue,ne,xe,Se)=>{ne=ge(ne),ke(ue,{name:ne,O:function(We){return!!We},S:function(We,bt){return bt?xe:Se},X:function(We){return this.O(T[We])},T:null})},k:(ue,ne,xe,Se,We,bt,ft,Et,bn,$n,mn,Fr,kr)=>{mn=ge(mn),bt=Qn(We,bt),Et&&(Et=Qn(ft,Et)),$n&&($n=Qn(bn,$n)),kr=Qn(Fr,kr);var xs=wt(mn);yt(xs,function(){Qa(`Cannot construct ${mn} due to unbound types`,[Se])}),be([ue,ne,xe],Se?[Se]:[],fl=>{if(fl=fl[0],Se)var Nf=fl.N,n0=Nf.ba;else n0=ut.prototype;fl=Ct(mn,function(...w9){if(Object.getPrototypeOf(this)!==Cw)throw new we(`Use 'new' to construct ${mn}`);if(Vu.aa===void 0)throw new we(`${mn} has no accessible constructor`);var Rie=Vu.aa[w9.length];if(Rie===void 0)throw new we(`Tried to invoke ctor of ${mn} with invalid number of parameters (${w9.length}) - expected (${Object.keys(Vu.aa).toString()}) parameters instead!`);return Rie.apply(this,w9)});var Cw=Object.create(n0,{constructor:{value:fl}});fl.prototype=Cw;var Vu=new xn(mn,fl,Cw,kr,Nf,bt,Et,$n);if(Vu.W){var Ew;(Ew=Vu.W).la??(Ew.la=[]),Vu.W.la.push(Vu)}return Nf=new Gn(mn,Vu,!0,!1,!1),Ew=new Gn(mn+"*",Vu,!1,!1,!1),n0=new Gn(mn+" const*",Vu,!1,!0,!1),en[ue]={pointerType:Ew,sa:n0},sn(xs,fl),[Nf,Ew,n0]})},g:(ue,ne,xe,Se,We,bt)=>{var ft=Ba(ne,xe);We=Qn(Se,We),be([],[ue],Et=>{Et=Et[0];var bn=`constructor ${Et.name}`;if(Et.N.aa===void 0&&(Et.N.aa=[]),Et.N.aa[ne-1]!==void 0)throw new we(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${Et.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Et.N.aa[ne-1]=()=>{Qa(`Cannot construct ${Et.name} due to unbound types`,ft)},be([],ft,$n=>($n.splice(1,0,null),Et.N.aa[ne-1]=lr(bn,$n,null,We,bt),[])),[]})},b:(ue,ne,xe,Se,We,bt,ft,Et,bn)=>{var $n=Ba(xe,Se);ne=ge(ne),ne=ii(ne),bt=Qn(We,bt),be([],[ue],mn=>{function Fr(){Qa(`Cannot call ${kr} due to unbound types`,$n)}mn=mn[0];var kr=`${mn.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),Et&&mn.N.Ca.push(ne);var xs=mn.N.ba,fl=xs[ne];return fl===void 0||fl.U===void 0&&fl.className!==mn.name&&fl.$===xe-2?(Fr.$=xe-2,Fr.className=mn.name,xs[ne]=Fr):(Gt(xs,ne,kr),xs[ne].U[xe-2]=Fr),be([],$n,Nf=>(Nf=lr(kr,Nf,mn,bt,ft,bn),xs[ne].U===void 0?(Nf.$=xe-2,xs[ne]=Nf):xs[ne].U[xe-2]=Nf,[])),[]})},A:ue=>ke(ue,uc),s:(ue,ne,xe,Se,We)=>{switch(ne=ge(ne),We=We===0?"object":We===1?"number":"string",We){case"object":let ft=function(){};ft.values={},ke(ue,{name:ne,constructor:ft,valueType:We,O:function(Et){return this.constructor.values[Et]},S:(Et,bn)=>bn.value,X:Jr(ne,xe,Se),T:null}),yt(ne,ft);break;case"number":var bt={};ke(ue,{name:ne,ja:bt,valueType:We,O:Et=>Et,S:(Et,bn)=>bn,X:Jr(ne,xe,Se),T:null}),yt(ne,bt),delete r[ne].$;break;case"string":bt={},ke(ue,{name:ne,ra:{},qa:{},ja:bt,valueType:We,O:function(Et){return this.qa[Et]},S:function(Et,bn){return this.ra[bn]},X:Jr(ne,xe,Se),T:null}),yt(ne,bt),delete r[ne].$}},d:(ue,ne,xe)=>{var Se=Uu(ue,"enum");switch(ne=ge(ne),Se.valueType){case"object":ue=Se.constructor,Se=Object.create(Se.constructor.prototype,{value:{value:xe},constructor:{value:Ct(`${Se.name}_${ne}`,function(){})}}),ue.values[xe]=Se,ue[ne]=Se;break;case"number":Se.ja[ne]=xe;break;case"string":Se.ra[ne]=xe,Se.qa[xe]=ne,Se.ja[ne]=ne}},n:(ue,ne,xe)=>{ne=ge(ne),ke(ue,{name:ne,O:Se=>Se,S:(Se,We)=>We,X:ks(ne,xe),T:null})},m:(ue,ne,xe,Se,We,bt,ft)=>{var Et=Ba(ne,xe);ue=ge(ue),ue=ii(ue),We=Qn(Se,We),yt(ue,function(){Qa(`Cannot call ${ue} due to unbound types`,Et)},ne-1),be([],Et,bn=>(bn=[bn[0],null].concat(bn.slice(1)),sn(ue,lr(ue,bn,null,We,bt,ft),ne-1),[]))},c:(ue,ne,xe,Se,We)=>{ne=ge(ne);let bt=Et=>Et;if(Se===0){var ft=32-8*xe;bt=Et=>Et<<ft>>>ft,We=bt(We)}ke(ue,{name:ne,O:bt,S:(Et,bn)=>bn,X:Ge(ne,xe,Se!==0),T:null})},j:(ue,ne,xe,Se)=>{xe=ge(xe),Se=ge(Se),be([],[ue,ne],We=>(Ug(We[0].N.ba,xe,Se),[]))},a:(ue,ne,xe)=>{function Se(bt){return new We(b.buffer,P[bt+4>>2],P[bt>>2])}var We=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];xe=ge(xe),ke(ue,{name:xe,O:Se,X:Se},{Aa:!0})},h:ue=>{ke(ue,Go)},B:(ue,ne)=>{ne=ge(ne),ke(ue,{name:ne,O(xe){var Se=(Se=xe+4)?Nr.decode(T.subarray(Se,Pc(T,Se,P[xe>>2],!0))):"";return ys(xe),Se},S(xe,Se){Se instanceof ArrayBuffer&&(Se=new Uint8Array(Se));var We=typeof Se=="string";if(!(We||ArrayBuffer.isView(Se)&&Se.BYTES_PER_ELEMENT==1))throw new we("Cannot pass non-string to std::string");var bt=We?Qd(Se):Se.length,ft=Oc(4+bt+1),Et=ft+4;return P[ft>>2]=bt,We?ur(Se,Et,bt+1):T.set(Se,Et),xe!==null&&xe.push(ys,ft),ft},X:Z,T(xe){ys(xe)}})},f:(ue,ne,xe)=>{if(xe=ge(xe),ne===2)var Se=fc,We=_o,bt=La;else Se=Vg,We=Tw,bt=S9;ke(ue,{name:xe,O:ft=>{var Et=Se(ft+4,P[ft>>2]*ne,!0);return ys(ft),Et},S:(ft,Et)=>{if(typeof Et!="string")throw new we(`Cannot pass non-string to C++ string type ${xe}`);var bn=bt(Et),$n=Oc(4+bn+ne);return P[$n>>2]=bn/ne,We(Et,$n+4,bn+ne),ft!==null&&ft.push(ys,$n),$n},X:Z,T(ft){ys(ft)}})},i:(ue,ne,xe,Se,We,bt)=>{J[ue]={name:ge(ne),ka:Qn(xe,Se),Z:Qn(We,bt),na:[]}},e:(ue,ne,xe,Se,We,bt,ft,Et,bn,$n)=>{J[ue].na.push({ua:ge(ne),za:xe,xa:Qn(Se,We),ya:bt,Fa:ft,Ea:Qn(Et,bn),Ga:$n})},D:(ue,ne)=>{ne=ge(ne),ke(ue,{oa:!0,name:ne,O:()=>{},S:()=>{}})},q:(ue,ne,xe)=>{var[Se,...We]=yT(ue,ne);ne=Se.S.bind(Se);var bt=We.map(bn=>bn.X.bind(bn));ue--;var ft={toValue:ai};switch(ue=bt.map((bn,$n)=>{var mn=`argFromPtr${$n}`;return ft[mn]=bn,`${mn}(args${$n?"+"+8*$n:""})`}),xe){case 0:var Et="toValue(handle)";break;case 2:Et="new (toValue(handle))";break;case 3:Et="";break;case 1:ft.getStringOrSymbol=Ce,Et="toValue(handle)[getStringOrSymbol(methodName)]"}return Et+=`(${ue})`,Se.oa||(ft.toReturnWire=ne,ft.emval_returnValue=jg,Et=`return emval_returnValue(toReturnWire, destructorsRef, ${Et})`),Et=`return function (handle, methodName, destructorsRef, args) {
  5632. ${Et}
  5633. }`,xe=new Function(Object.keys(ft),Et)(...Object.values(ft)),Et=`methodCaller<(${We.map(bn=>bn.name)}) => ${Se.name}>`,IO(Ct(Et,xe))},F:Di,p:(ue,ne,xe,Se,We)=>AT[ue](ne,xe,Se,We),E:ue=>{var ne=ai(ue);H(ne),Di(ue)},t:(ue,ne,xe,Se)=>{var We=new Date().getFullYear(),bt=new Date(We,0,1).getTimezoneOffset();We=new Date(We,6,1).getTimezoneOffset(),P[ue>>2]=60*Math.max(bt,We),w[ne>>2]=+(bt!=We),ne=ft=>{var Et=Math.abs(ft);return`UTC${0<=ft?"-":"+"}${String(Math.floor(Et/60)).padStart(2,"0")}${String(Et%60).padStart(2,"0")}`},ue=ne(bt),ne=ne(We),We<bt?(ur(ue,xe,17),ur(ne,Se,17)):(ur(ue,Se,17),ur(ne,xe,17))},z:ue=>{var ne=T.length;if(ue>>>=0,2147483648<ue)return!1;for(var xe=1;4>=xe;xe*=2){var Se=ne*(1+.2/xe);Se=Math.min(Se,ue+100663296);e:{Se=(Math.min(2147483648,65536*Math.ceil(Math.max(ue,Se)/65536))-Mc.buffer.byteLength+65535)/65536|0;try{Mc.grow(Se),v();var We=1;break e}catch{}We=void 0}if(We)return!0}return!1},u:(ue,ne)=>{var xe=0,Se=0,We;for(We of Kt()){var bt=ne+xe;P[ue+Se>>2]=bt,xe+=ur(We,bt,1/0)+1,Se+=4}return 0},v:(ue,ne)=>{var xe=Kt();P[ue>>2]=xe.length,ue=0;for(var Se of xe)ue+=Qd(Se)+1;return P[ne>>2]=ue,0},w:()=>52,x:function(){return 70},l:(ue,ne,xe,Se)=>{for(var We=0,bt=0;bt<xe;bt++){var ft=P[ne>>2],Et=P[ne+4>>2];ne+=8;for(var bn=0;bn<Et;bn++){var $n=ue,mn=T[ft+bn],Fr=Mi[$n];mn===0||mn===10?($n=$n===1?p:g,mn=Pc(Fr,0),mn=Nr.decode(Fr.buffer?Fr.subarray(0,mn):new Uint8Array(Fr.slice(0,mn))),$n(mn),Fr.length=0):Fr.push(mn)}We+=Et}return P[Se>>2]=We,0}},vy;return vy=await(async function(){function ue(xe){return xe=vy=xe.exports,Ho=xe.J,Oc=r._malloc=xe.K,ys=r._free=xe.L,Mc=xe.G,xT=xe.I,v(),vy}var ne={a:Ja};return r.instantiateWasm?new Promise(xe=>{r.instantiateWasm(ne,(Se,We)=>{xe(ue(Se))})}):(M??(M=A(`\0asm\0\0\0\xD79\`\x7F\x7F\`\x7F\x7F\0\`\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\`\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\0\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\0\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~~~~\0\`\0\x7F\`
  5634. \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F~\x7F\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F~~\x7F\0\`\x7F~\x7F~\`\x7F\x7F~\x7F\x7F\0\`
  5635. \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\f\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F~\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\v\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F~\`\x7F|\x7F\x7F\x7F\x7F\x7F\`\x07\x7F\x7F\x7F\x7F\x7F~~\x7F\`\x7F\x7F\x7F\x7F~~\x7F\`\x7F\x7F\x7F\x7F|\x7F\`\r\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F~~\0\`\x7F\x7F\x7F\x7F\x7F|\`\x7F~\x7F\x7F\x7F\`\x7F~\0\`\x7F|\0\`~~~~\x7F\`~\x7F\x7F\`\x7F\x7F\x7F~\x7F\0\`\x7F\x7F\x7F~~\`~~|\`\x7F|\`\x7F\x7F\x7F|\`\x7F\x7F\x7F}\`\x7F\x7F~\0\`~~}\`\x7F\x7F~\`\x7F~~~\0\`~~~\x7F\`|\x7F|\`\x7F\x7F\x7F}\x7F\`\x7F\x7F\x7F}\0\`\x7F\x7F}\0\xC1 aa\0\x07ab\0ac\0
  5636. ad\0\x07ae\0af\0\x07ag\0\vah\0ai\0\vaj\0\bak\0"al\0am\0an\0\x07ao\0#ap\0$aq\0ar\0as\0
  5637. at\0\bau\0av\0aw\0\0ax\0%ay\0\raz\0\0aA\0aB\0aC\0\baD\0aE\0aF\0\x8D\x8B\0\0\0\0\r\x07\0\b
  5638. \0\0\0\0\0\0\0\0\0\0\0&\0\0 \0\0\0'\0\f\f\0\r(\x07\r\x07\0\0\0\0\0)\0 \x07\x07\0\r
  5639. \0\0\0*
  5640. \r\0\0
  5641. \v\b\x07\0\0
  5642. 
  5643. \b\0+\0\0,\x07-\0\r\0\x07\b\0\x07\b\x07\x07\x07\0\0 \f\f \f\f\0 \f\0\0\0\x1B\x1B\0\0
  5644. \0\0\x07\v
  5645. \v\v
  5646. \v\v\0\r\b./\x07\0012\b34\0 \0\0\0\0\0\0\b\0\b\0 5\0\b\x07678\x07\x07\v\v\v
  5647. \b\b\b\x07\0\0\0\0\0\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\0\0\0 \0 \f\f\x07 \0 \x07\v\v\0\f\f !  !  \0\b\b \b \0\0\b\0\0\0\0\0\0\0\0\0\0\b\0\r\x07p\xFD\xFD\x07\x82\x80\x80\b\x7FA\xC0\xEC\v\x07\x1BG\0H\0\xAAI\0J\0\xD4K\0/L\0! \xAE\0A\v\xFC\x95\xF3\xEF\xD4\xCD\xC9\x81\xFA\xBE\xB7\xAE\xA5\x9D\x9B\x81\xFA\x91\x87\xFC\xF1\xEF\xEE\xEA\xD8\xD7\xE1\xE0\xDF\xDE\xDD,\xD8\xD7\xD5\xDC\xDB\xD3\xDA\xD9\xD5\xD8\xD7\xD3\xD6\xD5\xCC\xD3\xD28\xA9\xA8\xA7\xA6\xC3\xA3\xC2\xA2\xA1\xA088\x9F\x9E\x9D\xC6\x9C\xC6\xB0\x8C\x8D\x8B\x90\x8F\x8E\x81\xC0\x8A\x89\x88\x87\x95\xC1\x94\x92\x93\x91\x9B\xC5\x9A\x99\x98\xC1\x97\x96K\x86\x85\x84\xA0!\xF2\x8D\x8B\x89\x86\x84\x82\x80\xFE\xFB\xF9\xF7\xF5\xF3\xF0\xF5\xBD\xBC\xF0\xAF\xAD\xAC\xAB\xAA\xF1\xA9\xA8\xA7\xF6\xA4\xA3\xA2\xA1\xA08\x9F\x9E\xE6\x9C\x99\x97\x95\x93\x90\xE5\x9A\x98\x96\x94\x92\x8Fq,,\xBB\xBA\xB9\xB8\xB6\xB5\xB4\xB3\xF1\xB2\xB1\xB0,\xEF\xEF{\xA1\xA1\xA6\xA1,\xEC\xEB{88\xEA\x8B,\xEC\xEB{88\xEA\x8B,\xE9\xE8{88\xE7\x8B,\xE9\xE8{88\xE7\x8Bq,\x83\x82\x81q,\x80\xFF\xFE,\xFD\xFC\xFB\xFA\x9E\x9E\xF9\xF8\xF7\xF6\xF5,\xF4\xF2\xF1\xF0\x97\x97\xEE\xED\xEC\xEB\xEA,\xE9\xE8\xE7\xE6\xE5\xE4\xE3\xE2,\xE1\xE0\xDF\xDE\xDD\xDC\xDB\xDAq,\x8F\xD9\xD8\xD7\xD6\xD5\xD3\x8E\x8A\x85\xF8\xF4\x81\xFDq,\x8F\xD2\xD1\xD0\xCF\xCE\xCC\x8C\x88\x83\xF6\xF2\xFF\xFA\xAE\xE4\xCB\xAE\xE4\xCA,\x8E\x8EFFF\x878[[,\x8E\x8EFFF\x878[[,\x8D\x8DFFF\x868[[,\x8D\x8DFFF\x868[[,\xC8\xC7,\xC6\xC5,\xC4\xC3,\xC2\xC1,\xF7\xC0\xC2,\xF7\xBF\xC2\xA4\xA5q,\xA0\xA0\xDB,\xDB,\xED\xE2\xE5\xEC,\xE3\xE6\xEB,\xE4\xE7\xE9,\xE8\f(
  5648. \xC9\xCB\b\x8B\0 \0,\0\vA\0H@ \0(\b \0(\0!\v \0\v\x82\f\b\x7F@ \0E\r\0 \0A\bk" \0Ak(\0"Axq"\0j!@ Aq\r\0 AqE\r  (\0"k"A\x8C\xD8(\0I\r \0 j!\0@@@A\x90\xD8(\0 G@ (\f! A\xFFM@  (\b"G\rA\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v (!\x07  G@ (\b" 6\f  6\b\f\v ("\x7F Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v ("AqAG\rA\x84\xD8 \x006\0  A~q6  \0Ar6  \x006\0\v  6\f  6\b\f\vA\0!\v \x07E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@  \x07(F@ \x07 6\f\v \x07 6\v E\r\v  \x076 ("@  6  6\v ("E\r\0  6  6\v  O\r\0 ("AqE\r\0@@@@ AqE@A\x94\xD8(\0 F@A\x94\xD8 6\0A\x88\xD8A\x88\xD8(\0 \0j"\x006\0  \0Ar6 A\x90\xD8(\0G\rA\x84\xD8A\x006\0A\x90\xD8A\x006\0\vA\x90\xD8(\0"\x07 F@A\x90\xD8 6\0A\x84\xD8A\x84\xD8(\0 \0j"\x006\0  \0Ar6 \0 j \x006\0\v Axq \0j!\0 (\f! A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v  6\f  6\b\f\v (!\b  G@ (\b" 6\f  6\b\f\v ("\x7F Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v  A~q6  \0Ar6 \0 j \x006\0\f\vA\0!\v \bE\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@  \b(F@ \b 6\f\v \b 6\v E\r\v  \b6 ("@  6  6\v ("E\r\0  6  6\v  \0Ar6 \0 j \x006\0  \x07G\r\0A\x84\xD8 \x006\0\v \0A\xFFM@ \0A\xF8qA\xA4\xD8j!\x7FA\xFC\xD7(\0"A \0Avt"\0qE@A\xFC\xD7 \0 r6\0 \f\v (\b\v!\0  6\b \0 6\f  6\f  \x006\b\vA! \0A\xFF\xFF\xFF\x07M@ \0A& \0A\bvg"kvAq AtrA>s!\v  6 B\x007 AtA\xAC\xDAj!\x7F@\x7FA\x80\xD8(\0"A t"qE@A\x80\xD8  r6\0  6\0A!A\b\f\v \0A AvkA\0 AG\x1Bt! (\0!@ "(Axq \0F\r Av! At!  Aqj"("\r\0\v  6A! !A\b\v!\0 "\f\v (\b" 6\f  6\bA!\0A\b!A\0\v!  j 6\0  6\f \0 j 6\0A\x9C\xD8A\x9C\xD8(\0Ak"\0A\x7F \0\x1B6\0\v\v\xA0\x7F \0( \0,\0\v" A\0H\x1B" I@  k"@\x7F  \0(\b"A\xFF\xFF\xFF\xFF\x07qAkA
  5649. \0,\0\v"A\0H"\x1B" \0(  \x1B"kM@ Av\f\v \0   j k  \xA4 \0-\0\v\v! \0(\0 \0 \xC0A\0H\x1B" j! !@ @ A\0:\0\0 Ak! Aj!\f\v\v  j!@ \0,\0\vA\0H@ \0 6\f\v \0 A\xFF\0q:\0\v\v  jA\0:\0\0\v\v@ \0,\0\vA\0H@ \0 6 \0(\0!\0\f\v \0 A\xFF\0q:\0\v\v \0 jA\0:\0\0\v0\x7F@ \0A\xEC\xDEF\r\0 \0 \0("Ak6 \r\0 \0 \0(\0(\b\0\v\v%\0 \0 ("\x006\0 \0A\xEC\xDEG@ \0 \0(Aj6\v\v\x8B\x7F~@ \0)p"PE  \0)x \0(" \0(,"k\xAC|"WqE@#\0Ak"$\0A\x7F!@ \0\xC8\r\0 \0 AjA \0( \0AG\r\0 -\0!\v Aj$\0 "A\0N\r \0(! \0(,!\v \0B\x7F7p \0 6h \0   k\xAC|7xA\x7F\v B|! \0(! \0(\b!@ \0)p"P\r\0  }"  k\xACY\r\0  \xA7j!\v \0 6h \0  \0(,"\0 k\xAC|7x \0 O@ Ak :\0\0\v \v\xB1\x7F@ \xA5" \0(\b"A\xFF\xFF\xFF\xFF\x07qAkA \0,\0\v"A\0H"\x1B"M@ \0(\0 \0 \x1B!@ \x7F At"@   \xFC
  5650. \0\0\v \0,\0\v Av\v\xC0A\0H@ \0 6\f\v \0 A\xFF\0q:\0\v\v  AtjA\x006\0\f\v \0   k \0(  \x1B"\0A\0 \0  \xDE\v\v\r\0 \0  y\xE0\v\0 \0\xBC \xBCsAs\v\0 \0\xBD \xBDsAs\v\xE5\x7FA\xE8\xDE-\0\0@A\xE4\xDE(\0\v#\0A k"$\0@@@ A\bj" \0At"j\x7FA \0tA\xFF\xFF\xFF\xFF\x07q"ArE@ (\0\f\v \0A\xAFA\xD7 \x1B\xBB\v"6\0 A\x7FF\r \0Aj"\0AG\r\0\vA\0\xBAE@A\xF8\xFC\0! A\xF8\xFC\0AhE\rA\x90\xFD\0! A\x90\xFD\0AhE\rA\0!\0A\xA8\xDC-\0\0E@@ \0At \0A\xD7\xBB6\xF8\xDB \0Aj"\0AG\r\0\vA\xA8\xDCA:\0\0A\x90\xDCA\xF8\xDB(\x006\0\vA\xF8\xDB! A\bj"\0A\xF8\xDBAhE\rA\x90\xDC! \0A\x90\xDCAhE\rA/"E\r\v  )7  )7\b  )\b7\0\f\vA\0!\v A j$\0A\xE8\xDEA:\0\0A\xE4\xDE 6\0 \v\xCB
  5651. \x7F ~#\0A\xE0\0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!
  5652.  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83"\fB \x88! B0\x88\xA7A\xFF\xFFq!\x07@@ B0\x88\xA7A\xFF\xFFq" A\xFF\xFFkA\x82\x80~O@ \x07A\xFF\xFFkA\x81\x80~K\r\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"\rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T \rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\v\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\v !\f\v  \rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\vB\0!\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  \r\x84B\0!P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\v\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\v\f\v  \r\x84P@B\0!\f\v  \x84P@B\0!\f\v \rB\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xD0\0j  \f  \f \fP"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )X"\fB \x88! )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A@k 
  5653. 
  5654. P"\b\x1ByB\xC0\0B\0 \b\x1B|\xA7"\bAk6  \bkAj! )H!
  5655. )@!\v \x07 j jA\xFF\xFF\0k!@
  5656. B\x86"B \x88B\x80\x80\x80\x80\b\x84" B \x88"~" B\x86"B \x88"
  5657. B\x80\x80\x84"\r~|" T\xAD  B1\x88 \x84B\xFF\xFF\xFF\xFF\x83" \fB\xFF\xFF\xFF\xFF\x83"\f~|" T\xAD|  \r~|   B\x80\x80\xFE\xFF\x83" \f~" 
  5658. ~|" T\xAD    B\xFF\xFF\xFF\xFF\x83"~|"V\xAD||"V\xAD|  \r~"  \f~|" T\xADB \x86 B \x88\x84|   B \x86|"V\xAD|  \r ~"\r
  5659. \f~|"\f  ~|"  ~|"B \x88  V\xAD \f \rT\xAD  \fT\xAD||B \x86\x84|" T\xAD|    ~"\f 
  5660. ~|"B \x88  \fT\xADB \x86\x84|"
  5661. T\xAD
  5662. B \x86|"
  5663. T\xAD||"
  5664. T\xAD|
  5665.  B \x86"  ~|" T\xAD|" T\xAD|"
  5666. T\xAD|"B\x80\x80\x80\x80\x80\x80\xC0\0\x83PE@ Aj!\f\v B?\x88 B\x86 B?\x88\x84! B\x86 B?\x88\x84! B\x86! B\x86\x84!\v A\xFF\xFFN@ \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v~ A\0L@A k"\x07A\xFF\0M@ A0j   A\xFF\0j"6 A j   6 Aj   \x07g    \x07g )0 )8\x84B\0R\xAD ) )\x84\x84! )( )\x84! )\0! )\b\f\vB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84\v \v\x84!\v P B\0Y B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FQ\x1BE@ \v B|"P\xAD|!\v\f\v  B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84PE@ !\f\v \v  B\x83|" T\xAD|!\v\v \0 7\0 \0 \v7\b A\xE0\0j$\0\v\0 \0!\vr\x7F#\0Ak"$\0  \x006 \0(\0A\x7FG@  Aj6\f  A\fj6\b A\bj!@ \0(\0AF\r\0\v \0(\0E@ \0A6\0 \xF2 \0A\x7F6\0\v\v \0( Aj$\0Ak\v\xB2\x7F#\0Ak"$\0 \0 \0(Aj6  \x006\f@A\xF8\xDE(\0A\xF4\xDE(\0"\0kAu M\x7F@ Aj"\0A\xF8\xDE(\0A\xF4\xDE(\0"kAu"K@#\0A k"\x07$\0@ \0 k"A\xFC\xDE(\0A\xF8\xDE(\0"kAuM@A\xF4\xDE \xB9\f\v A\xF4\xDE(\0kAu j"\0A\x80\x80\x80\x80O@0\0\vA\xFF\xFF\xFF\xFFA\xFC\xDE(\0A\xF4\xDE(\0k"Au" \0 \0 I\x1B A\xFC\xFF\xFF\xFF\x07O\x1B!A\xF8\xDE(\0A\xF4\xDE(\0kAu!A\0! \x07A\fj"\0A\x80\xDF6 \0A\x006\f @A\x80\xDF \xE3!\v \0 6\0 \0  Atj"6\b \0  Atj6\f \0 6 \0 \xCFA\xF4\xDE \0\x96 \0\xD4 \0(\0"@ \0(\f \0( \xE2\v\v \x07A j$\0\f\v \0 I@A\xF8\xDE  \0Atj6\0\v\vA\xF4\xDE(\0 \0\v Atj(\0"\0E\r\0 \0 \0("Ak6 \r\0 \0 \0(\0(\b\0\v (\f!\0 A\x006\fA\xF4\xDE(\0 Atj \x006\0 (\f!\0 A\x006\f@ \0E\r\0 \0 \0("Ak6 \r\0 \0 \0(\0(\b\0\v Aj$\0\v\xBC(\v\x7F#\0Ak"
  5667. $\0@@@@@@@@@@ \0A\xF4M@A\xFC\xD7(\0"A \0A\vjA\xF8q \0A\vI\x1B"Av"\0v"Aq@@ A\x7FsAq \0j"At"A\xA4\xD8j"\0 (\xAC\xD8"(\b"F@A\xFC\xD7 A~ wq6\0\f\v  \x006\f \0 6\b\v A\bj!\0  Ar6  j" (Ar6\f\v\v A\x84\xD8(\0"\bM\r @@A \0t"A\0 kr  \0tqh"At"A\xA4\xD8j" (\xAC\xD8"\0(\b"F@A\xFC\xD7 A~ wq"6\0\f\v  6\f  6\b\v \0 Ar6 \0 j"\x07  k"Ar6 \0 j 6\0 \b@ \bAxqA\xA4\xD8j!A\x90\xD8(\0!\x7F A \bAvt"qE@A\xFC\xD7  r6\0 \f\v (\b\v!  6\b  6\f  6\f  6\b\v \0A\bj!\0A\x90\xD8 \x076\0A\x84\xD8 6\0\f\v\vA\x80\xD8(\0"\vE\r \vhAt(\xAC\xDA"(Axq k! !@@ ("\0E@ ("\0E\r\v \0(Axq k"   I"\x1B! \0  \x1B! \0!\f\v\v (!  (\f"\0G@ (\b" \x006\f \0 6\b\f
  5668. \v ("\x7F Aj ("E\r Aj\v!@ !\x07 "\0Aj! \0("\r\0 \0Aj! \0("\r\0\v \x07A\x006\0\f \vA\x7F! \0A\xBF\x7FK\r\0 \0A\vj"Axq!A\x80\xD8(\0"\x07E\r\0A!\bA\0 k! \0A\xF4\xFF\xFF\x07M@ A& A\bvg"\0kvAq \0AtkA>j!\b\v@@@ \bAt(\xAC\xDA"E@A\0!\0\f\vA\0!\0 A \bAvkA\0 \bAG\x1Bt!@@ (Axq k" O\r\0 ! "\r\0A\0! !\0\f\v \0 ("   AvAqj("F\x1B \0 \x1B!\0 At! \r\0\v\v \0 rE@A\0!A \bt"\0A\0 \0kr \x07q"\0E\r \0hAt(\xAC\xDA!\0\v \0E\r\v@ \0(Axq k" I!   \x1B! \0  \x1B! \0("\x7F  \0(\v"\0\r\0\v\v E\r\0 A\x84\xD8(\0 kO\r\0 (!\b  (\f"\0G@ (\b" \x006\f \0 6\b\f\b\v ("\x7F Aj ("E\r Aj\v!@ ! "\0Aj! \0("\r\0 \0Aj! \0("\r\0\v A\x006\0\f\x07\v A\x84\xD8(\0"M@A\x90\xD8(\0!\0@  k"AO@ \0 j" Ar6 \0 j 6\0 \0 Ar6\f\v \0 Ar6 \0 j" (Ar6A\0!A\0!\vA\x84\xD8 6\0A\x90\xD8 6\0 \0A\bj!\0\f \v A\x88\xD8(\0"I@A\x88\xD8  k"6\0A\x94\xD8A\x94\xD8(\0"\0 j"6\0  Ar6 \0 Ar6 \0A\bj!\0\f \vA\0!\0 A/j"\x7FA\xD4\xDB(\0@A\xDC\xDB(\0\f\vA\xE0\xDBB\x7F7\0A\xD8\xDBB\x80\xA0\x80\x80\x80\x807\0A\xD4\xDB
  5669. A\fjApqA\xD8\xAA\xD5\xAAs6\0A\xE8\xDBA\x006\0A\xB8\xDBA\x006\0A\x80 \v"j"A\0 k"\x07q" M\r\bA\xB4\xDB(\0"@A\xAC\xDB(\0"\b j" \bM  Ir\r \v@A\xB8\xDB-\0\0AqE@@@@@A\x94\xD8(\0"@A\xBC\xDB!\0@ \0(\0"\b M@  \b \0(jI\r\v \0(\b"\0\r\0\v\vA\0v"A\x7FF\r !A\xD8\xDB(\0"\0Ak" q@  k  jA\0 \0kqj!\v  M\rA\xB4\xDB(\0"\0@A\xAC\xDB(\0" j"\x07 M \0 \x07Ir\r\v v"\0 G\r\f\v  k \x07q"v" \0(\0 \0(jF\r !\0\v \0A\x7FF\r A0j M@ \0!\f\vA\xDC\xDB(\0"  kjA\0 kq"vA\x7FF\r  j! \0!\f\v A\x7FG\r\vA\xB8\xDBA\xB8\xDB(\0Ar6\0\v v"A\x7FFA\0v"\0A\x7FFr \0 Mr\r \0 k" A(jM\r\vA\xAC\xDBA\xAC\xDB(\0 j"\x006\0A\xB0\xDB(\0 \0I@A\xB0\xDB \x006\0\v@A\x94\xD8(\0"@A\xBC\xDB!\0@  \0(\0" \0("jF\r \0(\b"\0\r\0\v\f\vA\x8C\xD8(\0"\0A\0 \0 M\x1BE@A\x8C\xD8 6\0\vA\0!\0A\xC0\xDB 6\0A\xBC\xDB 6\0A\x9C\xD8A\x7F6\0A\xA0\xD8A\xD4\xDB(\x006\0A\xC8\xDBA\x006\0@ \0At" A\xA4\xD8j"6\xAC\xD8  6\xB0\xD8 \0Aj"\0A G\r\0\vA\x88\xD8 A(k"\0Ax kA\x07q"k"6\0A\x94\xD8  j"6\0  Ar6 \0 jA(6A\x98\xD8A\xE4\xDB(\x006\0\f\v  M  Kr\r \0(\fA\bq\r \0  j6A\x94\xD8 Ax kA\x07q"\0j"6\0A\x88\xD8A\x88\xD8(\0 j" \0k"\x006\0  \0Ar6  jA(6A\x98\xD8A\xE4\xDB(\x006\0\f\vA\0!\0\f\vA\0!\0\f\vA\x8C\xD8(\0 K@A\x8C\xD8 6\0\v  j!A\xBC\xDB!\0@@  \0(\0"G@ \0(\b"\0\r\f\v\v \0-\0\fA\bqE\r\vA\xBC\xDB!\0@@ \0(\0" M@   \0(j"I\r\v \0(\b!\0\f\v\vA\x88\xD8 A(k"\0Ax kA\x07q"k"\x076\0A\x94\xD8  j"6\0  \x07Ar6 \0 jA(6A\x98\xD8A\xE4\xDB(\x006\0  A' kA\x07qjA/k"\0 \0 AjI\x1B"A\x1B6 A\xC4\xDB)\x007 A\xBC\xDB)\x007\bA\xC4\xDB A\bj6\0A\xC0\xDB 6\0A\xBC\xDB 6\0A\xC8\xDBA\x006\0 Aj!\0@ \0A\x076 \0A\bj \0Aj!\0 I\r\0\v  F\r\0  (A~q6   k"Ar6  6\0\x7F A\xFFM@ A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7  r6\0 \0\f\v \0(\b\v! \0 6\b  6\fA\f!A\b\f\vA!\0 A\xFF\xFF\xFF\x07M@ A& A\bvg"\0kvAq \0AtrA>s!\0\v  \x006 B\x007 \0AtA\xAC\xDAj!@@A\x80\xD8(\0"A \0t"qE@A\x80\xD8  r6\0  6\0\f\v A \0AvkA\0 \0AG\x1Bt!\0 (\0!@ "(Axq F\r \0Av! \0At!\0  Aqj"("\r\0\v  6\v  6A\b! "!\0A\f\f\v (\b"\0 6\f  6\b  \x006\bA\0!\0A!A\f\v j 6\0  j \x006\0\vA\x88\xD8(\0"\0 M\r\0A\x88\xD8 \0 k"6\0A\x94\xD8A\x94\xD8(\0"\0 j"6\0  Ar6 \0 Ar6 \0A\bj!\0\f\vA\xF8\xD7A06\0A\0!\0\f\v \0 6\0 \0 \0( j6 Ax kA\x07qj"\b Ar6 Ax kA\x07qj"  \bj"k!\x07@A\x94\xD8(\0 F@A\x94\xD8 6\0A\x88\xD8A\x88\xD8(\0 \x07j"\x006\0  \0Ar6\f\vA\x90\xD8(\0 F@A\x90\xD8 6\0A\x84\xD8A\x84\xD8(\0 \x07j"\x006\0  \0Ar6 \0 j \x006\0\f\v ("\0AqAF@ \0Axq! (\f!@ \0A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ \0Avwq6\0\f\v  6\f  6\b\f\v (!@  G@ (\b"\0 6\f  \x006\b\f\v@ ("\0\x7F Aj ("\0E\r Aj\v!@ ! \0"Aj! \0("\0\r\0 Aj! ("\0\r\0\v A\x006\0\f\vA\0!\v E\r\0@ ("\0At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ \0wq6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("\0@  \x006 \0 6\v ("\0E\r\0  \x006 \0 6\v \x07 j!\x07  j"(!\0\v  \0A~q6  \x07Ar6  \x07j \x076\0 \x07A\xFFM@ \x07A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A \x07Avt"qE@A\xFC\xD7  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA! \x07A\xFF\xFF\xFF\x07M@ \x07A& \x07A\bvg"\0kvAq \0AtrA>s!\v  6 B\x007 AtA\xAC\xDAj!\0@@A\x80\xD8(\0"A t"qE@A\x80\xD8  r6\0 \0 6\0\f\v \x07A AvkA\0 AG\x1Bt! \0(\0!@ "\0(Axq \x07F\r Av! At! \0 Aqj"("\r\0\v  6\v  \x006  6\f  6\b\f\v \0(\b" 6\f \0 6\b A\x006  \x006\f  6\b\v \bA\bj!\0\f\v@ \bE\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \x07A~ wq"\x076\0\f\v@  \b(F@ \b \x006\f\v \b \x006\v \0E\r\v \0 \b6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 A\xFFM@ A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA!\0 A\xFF\xFF\xFF\x07M@ A& A\bvg"\0kvAq \0AtrA>s!\0\v  \x006 B\x007 \0AtA\xAC\xDAj!@@ \x07A \0t"qE@A\x80\xD8  \x07r6\0  6\0  6\f\v A \0AvkA\0 \0AG\x1Bt!\0 (\0!@ "(Axq F\r \0Av! \0At!\0  Aqj"\x07("\r\0\v \x07 6  6\v  6\f  6\b\f\v (\b"\0 6\f  6\b A\x006  6\f  \x006\b\v A\bj!\0\f\v@ E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \vA~ wq6\0\f\v@  (F@ \x006\f\v \x006\v \0E\r\v \0 6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 \b@ \bAxqA\xA4\xD8j!\0A\x90\xD8(\0!\x7FA \bAvt"\x07 qE@A\xFC\xD7  \x07r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\vA\x90\xD8 6\0A\x84\xD8 6\0\v A\bj!\0\v
  5670. Aj$\0 \0\v\0\x9C\0\v;\x7F#\0Ak"$\0  \x006\f (\f"\0(\0"@ \0 6 \0(\b !\v Aj$\0\vu~ \0  ~  ~| B \x88" B \x88"~| B\xFF\xFF\xFF\xFF\x83" B\xFF\xFF\xFF\xFF\x83"~"B \x88  ~|"B \x88|  ~ B\xFF\xFF\xFF\xFF\x83|"B \x88|7\b \0 B\xFF\xFF\xFF\xFF\x83 B \x86\x847\0\v\xC1\x7F \0-\0\0A qE@@ \0("\x7F  \0\xC9\r \0(\v \0("k I@ \0   \0($\0\f\v@@ E \0(PA\0Hr\r\0 !@  j"Ak-\0\0A
  5671. G@ Ak"\r\f\v\v \0   \0($\0 I\r  k! \0(!\f\v !\v   Y \0 \0( j6\v\v\v\x7FA9" \0(\x006\0 \v\xC0\x7F@  kAH\r\0 \0( \0,\0\v" A\0H\x1BE\r\0  \x8F \0(\0 \0 \0,\0\v"A\0H"\x1B" \0(  \x1Bj! Ak!\0@@@ -\0\0"Ak! \0 M\r\0 A\xFFqA\xFD\0M@ (\0 G\r\v Aj!   kAJj!\f\v\v A\xFFqA\xFD\0K\r \0(\0Ak I\r\v A6\0\v\vP~@ A\xC0\0q@  A@j\xAD\x86!B\0!\f\v E\r\0  \xAD"\x86 A\xC0\0 k\xAD\x88\x84!  \x86!\v \0 7\0 \0 7\b\vi\x7F#\0A\x80k"$\0 A\x80\xC0q  LrE@    k"A\x80 A\x80I"\x1B\xC6 E@@ \0 A\x803 A\x80k"A\xFFK\r\0\v\v \0  3\v A\x80j$\0\v\0A\0\v<\x7FA \0 \0AM\x1B!@@ /"\0\r\0A\xB4\xEC(\0"E\r\0 \r\0\f\v\v \0E@0\0\v \0\v \0 \0(\0C\v
  5672. \0 \0(\0A\xC0\v\xCD \x7F~#\0A\xF0\0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83! @@ P" B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"
  5673. B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}B\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FT
  5674. P\x1BE@ B\0R B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}"\vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FV \vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FQ\x1B\r\v 
  5675. B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T
  5676. B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84! !\f\v P B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\v 
  5677. B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0   \x85  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84P"\x1B!B\0  \x1B!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P\r 
  5678. \x84P@  \x84B\0R\r  \x83!  \x83!\f\v  \x84PE\r\0 ! !\f\v    T
  5679. V
  5680. Q\x1B"\b\x1B!
  5681.   \b\x1B"\fB\xFF\xFF\xFF\xFF\xFF\xFF?\x83!   \b\x1B"\vB0\x88\xA7A\xFF\xFFq!\x07 \fB0\x88\xA7A\xFF\xFFq"E@ A\xE0\0j
  5682. P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6 )h! )\`!
  5683. A k!\v   \b\x1B! \vB\xFF\xFF\xFF\xFF\xFF\xFF?\x83! \x07~  A\xD0\0j     P"\x07\x1ByB\xC0\0B\0 \x07\x1B|\xA7"\x07Ak6A \x07k!\x07 )P! )X\vB\x86 B=\x88\x84B\x80\x80\x80\x80\x80\x80\x80\x84! B\x86
  5684. B=\x88\x84  \x85!~ B\x86"  \x07F\r\0  \x07k"\x07A\xFF\0K@B\0!B\f\v A@k  A\x80 \x07k6 A0j   \x07g )8! )0 )@ )H\x84B\0R\xAD\x84\v! B\x80\x80\x80\x80\x80\x80\x80\x84!\v
  5685. B\x86!
  5686. @ B\0S@B\0!B\0!
  5687. \x85  \v\x85\x84P\r
  5688. }! \v }
  5689. V\xAD}"B\xFF\xFF\xFF\xFF\xFF\xFF\xFFV\r A j     P"\x07\x1ByB\xC0\0B\0 \x07\x1B\x84\xA7A\fk"\x076  \x07k! )(! ) !\f\v
  5690. |" T\xAD  \v||"B\x80\x80\x80\x80\x80\x80\x80\b\x83P\r\0 B\x83 B?\x86 B\x88\x84\x84! Aj! B\x88!\v \fB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83! A\xFF\xFFN@ B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!B\0!\f\vA\0!\x07@ A\0J@ !\x07\f\v Aj   A\xFF\0j6   A kg )\0 ) )\x84B\0R\xAD\x84! )\b!\v B=\x86 B\x88\x84! B\x88B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \x07\xADB0\x86\x84 \x84!@@ \xA7A\x07q"AG@    AK\xAD|"V\xAD|!\f\v    B\x83|"V\xAD|!\f\v E\r\v\v \0 7\0 \0 7\b A\xF0\0j$\0\v
  5691. \0 \0A\x9C\xE0^\v
  5692. \0 \0A\xA4\xE0^\v\x84\x7F~#\0Ak"$\0 \0~ E@B\0\f\v   Au"s k"\xADB\0 g"A\xD1\0j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85A\x9E\x80 k\xADB0\x86|B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FB\0 A\0H\x1B\x84! )\0\v7\0 \0 7\b Aj$\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v -\0\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v -\0\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v (\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v (\0\v\xAA\f\b\x7F\x7FA\0 E\r\0 \0A\x7Fs! AO@@ AqE\r\0 -\0\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Aj! Ak!\f\v \0! !\f\v \0! !\f\v \0! !\v An"\bAll!
  5693. @ \bAk" E@A\0!\f\v !\0A\0!@ \0( \x07s"\x07AvA\xFC\x07q(\xE0S \x07AvA\xFC\x07q(\xE0K \x07AvA\xFC\x07q(\xE0C \x07A\xFFqAt(\xE0;sss!\x07 \0(\f s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0(\b s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0( s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0(\0 s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0Aj!\0 Ak" \r\0\v  \bAljAk!\v 
  5694. j! ( (\f (\b ( (\0 s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 \x07ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s! Aj!\v A\x07K@@ -\0\0 sA\xFFqAt(\xE03 A\bvs"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0\x07 \0sA\xFFqAt(\xE03s! A\bj! A\bk"A\x07K\r\0\v\v@ E\r\0 -\0\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs!\v A\x7Fs\v\v\x97\x7F#\0A@j"$\0 \0 \0(\0"A\bk(\0"j!@ Ak(\0"( (F@A\0  \x1B!\0\f\v \0 N@ B\x007 A\x006  6\f  \x006\b  6 B\x007 B\x007$ B\x007, A\x006< B\x81\x80\x80\x80\x80\x80\x80\x8074  Aj  AA\0 (\0(\v\0 (\r\v B\x007 A\x006 A\x98\xC46\f  \x006\b  6 B\x007 B\x007$ B\x007, B\x007\x003 A\x006< A:\0;  Aj AA\0 (\0(
  5695. \0A\0!\0@@ ((\0\v (A\0 ($AF\x1BA\0 ( AF\x1BA\0 (,AF\x1B!\0\f\v (AG@ (,\r ( AG\r ($AG\r\v (!\0\v A@k$\0 \0\v\0 \0A\x006\b \0B\x007\0\vc\0 (A\xB0q"A F@ \v@ AG\r\0@@ \0-\0\0"A+k\0\0\v \0Aj\v A0G  \0kAHr\r\0 \0-\0A rA\xF8\0G\r\0 \0Aj!\0\v \0\v1\x7FA\xCC\xCF(\0! \0@A\xCC\xCFA\xD4\xCE \0 \0A\x7FF\x1B6\0\vA\x7F  A\xD4\xCEF\x1B\v\0 \0(\0"\0@ \0H\v\vA\x7F \0 7p \0 \0(, \0("k\xAC7x \0 P  \0(\b"\0 k\xACYr\x7F \0  \xA7j\v6h\vs\x7F \0A\x90\xFC\x006\0 \0(@ \0((!@ @A\0 \0 Ak"At" \0($j(\0 \0( j(\0\x07\0\f\v\v \0Aj\xF3 \0( ! \0($! \0(0! \0(<!\v \0\v\xEC\x7F \0E@A\xC8\xCC(\0@A\xC8\xCC(\0L!\vA\xF8\xCD(\0@A\xF8\xCD(\0L r!\vA\xB0\xCE(\0"\0@@ \0(L \0( \0(G@ \0L r!\v \0(8"\0\r\0\v\v \v \0(LA\0H!@@ \0( \0(F\r\0 \0A\0A\0 \0($\0 \0(\r\0A\x7F!\f\v \0(" \0(\b"G@ \0  k\xACA \0((\0\vA\0! \0A\x006 \0B\x007 \0B\x007 \r\0\v \v-\0 E@ \0( (F\v \0 F@A\v \0( (\x9BE\v\xDB\x7F#\0Ak"$\0  6\fA\0!@ \x7FA \0 A\fj(\r\0A A\xC0\0 \0:" (\0(\f\0E\r\0  A\0 (\0(4\0!@@ \0Q A0k! \0 A\fj( AHr\r\0 A\xC0\0 \0:" (\0(\f\0E\r Ak!  A\0 (\0(4\0 A
  5696. lj!\f\v\v \0 A\fj(E\rA\v (\0r6\0\v Aj$\0 \v\xF6\x7F#\0Ak"$\0  6\f@@ \0 A\fj)@A\0!A!\f\vA\0!A! \0;"\x07A\0H\r\0 (\b \x07Atj-\0\0A\xC0\0qE\r\0  \x07A\0 (\0($\0!@@ \0S A0k! \0 A\fj) AHr\r\0 \0;"A\0H\r (\b Atj-\0\0A\xC0\0qE\r Ak!  A\0 (\0($\0 A
  5697. lj!\f\v\v \0 A\fj)E\rA!\v  (\0 r6\0\v Aj$\0 \v\x90\x7F#\0Ak"$\0  6\f  H6\b (\f!#\0Ak"$\0  6\f  6\bA\x7F!@A\0A\0  \x9A"A\0H\r\0 \0 Aj"/"\x006\0 \0E\r\0 \0   (\f\x9A!\v Aj$\0 A\bjI Aj$\0 \v\f\0 \0(\0B \0\v.\0@ \0(A\xCA\0q"\0@ \0A\xC0\0F@A\b\v \0A\bG\rA\vA\0\vA
  5698. \v\f\0 \0(\0@ \0\v\xCE~\x7F#\0Ak"$\0 \xBD"B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07\x83! \0~ B4\x88B\xFF\x83"PE@ B\xFFR@ B\x88! B\x80\xF8\0|! B<\x86\f\v B\x88!B\xFF\xFF! B<\x86\f\v P@B\0!B\0\f\v  B\0 y\xA7"\x07A1j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85!A\x8C\xF8\0 \x07k\xAD! )\0\v7\0 \0 B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83 B0\x86\x84 \x847\b Aj$\0\v\0 \0A\x80\x80\x80\x80O@A\xBFA\0\xDC\0\v \0At9\v\x85\x7F#\0Ak"\b$\0 \b 6\b \b 6\f \bAj" $ =! \b(# A\x006\0A\0!@@  \x07F r\r@ \bA\fj \bA\bj(\r\0@ (\0A\0 (\0(4\0A%F@ Aj \x07F\rA\0!\x7F@ (A\0 (\0(4\0"A\xC5\0F\r\0A!
  5699. A\xFFqA0F\r\0 \f\v A\bj \x07F\rA\b!
  5700. ! (\bA\0 (\0(4\0\v! \b \0 \b(\f \b(\b      \0(\0($\f\x006\f 
  5701. jAj!\f\v A (\0 (\0(\f\0@@ \x07 Aj"G@ A (\0 (\0(\f\0\r\v\v@ \bA\fj \bA\bj(\r A \b(\fC (\0(\f\0E\r \b(\fB\f\0\v\0\v \b(\fC (\0(\0 (\0 (\0(\0F@ \b(\fB Aj!\f\v A6\0\v (\0!\f\v\v A6\0\v \bA\fj \bA\bj(@  (\0Ar6\0\v \b(\f \bAj$\0\v\xB1\x7F#\0Ak"\b$\0 \b 6\b \b 6\f \bAj" $ >! \b(# A\x006\0A\0!@@  \x07F r\r@ \bA\fj \bA\bj)\r\0@ ,\0\0A\0 (\0($\0A%F@ Aj \x07F\rA\0!\x7F@ ,\0A\0 (\0($\0"A\xC5\0F\r\0A!
  5702. A\xFFqA0F\r\0 \f\v Aj \x07F\rA!
  5703. ! ,\0A\0 (\0($\0\v! \b \0 \b(\f \b(\b      \0(\0($\f\x006\f 
  5704. jAj!\f\v@ ,\0\0"A\0H\r\0 (\b" Atj-\0\0AqE\r\0@@ \x07 Aj"F@ \x07!\f\v ,\0\0"A\0H\r\0  Atj-\0\0Aq\r\v\v@ \bA\fj \bA\bj)\r \b(\fA"A\x80q\r (\b A\xFF\0qAtj-\0\0AqE\r \b(\f@\f\0\v\0\v \b(\fA\xC0 (\0(\f\0 ,\0\0 (\0(\f\0F@ \b(\f@ Aj!\f\v A6\0\v (\0!\f\v\v A6\0\v \bA\fj \bA\bj)@  (\0Ar6\0\v \b(\f \bAj$\0\v<\0 \0,\0\vA\0H@ \0(\b \0(\0!\v \0 (\b6\b \0 )\x007\0 A\0:\0\v A\0:\0\0\v\0 @ \0  \xFC
  5705. \0\0\v \0\v\xC3\x7F#\0Ak"\x07$\0@ \0E\r\0 (\f!  k"A\0J@ \0   \0(\0(0\0 G\r\v  k" H@ \x07Aj" k" \xE1 \0 \x07(  \x07,\0A\0H\x1B  \0(\0(0\0!    G\r\v  k"A\0J@ \0   \0(\0(0\0 G\r\v A\x006\f \0!\b\v \x07Aj$\0 \b\v\f\0 \0A\x82\x86\x80 6\0\0\v\xCC\x7F#\0Ak"\x07$\0@ \0E\r\0 (\f!  kAu"A\0J@ \0   \0(\0(0\0 G\r\v  kAu" H@ \x07Aj" k" \xDF \0 \x07(  \x07,\0A\0H\x1B  \0(\0(0\0!    G\r\v  kAu"A\0J@ \0   \0(\0(0\0 G\r\v A\x006\f \0!\b\v \x07Aj$\0 \b\v9\x7F#\0Ak"$\0  6\f  H6\b \0A  (\f\x9A A\bjI Aj$\0\vK\x7F \0(\0!\0 -" \0(\f \0(\b"kAuI\x7F  Atj(\0A\0GA\0\vE@0\0\v \0(\b Atj(\0\v\0 \0A F \0A kAIr\v\xD7\x7F@A\x84\xCC(\0"\0A\0N@ \0E\rA\x84\xCF(\0 \0A\xFF\xFF\xFF\xFFqG\r\v@A\x88\xCC(\0A
  5706. F\r\0A\xCC\xCB(\0"\0A\xC8\xCB(\0F\r\0A\xCC\xCB \0Aj6\0 \0A
  5707. :\0\0\vA\xB8\xCB\x9F\vA\x84\xCCA\x84\xCC(\0"\0A\xFF\xFF\xFF\xFF \0\x1B6\0@@A\x88\xCC(\0A
  5708. F\r\0A\xCC\xCB(\0"\0A\xC8\xCB(\0F\r\0A\xCC\xCB \0Aj6\0 \0A
  5709. :\0\0\f\vA\xB8\xCB\x9F\vA\x84\xCC(\0A\x84\xCCA\x006\0\v+\x7F#\0Ak"$\0  6\fA\xB8\xCB \0 A\0A\0\xD0 Aj$\0\v^\x7F \0A\x006\b \0B\x007\0 (\0! (" k"Au"@ \0 \xA8 \0(! E  FrE@   \xFC
  5710. \0\0\v \0  j6\v \0\v?\x7F@ \0 F\r\0@ \0 Ak"O\r \0-\0\0! \0 -\0\0:\0\0  :\0\0 \0Aj!\0\f\0\v\0\v\v\xDB\x7F~A!@ \0B\0R B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1B\r\0 B\0R B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1B\r\0 \0 \x84  \x84\x84P@A\0\v  \x83B\0Y@ \0 T  S  Q\x1B@A\x7F\v \0 \x85  \x85\x84B\0R\v \0 V  U  Q\x1B@A\x7F\v \0 \x85  \x85\x84B\0R!\v \v'\x7F#\0Ak"$\0  6\f \0A\xE4\0  \x9A Aj$\0\v\xD7\x7F#\0Ak"$\0 \0A\x006#\0Ak"$\0 A\0:\0@ \0 \0(\0"A\fk(\0j"(E@  \0 (H"\x7F \xC4 \0(\0 \vA\fk(\0j(E:\0\f\v A\x99\v Aj$\0A! -\0AF@ \0 \0 \0(\0A\fk(\0j("   (\0( \0"6AA\0  G\x1B!\v \0 \0(\0A\fk(\0j \x99 Aj$\0\vP~@ A\xC0\0q@  A@j\xAD\x88!B\0!\f\v E\r\0 A\xC0\0 k\xAD\x86  \xAD"\x88\x84!  \x88!\v \0 7\0 \0 7\b\vC\x7F@ E\r\0@ \0-\0\0" -\0\0"F@ Aj! \0Aj!\0 Ak"\r\f\v\v  k!\v \v \0A\x97\xD6\0\v\x88\x7F@ \xA5"A\xF7\xFF\xFF\xFFI@@@ AO@ Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\f\v \0 :\0\v E\r\v At"E\r\0 \0  \xFC
  5711. \0\0\v \0 AtjA\x006\0\f\v0\0\v\v\xBB\x7F (\0!\x07A\0 \0(\0" \0(A\xE3\0F"\x1BA\x7FA (\0" k"At  F\x1B A\xFF\xFF\xFF\xFF\x07O\x1B"\b\x9D"@@ E@ \0 6\0\f\v \0(\0! @   \xFC
  5712. \0\0\v \0 6\0 E\r\0  \0(\0 \0(\0!\v \0A\xE4\x006   \x07 kj6\0  \0(\0 \bA|qj6\0\v0\0\vA\x7F#\0Ak"$\0  6\fA\xB0 A\xFC A\xDD,A A\fj"4A\xFC A\xE1,A 4 Aj$\0 \0\v\xFA\x7F#\0Ak"
  5713. $\0
  5714. \x006\f@@@ (\0"\v G\r\0 (\` \0F\x7FA+ \0 (dG\rA-\v!\0  \vAj6\0 \v \0:\0\0\f\v@ \0 G\r\0 ( ,\0\v"\0 \0A\0H\x1BE\r\0A\0!\0 \b(\0" \x07kA\x9FJ\r (\0!\0 \b Aj6\0  \x006\0\f\vA\x7F!\0 A\xE8\0j
  5715. A\fj\xB1 kAu"AJ\r@@@ A\bk\0\0\v  J\r\f\v AG AHr\r\0 (\0" F  kAJr\r Ak-\0\0A0G\rA\0!\0 A\x006\0  Aj6\0  -\0\xD0\x85:\0\0\f\v  (\0"\0Aj6\0 \0 A\xD0\x85j-\0\0:\0\0  (\0Aj6\0A\0!\0\f\vA\0!\0 A\x006\0\v
  5716. Aj$\0 \0\v
  5717. \0 \0A\xE4\xE0^\v\xFC\x7F#\0Ak"
  5718. $\0
  5719. \0:\0@@@ (\0"\v G\r\0 \0A\xFFq"\f -\0F\x7FA+ \f -\0G\rA-\v!\0  \vAj6\0 \v \0:\0\0\f\v@ \0 G\r\0 ( ,\0\v"\0 \0A\0H\x1BE\r\0A\0!\0 \b(\0" \x07kA\x9FJ\r (\0!\0 \b Aj6\0  \x006\0\f\vA\x7F!\0 Aj
  5720. Aj\xB4 k"AJ\r@@@ A\bk\0\0\v  J\r\f\v AG AHr\r\0 (\0" F  kAJr\r Ak-\0\0A0G\rA\0!\0 A\x006\0  Aj6\0  -\0\xD0\x85:\0\0\f\v  (\0"\0Aj6\0 \0 A\xD0\x85j-\0\0:\0\0  (\0Aj6\0A\0!\0\f\vA\0!\0 A\x006\0\v
  5721. Aj$\0 \0\v
  5722. \0 \0A\xDC\xE0^\v\0 \0\vf\x7F~#\0Ak"$\0 \0~ E@B\0\f\v  \xADB\0A\xF0\0 g"Ask6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85A\x9E\x80 k\xADB0\x86|! )\0\v7\0 \0 7\b Aj$\0\v\0 \0A\xDF\0q \0 \0A\xE1\0kAI\x1B\v<\0 \0A\x006\b \0B\x007\0 \0 (\x006\0 \0 (6 \0 (\b6\b A\x006\b B\x007\0\v,\x7F \0A\x006\b \0B\x007\0 \0 (\0" ("  k\xC2 \0\vW\x7F~@A\xCC\xCC(\0"\xAD \0\xADB\x07|B\xF8\xFF\xFF\xFF\x83|"B\xFF\xFF\xFF\xFFX@ \xA7"\0?\0AtM\r \0\r\vA\xF8\xD7A06\0A\x7F\vA\xCC\xCC \x006\0 \v\xA7\x7F \0( \0(\0"kAu" I@#\0A k"$\0@  k" \0(\b \0("kAuM@ \0 \xB9\f\v A\fj \0  \0(\0kAu j\x86 \0( \0(\0kAu \0\xB8" \xCF \0 \x96 \xB5\v A j$\0\v  I@ \0  Atj6\v\vt\x7F~ \0B\x80\x80\x80\x80Z@@ Ak" \0" \0B
  5723. \x80"\0B
  5724. ~}\xA7A0r:\0\0 B\xFF\xFF\xFF\xFF\x9FV\r\0\v\v \0PE@ \0\xA7!@ Ak"  A
  5725. n"A
  5726. lkA0r:\0\0 A K !\r\0\v\v \v}\x7F@@ \0"AqE\r\0 -\0\0E@A\0\v@ Aj"AqE\r -\0\0\r\0\v\f\v@ "Aj!A\x80\x82\x84\b (\0"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xF\r\0\v@ "Aj! -\0\0\r\0\v\v  \0k\v\xBF\x7F \0( \0(\0"k" I@#\0A k"$\0@  k" \0(\b \0("kM@ \0 \x96\f\v  A\fj \0  j \0(\0k\x83 \0( \0(\0k \0\x8C"(\b"j!@  G@ A\0:\0\0 Aj!\f\v\v  6\b \0 \xA9 \x87\v A j$\0\v  I@ \0  j6\v\v\v\0  6\0A\v<\0 \0,\0\vA\0H@ \0(\b \0(\0!\v \0 (\b6\b \0 )\x007\0 A\0:\0\v A\x006\0\vK\x7F#\0Ak"$\0 A\fj" $  n" (\0(\0\x006\0 \0  (\0(\0 (\f# Aj$\0\vD\x7F#\0Ak"$\0 A\fj" \0$ ="\0A\xD0\x85A\xEA\x85  \0(\0(0\0 (\f# Aj$\0 \vK\x7F#\0Ak"$\0 A\fj" $  p" (\0(\0\0:\0\0 \0  (\0(\0 (\f# Aj$\0\v\x7F\x7F@ y"A\xF7\xFF\xFF\xFF\x07I@@@ A\vO@ A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\f\v \0 :\0\v E\r\v E\r\0 \0  \xFC
  5727. \0\0\v \0 jA\0:\0\0\f\vi\0\v\vF\x7F \0A\x80\xFA\0(\0"6\0 \0 A\fk(\0jA\xA0\xFA\0(\x006\0 \0A\xA4\xFA\0(\x006\b \0A\fj\xB0 \0A@kK \0\v\xB5\x07\x7F\x7F \0A\xFF\xFFq! \0Av! AF@  -\0\0j"\0A\xF1\xFFk \0 \0A\xF0\xFFK\x1B"\0 j"At"A\x80\x80<j  A\xF0\xFFK\x1B \0r\f\v \x7F@@@@ AO@@ A\xAF+K@@A\xDB! !\0@  \0-\0\0j" j  \0-\0j"j  \0-\0j"j  \0-\0j"j  \0-\0j"j  \0-\0j"j  \0-\0j"j  \0-\0\x07j"j  \0-\0\bj"j  \0-\0 j"j  \0-\0
  5728. j"j  \0-\0\vj"j  \0-\0\fj"j  \0-\0\rj"j  \0-\0j"j  \0-\0j"j! \0Aj!\0 Ak"\r\0\v A\xF1\xFFp! A\xF1\xFFp! A\xB0+j! A\xB0+k"A\xAF+K\r\0\v E\r AI\r\v@  -\0\0j"\0 j \0 -\0j"\0j \0 -\0j"\0j \0 -\0j"\0j \0 -\0j"\0j \0 -\0j"\0j \0 -\0j"\0j \0 -\0\x07j"\0j \0 -\0\bj"\0j \0 -\0 j"\0j \0 -\0
  5729. j"\0j \0 -\0\vj"\0j \0 -\0\fj"\0j \0 -\0\rj"\0j \0 -\0j"\0j \0 -\0j"j! Aj! Ak"AK\r\0\v E\r\v Aq"\x07\r !\0\f\v@ E\r\0@ Aq"\x07E@ !\0\f\v !\0@ "Aj! \0Ak!\0  -\0\0j" j! Aj" \x07G\r\0\v\v AI\r\0@  -\0\0j" -\0j" -\0j" -\0j"    jjjj! Aj! \0Ak"\0\r\0\v\v A\xF1\xFFpAt A\xF1\xFFk  A\xF0\xFFK\x1Br\f\vA\0! !\0@ "Aj! \0Ak!\0  -\0\0j" j! Aj" \x07G\r\0\v\v AI\r\0@  -\0\0j" -\0j" -\0j" -\0j"    jjjj! Aj! \0Ak"\0\r\0\v\v A\xF1\xFFp! A\xF1\xFFp!\v At rA\v\v\v:\x7F A\0H@\x85\0\vA\xFF\xFF\xFF\xFF\x07 \0(\b \0(\0k"\0At"   I\x1B \0A\xFF\xFF\xFF\xFFO\x1B\v\0 \0("\0A O@ \0\v\v \0A\x9F\f\xD6\0\v>\x7F A\x80\x80\x80\x80O@\x85\0\vA\xFF\xFF\xFF\xFF \0(\b \0(\0k"\0Au"   I\x1B \0A\xFC\xFF\xFF\xFF\x07O\x1B\v?\x7F \0(! \0(\b!@  G@ \0 Ak"6\b\f\v\v \0(\0"@ \0(\f !\v\vI\x7F \0("A\bu! \0(\0"\0  Aq\x7F (\0 j(\0 \v j A Aq\x1B  \0(\0(
  5730. \0\v\xF1\x7FA\xF6\xFF\xFF\xFF\x07 k O@A\xF7\xFF\xFF\xFF\x07!\b \0(\0 \0 \0,\0\vA\0H\x1B! A\xF2\xFF\xFF\xFFM@A\v  j" At"\b  \bK\x1B"A\x07rAj A\vI\x1B!\b\v \b9! @  \xFC
  5731. \0\0\v @  j \x07 \xFC
  5732. \0\0\v   j"
  5733. k"\x07E 
  5734. FrE@  j j  j j \x07\xFC
  5735. \0\0\v A
  5736. G@ !\v \0 6\0 \0 \bA\x80\x80\x80\x80xr6\b \0  j \x07j"\x006 \0 jA\0:\0\0\vi\0\v,\x7F \0 A\xC0\x84=n"At/\xC0\xBB;\0\0 \0Aj  A\xC0\x84=lk\xAB\v\0A\v;\0 \0 6 \0 \x7F 9A\0\v"6\0 \0  j"6\b \0  j6\f \0 6 \0\v\b\0A\xFF\xFF\xFF\xFF\x07\v\0A\xFF\0\v?\x7F@ \0 F\r\0@ \0 Ak"O\r \0(\0! \0 (\x006\0  6\0 \0Aj!\0\f\0\v\0\v\v\xCB \x7F#\0Ak" $\0 =!
  5737. Aj n" (\0(\0@ (\b ,\0"\x07 \x07A\0H\x1BE@
  5738. \0  
  5739. (\0(0\0    \0kAtj"6\0\f\v  6\0@@ \0"\x07-\0\0"\bA+k\0\0\v
  5740. \b\xC0
  5741. (\0(,\0!\x07  (\0"\bAj6\0 \b \x076\0 \0Aj!\x07\v@  \x07kAH\r\0 \x07-\0\0A0G\r\0 \x07-\0A rA\xF8\0G\r\0
  5742. A0
  5743. (\0(,\0!\b  (\0"\vAj6\0 \v \b6\0
  5744. \x07,\0
  5745. (\0(,\0!\b  (\0"\vAj6\0 \v \b6\0 \x07Aj!\x07\v \x07 c  (\0(\0\0!A\0!\vA\0!\b \x07!\x7F  M\x7F  \x07 \0kAtj (\0\x8F (\0@ ("\f Aj"\r ,\0A\0H"\x1B \bj-\0\0E\r\0 \v \f \r \x1B \bj,\0\0G\r\0  (\0"\vAj6\0 \v 6\0A\0!\v \b \b (\b ,\0"\f \fA\0H\x1BAkIj!\b\v
  5746. ,\0\0
  5747. (\0(,\0!\f  (\0"\rAj6\0 \r \f6\0 Aj! \vAj!\v\f\v\v!\v     \0kAtj  F\x1B6\0 Aj  Aj$\0\v\xD0\x7F A\x80q@ \0A+:\0\0 \0Aj!\0\v A\x80\bq@ \0A#:\0\0 \0Aj!\0\v A\x84q"A\x84G@ \0A\xAE\xD4\0;\0\0 \0Aj!\0\v A\x80\x80q!@ -\0\0"@ \0 :\0\0 \0Aj!\0 Aj!\f\v\v \0\x7F@ A\x80G@ AG\rA\xC6\0A\xE6\0 \x1B\f\vA\xC5\0A\xE5\0 \x1B\f\vA\xC1\0A\xE1\0 \x1B A\x84F\r\0A\xC7\0A\xE7\0 \x1B\v:\0\0 A\x84G\v\xB4\x7F~@@@@@@ AkAw\b\0\v \0\x7F  k"AL@A= A\xC0\0 B\x84y\xA7kA\xD1 lA\fv"  At)\xD0\xC2TkAjH\r\v\x7F B\xFF\xFF\xFF\xFFX@  \xA7\xAD\f\v B\x80\xC8\xAF\xA0%Z@  B\x80\xC8\xAF\xA0%\x80"B\x80\xC8\xAF\xA0%~}!  \xA7\xAD!\v  B\x80\xC2\xD7/\x80"\xA7At/\xC0\xBB;\0\0 Aj  B\x80\xC2\xD7/~}\xA7\x8A\v!A\0\v6\f\v \0A\xC0\0 B\x84y\xA7k"  kJ\x7FA=  j"!\x7F BT\x7F@ Ak" \xA7Aq-\0\x91:\0\0 B\x88"B\0R\r\0\vA\0 Ak" \xA7AtA<q(\x90\xBD6\0\0 B\x88!\f\v\v\v6\f\v \0A\xC2\0 B\x84y\xA7kAn"  kJ\x7FA=  j"!\x7F B\xC1\0T\x7F@ Ak" \xA7A\x07q-\0\xFA\x1B:\0\0 B\x88"B\0R\r\0\vA\0 Ak" \xA7AtA\xFE\0q/\xD0\xBD;\0\0 B\x88!\f\v\v\v6\f\v \0A\xC3\0 B\x84y\xA7kAv"  kJ\x7FA=  j"!\x7F B\x81T\x7F@ Ak" \xA7Aq-\0\xD2:\0\0 B\x88"B\0R\r\0\vA\0 Ak" \xA7AtA\xFEq/\xD0\xBE;\0\0 B\b\x88!\f\v\v\v6\f\v\x7F !  l" l\xAD!\b \xAD! \xAD!
  5748.  l\xAD!\x07A\0!\x7F Ar  T\r Ar 
  5749. T\r Ar  \bT\r  \x07T\x7F Aj Aj!  \x07\x80!\f\v\v\v"  kJ@ \0A=6\f\v \xAC!\x07  j"!@ Ak"   \x07\x80" \x07~}\xA7-\0\x80\b:\0\0  \x07Z !\r\0\v \0A\x006 \0 6\0\v \0 6\0\v\xC1 \x7F#\0Ak" $\0 >!
  5750. Aj p" (\0(\0@ (\b ,\0"\x07 \x07A\0H\x1BE@
  5751. \0  
  5752. (\0( \0    \0kj"6\0\f\v  6\0@@ \0"\x07-\0\0"\bA+k\0\0\v
  5753. \b\xC0
  5754. (\0(\0!\x07  (\0"\bAj6\0 \b \x07:\0\0 \0Aj!\x07\v@  \x07kAH\r\0 \x07-\0\0A0G\r\0 \x07-\0A rA\xF8\0G\r\0
  5755. A0
  5756. (\0(\0!\b  (\0"\vAj6\0 \v \b:\0\0
  5757. \x07,\0
  5758. (\0(\0!\b  (\0"\vAj6\0 \v \b:\0\0 \x07Aj!\x07\v \x07 c  (\0(\0\0!A\0!\vA\0!\b \x07!\x7F  M\x7F  \x07 \0kj (\0c (\0@ ("\f Aj"\r ,\0A\0H"\x1B \bj-\0\0E\r\0 \v \f \r \x1B \bj,\0\0G\r\0  (\0"\vAj6\0 \v :\0\0A\0!\v \b \b (\b ,\0"\f \fA\0H\x1BAkIj!\b\v
  5759. ,\0\0
  5760. (\0(\0!\f  (\0"\rAj6\0 \r \f:\0\0 Aj! \vAj!\v\f\v\v!\v     \0kj  F\x1B6\0 Aj  Aj$\0\v\x9A\x7F@@@@@@ AkAw\b\0\v \0\x7F  k"A L@A= A ArgkA\xD1 lA\fv"  At(\x90\xBBIkAjH\r\v  \xAD!A\0\v6\f\v \0A Argk"  kJ\x7FA=  j"!\x7F AI\x7F@ Ak" Aq-\0\x91:\0\0 Av"\r\0\vA\0 Ak" AtA<q(\x90\xBD6\0\0 Av!\f\v\v\v6\f\v \0A" ArgkAn"  kJ\x7FA=  j"!\x7F A\xC1\0I\x7F@ Ak" A\x07q-\0\xFA\x1B:\0\0 Av"\r\0\vA\0 Ak" AtA\xFE\0q/\xD0\xBD;\0\0 Av!\f\v\v\v6\f\v \0A# ArgkAv"  kJ\x7FA=  j"!\x7F A\x81I\x7F@ Ak" Aq-\0\xD2:\0\0 Av"\r\0\vA\0 Ak" AtA\xFEq/\xD0\xBE;\0\0 A\bv!\f\v\v\v6\f\v\x7F !  l"\x07 l! \x07 \x07l!\b\x7F Ar  K\r Ar  \x07I\r Ar  I\r  \bI\x7F Aj Aj!  \bn!\f\v\v\v"  kJ@ \0A=6\f\v  j"!@ Ak"   n" lk-\0\x80\b:\0\0  O !\r\0\v \0A\x006 \0 6\0\v \0 6\0\v\xCB\v\x7F#\0A\xF0\0k"\f$\0 \f 6l \f! @@@  kA\fm"
  5761. A\xE5\0O@
  5762. /"! E\r\v !\x07 !@  F@A\0!\b@ \0 \fA\xEC\0j"(A
  5763. \x1B@ \0 (@  (\0Ar6\0\v@  F\r -\0\0AF\r\x07 Aj! A\fj!\f\0\v\0\v \0:!\r E@  \r (\0(\0!\r\v \bAj!A\0! !\x07 !@  F@ !\b E\r \0Q !\x07 !
  5764. \vjAI\r@  F@\f@ \x07-\0\0AG\r\0 ( ,\0\v" A\0H\x1B \bF\r\0 \x07A\0:\0\0 \vAk!\v\v \x07Aj!\x07 A\fj!\f\v\0\v\0@ \x07-\0\0AG\r\0 \bAt (\0  ,\0\vA\0H\x1Bj(\0!@ \x7F    (\0(\0\v \rF@A! ( ,\0\v" A\0H\x1B G\r \x07A:\0\0 \vAj!\v\f\v \x07A\0:\0\0\v
  5765. Ak!
  5766. \v \x07Aj!\x07 A\fj!\f\v\0\v\0\v\0 \x07AA ( ,\0\v"\b \bA\0H\x1B"\b\x1B:\0\0 \x07Aj!\x07 A\fj! \v \bE"\bj!\v
  5767. \bk!
  5768. \f\v\0\v\0\v0\0\v  (\0Ar6\0\v ! \fA\xF0\0j$\0 \v\x88\x7F ( \0( \0(\0"k"k! @   \xFC
  5769. \0\0\v  6 \0 \0(\0"6 \0 (6\0  6 \0(! \0 (\b6  6\b \0(\b! \0 (\f6\b  6\f  (6\0\v\xC8\v\x7F#\0A\xF0\0k"\f$\0 \f 6l \f! @@@  kA\fm"
  5770. A\xE5\0O@
  5771. /"! E\r\v !\x07 !@  F@A\0!\b@ \0 \fA\xEC\0j")A
  5772. \x1B@ \0 )@  (\0Ar6\0\v@  F\r -\0\0AF\r\x07 Aj! A\fj!\f\0\v\0\v \0;!\r E@  \r (\0(\f\0!\r\v \bAj!A\0! !\x07 !@  F@ !\b E\r \0S !\x07 !
  5773. \vjAI\r@  F@\f@ \x07-\0\0AG\r\0 ( ,\0\v" A\0H\x1B \bF\r\0 \x07A\0:\0\0 \vAk!\v\v \x07Aj!\x07 A\fj!\f\v\0\v\0@ \x07-\0\0AG\r\0 (\0  ,\0\vA\0H\x1B \bj,\0\0!@ \x7F    (\0(\f\0\v \rF@A! ( ,\0\v" A\0H\x1B G\r \x07A:\0\0 \vAj!\v\f\v \x07A\0:\0\0\v
  5774. Ak!
  5775. \v \x07Aj!\x07 A\fj!\f\v\0\v\0\v\0 \x07AA ( ,\0\v"\b \bA\0H\x1B"\b\x1B:\0\0 \x07Aj!\x07 A\fj! \v \bE"\bj!\v
  5776. \bk!
  5777. \f\v\0\v\0\v0\0\v  (\0Ar6\0\v ! \fA\xF0\0j$\0 \v\xBB\x7F A\xF4\xDC \x1B"(\0!@\x7F@ E@ \rA\0\vA~ E\r@ @ !\f\v -\0\0"\xC0"A\0N@ \0@ \0 6\0\v A\0G\vA\xCC\xCF(\0(\0E@A \0E\r \0 A\xFF\xBFq6\0A\v A\xC2k"A2K\r At(\x80\x84! Ak"E\r Aj!\v -\0\0"Av"\x07Ak Au \x07jrA\x07K\r\0@ Ak! A\xFFqA\x80k Atr"A\0N@ A\x006\0 \0@ \0 6\0\v  k\v E\r Aj",\0\0"A@H\r\0\v\v A\x006\0A\xF8\xD7A6\0A\x7F\v\v  6\0A~\v'\0 \0 \0(E \0( rr"6 \0( q@\x9C\0\v\v}\x7F#\0A\xA0k"$\0  \0 A\x9Ej \x1B"\x006\x94   A\0Gk6\x98 A\0A\x90\xFC\v\0 A\x7F6L A\xE1\x006$ A\x7F6P  A\x9Fj6,  A\x94j6T \0A\0:\0\0   \xCB A\xA0j$\0\vJ\x7F@ \0-\0\0"E  -\0\0"Gr\r\0@ -\0! \0-\0"E\r Aj! \0Aj!\0  F\r\0\v\v  k\v\0\0\v\x8D\b\v\x7F \0E@ /\v A@O@A\xF8\xD7A06\0A\0\v\x7FA A\vjAxq A\vI\x1B! \0A\bk"(" Axq!\b@ AqE@ A\x80I\r Aj \bM@ ! \b kA\xDC\xDB(\0AtM\r\vA\0\f\v  \bj!\x07@  \bM@ \b k"AI\r   AqrAr6  j" Ar6 \x07 \x07(Ar6  \xC9\f\vA\x94\xD8(\0 \x07F@A\x88\xD8(\0 \bj"\b M\r   AqrAr6  j" \b k"Ar6A\x88\xD8 6\0A\x94\xD8 6\0\f\vA\x90\xD8(\0 \x07F@A\x84\xD8(\0 \bj" I\r@  k"AO@   AqrAr6  j"\b Ar6  j" 6\0  (A~q6\f\v  Aq rAr6  j" (Ar6A\0!\bA\0!\vA\x90\xD8 \b6\0A\x84\xD8 6\0\f\v \x07("Aq\r Axq \bj"\v I\r \v k!\f \x07(\f!@ A\xFFM@ \x07(\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v  6\f  6\b\f\v \x07(!
  5778. @  \x07G@ \x07(\b" 6\f  6\b\f\v@ \x07("\x7F \x07Aj \x07("E\r \x07Aj\v!\b@ \b! "Aj!\b ("\r\0 Aj!\b ("\r\0\v A\x006\0\f\vA\0!\v
  5779. E\r\0@ \x07("At"(\xAC\xDA \x07F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ \x07
  5780. (F@
  5781. 6\f\v
  5782. 6\v E\r\v 
  5783. 6 \x07("@  6  6\v \x07("E\r\0  6  6\v \fAM@  Aq \vrAr6  \vj" (Ar6\f\v   AqrAr6  j" \fAr6  \vj" (Ar6  \f\xC9\v !\v \v"@ A\bj\v /"E@A\0\v  \0A|Ax \0Ak(\0"Aq\x1B Axqj"   K\x1BY \0! \v\0 \0E@A\0\vA\xF8\xD7 \x006\0A\x7F\v}\x7F#\0Ak"$\0 A
  5784. :\0@@ \0("\x7F  \0\xC9\r \0(\v \0("F\r\0 \0(PA
  5785. F\r\0 \0 Aj6 A
  5786. :\0\0\f\v \0 AjA \0($\0AG\r\0 -\0\v Aj$\0\v\0\v\0A\v\xF4\x7F#\0A@j"\x07B\x007 \x07B\x007( \x07B\x0070 \x07B\x0078@@\x7F@\x7F @ Aq!@ AO@ A|q!@ \x07A j"\f  \bAtj"/\0Atj" /\0Aj;\0 /At \fj" /\0Aj;\0 /At \fj" /\0Aj;\0 /At \fj" /\0Aj;\0 \bAj!\b Aj" G\r\0\v E\r\v@ \x07A j  \bAtj/\0Atj" /\0Aj;\0 \bAj!\b
  5787. Aj"
  5788. G\r\0\v\v (\0"\b \x07/>"\rE\rA!\v\f\v (\0\v!\bA\0!\r \x07/<@A!\v\f\v \x07/:@A\r!\v\f\v \x07/8@A\f!\v\f\v \x07/6@A\v!\v\f\v \x07/4@A
  5789. !\v\f\v \x07/2@A !\v\f\v \x07/0@A\b!\v\f\v \x07/.@A\x07!\v\f\v \x07/,@A!\v\f\v \x07/*@A!\v\f\v \x07/(@A!\v\f\v \x07/&@A!\v\f\v \x07/$@A!\v\f\v \x07/"@A!\fA!\vA!\bA\0\f\v  (\0"\0Aj6\0 \0A\xC06\0  (\0"\0Aj6\0 \0A\xC06\0A!\f\f\v \b \v \b \vI\x1B!A!\b@@ \x07A j \bAtj/\0\r \bAj"\b \vG\r\0\v \v!\b\v  \b  \bK\x1B!\fA\v! A\x7F!
  5790. \x07/""AK\rA AtkA\xFE\xFFq \x07/$"k"A\0H\r At \x07/&"k"A\0H\r At \x07/("k"A\0H\r At \x07/*"k"A\0H\r At \x07/,"k"A\0H\r At \x07/."k"A\0H\r At \x07/0"k"A\0H\r At \x07/2"k"A\0H\r At \x07/4"k"A\0H\r At \x07/6"\x1Bk"A\0H\r At \x07/8"k"A\0H\r At \x07/:"k"A\0H\r At \x07/<"k"A\0H\r At" \rI  \rGA\0 \0E r\x1Br\rA\0!
  5791. \x07A\0; \x07 ; \x07  j"; \x07  j";\b \x07  j";
  5792. \x07  j";\f \x07  j"; \x07  j"; \x07  j"; \x07  j"; \x07  j"; \x07  \x1Bj"; \x07  j"; \x07  j"; \x07  j;@ E\r\0 AG@ Aq A~q!A\0! @ 
  5793. Atj/\0"@ \x07 Atj" /\0"Aj;\0  Atj
  5794. ;\0\v 
  5795. Ar"Atj/\0"@ \x07 Atj" /\0"Aj;\0  Atj ;\0\v
  5796. Aj!
  5797. Aj" G\r\0\vE\r\v 
  5798. Atj/\0"E\r\0 \x07 Atj" /\0"Aj;\0  Atj
  5799. ;\0\vA!A\0! "!A\0!@@@ \0\0\vA!
  5800. \fA K\rA\x81!A\xD0\xED\0!A\x90\xED\0!A!\f\v \0AF!A\0!A\xD0\xEE\0!A\x90\xEE\0! \0AG@\f\vA!
  5801. \fA K\r\vA \ft"Ak! (\0!A\0! \f! A\0!A\0!\rA\x7F!@A t!@@\x7FA\0   Atj/\0" AjK\r\0 I@A\0! A\xE0\0\f\v  kAt"\0j/\0! \0 j-\0\0\v!\0A\x7F \b k"t!\x1B  \r vAtj! !
  5802. @ 
  5803. \x1Bj"
  5804. Atj" ;  :\0  \0:\0\0
  5805. \r\0\vA \bAkt! @ "\0Av! \0 \rq\r\0\v \x07A j \bAtj" /\0Ak" ;\0 \0Ak \rq \0jA\0 \0\x1B!\r Aj! A\xFF\xFFqE@ \b \vF\r   Atj/\0Atj/\0!\b\v \b \fM\r\0 \r q"\0 F\r\0\vA \b  \f \x1B"k" t! \b \vI@ \v k! \b!
  5806. @@  \x07A j
  5807. Atj/\0k"A\0L\r At! Aj" j"
  5808. \vI\r\0\v ! \vA t!\vA!
  5809.   j"A\xD4Kq  A\xD0Kqr\r (\0" \0Atj"
  5810. \f:\0
  5811. :\0\0
  5812.  Atj" kAv; \0!\f\v\v \r@  \rAtj"\0A\0; \0 :\0 \0A\xC0\0:\0\0\v  (\0 Atj6\0\v  \f6\0A\0!
  5813. \v
  5814. \v\x9C\x7F ,\0\vA\0N@ \0 (\b6\b \0 )\x007\0\v (\0!@@@ ("A
  5815. M@ \0 :\0\v\f\v A\xF7\xFF\xFF\xFF\x07O\r A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v Aj"@ \0  \xFC
  5816. \0\0\v\f\vi\0\v\v\xCC\x7F@A\xF6\xFF\xFF\xFF\x07 k O@ \0,\0\vA\0H! \0(\0A\xF7\xFF\xFF\xFF\x07! A\xF2\xFF\xFF\xFFM@A\v  j" At"  K\x1B"A\x07rAj A\vI\x1B!\v \0 \x1B! 9! @   \xFC
  5817. \0\0\v@  F\r\0  k"\x07E\r\0  j  j \x07\xFC
  5818. \0\0\v A
  5819. G@ !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b\f\vi\0\v \0 6\v\0 \0 \0(\0A\fk(\0j"\0 jK \0\vK\x7F \0("A\bu!\x07 \0(\0"\0   Aq\x7F (\0 \x07j(\0 \x07\v j A Aq\x1B  \0(\0(\v\0\v\x9A\0 \0A:\x005@  \0(G\r\0 \0A:\x004@ \0("E@ \0A6$ \0 6 \0 6 AG\r \0(0AF\r\f\v  F@ \0("AF@ \0 6 !\v \0(0AG\r AF\r\f\v \0 \0($Aj6$\v \0A:\x006\v\vv\x7F \0($"E@ \0 6 \0 6 \0A6$ \0 \0(86\v@@ \0( \0(8G\r\0 \0( G\r\0 \0(AG\r \0 6\v \0A:\x006 \0A6 \0 Aj6$\v\v\x8D\x7F ( \0(\0" \0("kj!  k"@   \xFC
  5820. \0\0\v  6 \0 \0(\0"6 \0 (6\0  6 \0(! \0 (\b6  6\b \0(\b! \0 (\f6\b  6\f  (6\0\v\x85\x7F@@@ \0,\0\v"A\0N@A
  5821. ! A
  5822. F\r \0 AjA\xFF\0q:\0\v\f\v \0(" \0(\bA\xFF\xFF\xFF\xFF\x07qAk"G\r\v \0 A  \xA4 !\v \0 Aj6 \0(\0!\0\v \0 j"\0A\0:\0 \0 :\0\0\v,\x7F \0 A\x90\xCE\0n"At/\xC0\xBB;\0\0 \0Aj  A\x90\xCE\0lk\xAC\v4\x7F \0 A\xE4\0n"At/\xC0\xBB;\0\0 \0  A\xE4\0lkAt/\xC0\xBB;\0 \0Aj\v\xE9\x7F A\xBF\x84=M@ A\x8F\xCE\0M@ A\xE3\0M@ A M@ \0 A0r:\0\0 \0Aj\v \0 At/\xC0\xBB;\0\0 \0Aj\v A\xE7\x07M@ \0 A\xFF\xFFqA\xE4\0n"A0r:\0\0 \0  A\xE4\0lkA\xFF\xFFqAt/\xC0\xBB;\0 \0Aj\v \0 \xAC\v A\x9F\x8DM@ \0 A\x90\xCE\0n"A0j:\0\0 \0Aj  A\x90\xCE\0lk\xAC\v \0 \xAB\v A\xFF\xC1\xD7/M@ A\xFF\xAC\xE2M@ \0 A\xC0\x84=n"A0j:\0\0 \0Aj  A\xC0\x84=lk\xAB\v \0 \x8A\v A\xFF\x93\xEB\xDCM@ \0 A\x80\xC2\xD7/n"A0j:\0\0 \0Aj  A\x80\xC2\xD7/lk\x8A\v \0 A\x80\xC2\xD7/n"At/\xC0\xBB;\0\0 \0Aj  A\x80\xC2\xD7/lk\x8A\v\0 \0(\b*G@ \0(\b\xA6\v \0\v+\x7F#\0Ak"$\0  H6\f \0 \xC5 A\fjI Aj$\0\v\0 \0A\xE8\xF5\x006\0 \0A j  \0\xC3\vT\x7F#\0Ak"$\0\x7F (\0!  \0kAu"@@ \0  \0(\0F\r \0Aj!\0 Ak"\r\0\v\vA\0\v"\0  \0\x1B Aj$\0\v\x9F\x7F#\0Ak"\f$\0 \f \x006\f@@ \0 F@ -\0\0AG\rA\0!\0 A\0:\0\0  (\0"Aj6\0 A.:\0\0 \x07( \x07,\0\v" A\0H\x1BE\r (\0" \bkA\x9FJ\r
  5823. (\0! Aj6\0  6\0\f\v@@ \0 G\r\0 \x07( \x07,\0\v"\0 \0A\0H\x1BE\r\0 -\0\0AG\r (\0"\0 \bkA\x9FJ\r
  5824. (\0! \0Aj6\0 \0 6\0A\0!\0
  5825. A\x006\0\f\v \v \vA\xF0\0j \fA\fj\xB1 \vk"\0Au"A\x1BJ\r A\xD0\x85j,\0\0!@@ \0A{q"\0A\xD8\0G@ \0A\xE0\0G\r  (\0"G@A\x7F!\0 Ak,\0\0s ,\0\0sG\r\v  Aj6\0  :\0\0\f\v A\xD0\0:\0\0\f\v s"\0 ,\0\0G\r\0  \0\xB9:\0\0 -\0\0AG\r\0 A\0:\0\0 \x07( \x07,\0\v"\0 \0A\0H\x1BE\r\0 (\0"\0 \bkA\x9FJ\r\0
  5826. (\0! \0Aj6\0 \0 6\0\v  (\0"\0Aj6\0 \0 :\0\0A\0!\0 AJ\r
  5827. (\0Aj6\0\f\vA\0!\0\f\vA\x7F!\0\v \fAj$\0 \0\vy\x7F#\0Ak"$\0 A\fj" $ ="A\xD0\x85A\xEC\x85  (\0(0\0  n" (\0(\f\0\x006\0   (\0(\0\x006\0 \0  (\0(\0 (\f# Aj$\0\v*\x7F#\0Ak"$\0 \0 ,\0\0  \0k\xCA"\0  \0\x1B Aj$\0\v\x7F \0\xD4 \0(\0"@ \0(\f !\v\v\x97\x7F#\0Ak"\f$\0 \f \0:\0@@ \0 F@ -\0\0AG\rA\0!\0 A\0:\0\0  (\0"Aj6\0 A.:\0\0 \x07( \x07,\0\v" A\0H\x1BE\r (\0" \bkA\x9FJ\r
  5828. (\0! Aj6\0  6\0\f\v@@ \0 G\r\0 \x07( \x07,\0\v"\0 \0A\0H\x1BE\r\0 -\0\0AG\r (\0"\0 \bkA\x9FJ\r
  5829. (\0! \0Aj6\0 \0 6\0A\0!\0
  5830. A\x006\0\f\v \v \vAj \fAj\xB4 \vk"A\x1BJ\r A\xD0\x85j,\0\0!@@@@ A~qAk\0\v  (\0"G@A\x7F!\0 Ak,\0\0s ,\0\0sG\r\v  Aj6\0  :\0\0\f\v A\xD0\0:\0\0\f\v s"\0 ,\0\0G\r\0  \0\xB9:\0\0 -\0\0AG\r\0 A\0:\0\0 \x07( \x07,\0\v"\0 \0A\0H\x1BE\r\0 (\0"\0 \bkA\x9FJ\r\0
  5831. (\0! \0Aj6\0 \0 6\0\v  (\0"\0Aj6\0 \0 :\0\0A\0!\0 AJ\r
  5832. (\0Aj6\0\f\vA\0!\0\f\vA\x7F!\0\v \fAj$\0 \0\vy\x7F#\0Ak"$\0 A\fj" $ >"A\xD0\x85A\xEC\x85  (\0( \0  p" (\0(\f\0\0:\0\0   (\0(\0\0:\0\0 \0  (\0(\0 (\f# Aj$\0\vI\x7F \0 6 \0A\x006\f @ U!\v \0 6\0 \0  Atj"6\b \0  Atj6\f \0 6 \0\v6\x7F \0(" Atj!@  F@ \0 6 A\x006\0 Aj!\f\v\v\v~\x7F~#\0A\xA0k"$\0  6<  6 A\x7F6 Aj"B\0J   A\xAD )\b! )\0!\x07 @  (\x88  ( (<kjj6\0\v \0 7\b \0 \x077\0 A\xA0j$\0\v\r\0 \0  B\x7F\xBE\vD\x7F#\0Ak"$\0     B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85< )\0! \0 )\b7\b \0 7\0 Aj$\0\v\x9C\x7FA5!@ \0(" \0("AjA\x07pkA\x07jA\x07n  k"A\xF1jA\x07pAIj"A5G@ "\rA4!@@ AjA\x07pAk\0\v \0(A\x90oAk\xB3E\r\vA5\v@@ A\xF3jA\x07pAk\0\v \0(\xB3\r\vA!\v \v\x95\x07\x7F~#\0Ak"\b$\0@@@ A$L@ \0-\0\0"\r \0!\f\vA\xF8\xD7A6\0B\0!\f\v \0!@@ \xC0_E\r -\0! Aj! \r\0\v\f\v@ A\xFFq"A+k\0\0\vA\x7FA\0 A-F\x1B!\x07 Aj!\v\x7F@ ArAG\r\0 -\0\0A0G\r\0A! -\0A\xDFqA\xD8\0F@ Aj!A\f\v Aj! A\b \x1B\f\v A
  5833. \x1B\v"
  5834. \xAD!\fA\0!@@@ -\0\0"A0k"A\xFFqA
  5835. I\r\0 A\xE1\0kA\xFFqAM@ A\xD7\0k!\f\v A\xC1\0kA\xFFqAK\r A7k!\v
  5836. A\xFFqL\r\0 \b \fB\0 \vB\02A!@ \b)\bB\0R\r\0 \v \f~"\r \xADB\xFF\x83"B\x7F\x85V\r\0 \r |!\vA! !\v Aj! !\f\v\v @   \0 \x1B6\0\v@@ @A\xF8\xD7A\xC4\x006\0 \x07A\0 B\x83P\x1B!\x07 !\v\f\v  \vV\r\v \x07 \xA7AqrE@A\xF8\xD7A\xC4\x006\0 B}!\f\v  \vZ\r\0A\xF8\xD7A\xC4\x006\0\f\v \v \x07\xAC"\x85 }!\v \bAj$\0 \v\x9A\b\x7F@ \0"Aq@@ -\0\0"E A=Fr\r Aj"Aq\r\0\v\v@@A\x80\x82\x84\b (\0"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r\0@A\x80\x82\x84\b A\xBD\xFA\xF4\xE9s"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r (! Aj"! A\x80\x82\x84\b krA\x80\x81\x82\x84xqA\x80\x81\x82\x84xF\r\0\v\f\v !\v@ "-\0\0"E\r Aj! A=G\r\0\v\v \0 F@A\0\v@ \0  \0k"j-\0\0\r\0A\xEC\xDB(\0"E\r\0 (\0"E\r\0@@\x7F \0!A\0 "E\r\0 \0-\0\0"\x7F@@  -\0\0"\x07G \x07Er\r Ak"E\r Aj! -\0! Aj! \r\0\vA\0!\v A\0\v -\0\0k\vE@ (\0 j"-\0\0A=F\r\v (! Aj! \r\f\v\v Aj!\b\v \b\v \0 \0\x81!\v\0 \0A\fjK \0!\v\0\v\0 \0A\xA8\xF5\x006\0 \0Aj\xF3 \0\v\xFD~\x7F#\0A k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!~ B0\x88B\xFF\xFF\x83"\xA7"A\x81\xF8\0kA\xFDM@ B\x86 \0B<\x88\x84! A\x80\xF8\0k\xAD!@ \0B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x83"\0B\x81\x80\x80\x80\x80\x80\x80\x80\bZ@ B|!\f\v \0B\x80\x80\x80\x80\x80\x80\x80\x80\bR\r\0 B\x83 |!\vB\0  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07V"\x1B!\0 \xAD |\f\v \0 \x84P B\xFF\xFFRrE@ B\x86 \0B<\x88\x84B\x80\x80\x80\x80\x80\x80\x80\x84!\0B\xFF\f\v A\xFE\x87K@B\0!\0B\xFF\f\vA\x80\xF8\0A\x81\xF8\0 P"\x1B"\b k"\x07A\xF0\0J@B\0!\0B\0\f\v  B\x80\x80\x80\x80\x80\x80\xC0\0\x84 \x1B!A\0!  \bG@ Aj \0 A\x80 \x07k6 ) )\x84B\0R!\v  \0  \x07g )\bB\x86 )\0"B<\x88\x84!\0@ \xAD B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x83\x84"B\x81\x80\x80\x80\x80\x80\x80\x80\bZ@ \0B|!\0\f\v B\x80\x80\x80\x80\x80\x80\x80\x80\bR\r\0 \0B\x83 \0|!\0\v \0B\x80\x80\x80\x80\x80\x80\x80\b\x85 \0 \0B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07V"\x1B!\0 \xAD\v! A j$\0 B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83 B4\x86\x84 \0\x84\xBF\v\x89\0@ \0\x7F A\xFF\0M\r@A\xCC\xCF(\0(\0E@ A\x80\x7FqA\x80\xBFF\r\f\v A\xFFM@ \0 A?qA\x80r:\0 \0 AvA\xC0r:\0\0A\v A\x80@qA\x80\xC0G A\x80\xB0OqE@ \0 A?qA\x80r:\0 \0 A\fvA\xE0r:\0\0 \0 AvA?qA\x80r:\0A\v A\x80\x80kA\xFF\xFF?M@ \0 A?qA\x80r:\0 \0 AvA\xF0r:\0\0 \0 AvA?qA\x80r:\0 \0 A\fvA?qA\x80r:\0A\v\vA\xF8\xD7A6\0A\x7FA\v\v \0 :\0\0A\v\0 @ \0 \xC0 \xFC\v\0\v\v0\x7F#\0Ak"$\0  (\x006\0 \0 a\`A\xB0\xF1\0(\0L Aj$\0\v\xA9|D\0\0\0\0\0\0\xF0?!@ \0A\x80\bN@D\0\0\0\0\0\0\xE0\x7F! \0A\xFFI@ \0A\xFF\x07k!\0\f\vD\0\0\0\0\0\0\xF0\x7F!A\xFD \0 \0A\xFDO\x1BA\xFEk!\0\f\v \0A\x81xJ\r\0D\0\0\0\0\0\0\`! \0A\xB8pK@ \0A\xC9\x07j!\0\f\vD\0\0\0\0\0\0\0\0!A\xF0h \0 \0A\xF0hM\x1BA\x92j!\0\v  \0A\xFF\x07j\xADB4\x86\xBF\xA2\vY\x7F \0 \0(H"Ak r6H \0(\0"A\bq@ \0 A r6\0A\x7F\v \0B\x007 \0 \0(,"6 \0 6 \0  \0(0j6A\0\v\xE2\x7F A\0G!@@@ \0AqE Er\r\0 A\xFFq!@ \0-\0\0 F\r Ak"A\0G! \0Aj"\0AqE\r \r\0\v\v E\r A\xFFq" \0-\0\0F AIrE@ A\x81\x82\x84\bl!@A\x80\x82\x84\b \0(\0 s"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r \0Aj!\0 Ak"AK\r\0\v\v E\r\v A\xFFq!@  \0-\0\0F@ \0\v \0Aj!\0 Ak"\r\0\v\vA\0\vx\x7F@ \0E\r\0 \0( E\r\0 \0($"E\r\0 \0("E\r\0 (\0 \0G\r\0 (A\xB4\xFE\0kAK\r\0 (8"@ \0((  \0 \0($! \0(!\v \0((  \0 \0A\x006\v\v\xE9\0A\x98\xC7A\xA8A\xA8\xC7A\xA9AA\0A\xB4\xC7A\x96\rAA\x80\x7FA\xFF\0A\xCC\xC7A\x8F\rAA\x80\x7FA\xFF\0A\xC0\xC7A\x8D\rAA\0A\xFFA\xD8\xC7A\xC8 AA\x80\x80~A\xFF\xFFA\xE4\xC7A\xBF AA\0A\xFF\xFFA\xF0\xC7A\xD7 AA\x80\x80\x80\x80xA\xFF\xFF\xFF\xFF\x07A\xFC\xC7A\xCE AA\0A\x7FA\x88\xC8A\x85AA\x80\x80\x80\x80xA\xFF\xFF\xFF\xFF\x07A\x94\xC8A\xFCAA\0A\x7FA\xA0\xC8A\xF2A\bB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xAC\xC8A\xE9A\bB\0B\x7FA\xB8\xC8A\xC7
  5837. A\rA\xC4\xC8A\xAFA\b\rA\xA8-A\xA4\x1BA\xF0-AA\x8AA\xB8.AA\xB0A\x84/AA\xBFA\xDC&A\xD0/A\0A\x98\0A\xF8/A\0A\xDD\0A\xA00AA\xB6\0A\xC80AA\xE5\0A\xF00AA\x84\0A\x981AA\xAC\0A\xC01AA\xC9\0A\xE81AA\x82\x1B\0A\x902AA\xA0\x1B\0A\xF8/A\0A\xAF\0A\xA00AA\x8E\0A\xC80AA\xF1\0A\xF00AA\xCF\0A\x981AA\xF7\0A\xC01AA\xD5\0A\xB82A\bA\xB4\0A\xE02A A\x92\0A\x883AA\xEF\0A\xB03A\x07A\xC7\x1B\0\v>\x7F#\0Ak"$\0  \x006\f\x7F \0AO@A\xAE A\fj\xC7A\0\f\v \0At(\x98-\v Aj$\0\v\x85\x7F@  k"A\xF7\xFF\xFF\xFF\x07I@@ A
  5838. M@ \0 :\0\v\f\v A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v  k"E  FrE@ \0  \xFC
  5839. \0\0\v \0 jA\0:\0\0\f\vi\0\v\v6\x7F \0(\b" Atj!@  FE@ A\x006\0 Aj!\f\v\v \0 6\b\vD\x7F#\0Ak"$\0 \0(\0!\0  6\b  \x006 A\x9F6\0A\xED\v a\`A\xB0\xF1\0(\0L Aj$\0\v\`\x7F  \0(" k"\x07j! !@  M@ \0 6 \x07E  FrE@  \x07k  \x07\xFC
  5840. \0\0\v  -\0\0:\0\0 Aj! Aj!\f\v\v\v\0 \0(\0"\0@ \0\v\v\f\0  \0(\0\0\0\v+\x7F \0(! \0(\b!@  G@ \0 Ak"6\b\f\v\v\v\x07\0 \0\0\v\x7F#\0Ak"$\0  \x006\0A\xEC \xDC\0\v\0  \0(\0j 6\0\v\r\0  \0(\0j(\0\vQ\x7F@ E\r\0 A\x8C\xC6E"E\r\0 (\b \0(\bA\x7Fsq\r\0 \0(\f( (\f(G\r\0 \0(( ((F!\v \v{\x7F \0("Aq!\x7F -\x007AF@ A\bu" E\r (\0 j(\0\f\v A\bu E\r\0  \0(\0(68A\0!A\0\v! \0(\0"\0   j A Aq\x1B \0(\0(\b\0\v\r\0 \0( (F\v\xF6\x7F#\0Ak"$\0  6\fA\x94\xC4(\0" \0 \xCB \0y \0jAk-\0\0A
  5841. G@@@ (L"\0A\0N@ \0E\rA\x84\xCF(\0 \0A\xFF\xFF\xFF\xFFqG\r\v@ (PA
  5842. F\r\0 ("\0 (F\r\0  \0Aj6 \0A
  5843. :\0\0\f\v \x9F\f\v  (L"\0A\xFF\xFF\xFF\xFF \0\x1B6L@@ (PA
  5844. F\r\0 ("\0 (F\r\0  \0Aj6 \0A
  5845. :\0\0\f\v \x9F\v (L A\x006L\v\v\x9C\0\v\x88\x7F@@@ \0,\0\v"A\0N@A! AF\r \0 AjA\xFF\0q:\0\v\f\v \0(" \0(\bA\xFF\xFF\xFF\xFF\x07qAk"G\r\v \0 A  \xFF !\v \0 Aj6 \0(\0!\0\v \0 Atj"\0A\x006 \0 6\0\v\x9B\x7FA\xF6\xFF\xFF\xFF k O@A\xF7\xFF\xFF\xFF! \0(\0 \0 \0,\0\vA\0H\x1B!
  5846. A\xF2\xFF\xFF\xFFM@  j" At"  K\x1BArAj! \v U!@ E\r\0 At"\bE\r\0 
  5847. \b\xFC
  5848. \0\0\v@ E\r\0 At"\bE\r\0  Atj \x07 \b\xFC
  5849. \0\0\v   j"\bk!\x07@  \bF\r\0 \x07At"E\r\0  At"\bj Atj \b
  5850. j Atj \xFC
  5851. \0\0\v AG@
  5852. !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b \0  j \x07j"\x006  \0AtjA\x006\0\v0\0\v\x8A\x7F A\xF7\xFF\xFF\xFFI@@ AM@ \0 :\0\v\f\v Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v ! \0!@ @  6\0 Ak! Aj!\f\v\v \0 AtjA\x006\0\v0\0\v\xA0\x7F \0(\b"A\xFF\xFF\xFF\xFF\x07qAkA
  5853. \0,\0\v"A\0H"\x1B" O@ \0(\0 \0 \x1B!@ \x7F @   \xFC
  5854. \0\0\v \0,\0\v Av\v\xC0A\0H@ \0 6\f\v \0 A\xFF\0q:\0\v\v  jA\0:\0\0\v \0   k \0(  \x1B"\0A\0 \0  \x89\v\x87\x7F A\xF7\xFF\xFF\xFF\x07I@@ A
  5855. M@ \0 :\0\v\f\v A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v ! \0!@ @  :\0\0 Ak! Aj!\f\v\v \0 jA\0:\0\0\vi\0\v\0 \0 F@ \0A\0:\0x\v !\v<\x7F#\0Ak"$\0@@ AK\r\0 \0-\0xAq\r\0 \0A:\0x\f\v U!\0\v Aj$\0 \0\v \0 \0\xAE!\v\0 \0A\xF0\x906\0 \0Aj  \0\v\0 \0A\xC8\x906\0 \0A\fj  \0\v\x80\x7F !\0@@  \x07M \0 Or\r\0 \0,\0\0"A\xFFq!\x7FA A\0N\r\0 ABI\r A_M@  \0kAH\r \0-\0A\xC0qA\x80G\rA\f\v AoM@  \0kAH\r \0-\0 \0,\0!@@ A\xEDG@ A\xE0G\r A\`qA\xA0\x7FF\r\f\v A\xA0\x7FN\r\f\v A\xBF\x7FJ\r\vA\xC0qA\x80G\rA\f\v  \0kAH AtKr\r \0-\0! \0-\0!\b \0,\0!@@@@ A\xF0k\0\v A\xF0\0jA\xFFqA0O\r\f\v A\x90\x7FN\r\f\v A\xBF\x7FJ\r\v \bA\xC0qA\x80G A\xC0qA\x80Gr A?q \bAtA\xC0q AtA\x80\x80\xF0\0q A?qA\ftrrrA\xFF\xFF\xC3\0Kr\rA\v! \x07Aj!\x07 \0 j!\0\f\v\v \0 k\v\xB8\x7F#\0Ak"\0$\0\x7F \0 6\f \0 6\b@@@  O  OrE@ ,\0\0"\bA\xFFq!\x7F \bA\0N@ A\xFF\xFF\xC3\0K\rA\f\v \bABI\r \bA_M@A  kAH\rA!\b -\0" A\xC0qA\x80G\r A?q AtA\xC0qr!A\f\v \bAoM@A!\b  k"
  5856. AH\r ,\0! @@ A\xEDG@ A\xE0G\r A\`qA\xA0\x7FF\r\f\b\v A\xA0\x7FH\r\f\x07\v A\xBF\x7FJ\r\v
  5857. AF\r -\0"\bA\xC0qA\x80G\r \bA?q A\ftA\x80\xE0q A?qAtrr!A\f\v \bAtK\rA!\b  k"
  5858. AH\r ,\0! @@@@ A\xF0k\0\v A\xF0\0jA\xFFqA0O\r\x07\f\v A\x90\x7FN\r\f\v A\xBF\x7FJ\r\v
  5859. AF\r -\0"\vA\xC0qA\x80G\r
  5860. AF\r -\0"
  5861. A\xC0qA\x80G\rA!\b
  5862. A?q \vAtA\xC0q AtA\x80\x80\xF0\0q A?qA\ftrrr"A\xFF\xFF\xC3\0K\rA\v!\b  6\0 \0  \bj"6\f \0 Aj"6\b\f\v\v  I!\b\v \b\f\vA\v  \0(\f6\0 \x07 \0(\b6\0 \0Aj$\0\v\xF5\0#\0Ak"\0$\0\x7F \0 6\f \0 6\b@@@  O@A\0!\f\vA! (\0"A\xFF\xFF\xC3\0K A\x80pqA\x80\xB0Fr\r\0@ A\xFF\0M@A!  \0(\b"kA\0L\r \0 Aj6\b  :\0\0\f\v A\xFFM@  \0(\b"kAH\r \0 Aj6\b  AvA\xC0r:\0\0 \0 \0(\b"Aj6\b  A?qA\x80r:\0\0\f\v  \0(\b"k! A\xFF\xFFM@ AH\r \0 Aj6\b  A\fvA\xE0r:\0\0 \0 \0(\b"Aj6\b  AvA?qA\x80r:\0\0 \0 \0(\b"Aj6\b  A?qA\x80r:\0\0\f\v AH\r \0 Aj6\b  AvA\xF0r:\0\0 \0 \0(\b"Aj6\b  A\fvA?qA\x80r:\0\0 \0 \0(\b"Aj6\b  AvA?qA\x80r:\0\0 \0 \0(\b"Aj6\b  A?qA\x80r:\0\0\v \0 \0(\fAj"6\f\f\v\v \f\vA\v  \0(\f6\0 \x07 \0(\b6\0 \0Aj$\0\v\x92\x7F !\0@@  M \0 Or\r\0\x7F \0Aj \0-\0\0"\xC0A\0N\r\0 A\xC2I\r A\xDFM@  \0kAH\r \0-\0A\xC0qA\x80G\r \0Aj\f\v A\xEFM@  \0kAH\r \0-\0 \0,\0!@@ A\xEDG@ A\xE0G\r A\`qA\xA0\x7FF\r\f\v A\xA0\x7FN\r\f\v A\xBF\x7FJ\r\vA\xC0qA\x80G\r \0Aj\f\v  \0kAH A\xF4Kr  kAIr\r \0-\0!\x07 \0-\0!\b \0,\0!@@@@ A\xF0k\0\v A\xF0\0jA\xFFqA0O\r\f\v A\x90\x7FN\r\f\v A\xBF\x7FJ\r\v \bA\xC0qA\x80G \x07A\xC0qA\x80Gr \x07A?q \bAtA\xC0q AtA\x80\x80\xF0\0q A?qA\ftrrrA\xFF\xFF\xC3\0Kr\r Aj! \0Aj\v!\0 Aj!\f\v\v \0 k\v\x81\x7F#\0Ak"\0$\0\x7F \0 6\f \0 6\b@@@  O  OrE@A! \0\x7F -\0\0"\xC0A\0N@  ;\0A\f\v A\xC2I\r A\xDFM@A  kAH\r -\0"\bA\xC0qA\x80G\r  \bA?q AtA\xC0qr;\0A\f\v A\xEFM@A!  k"
  5863. AH\r ,\0!\b@@ A\xEDG@ A\xE0G\r \bA\`qA\xA0\x7FG\r\b\f\v \bA\xA0\x7FN\r\x07\f\v \bA\xBF\x7FJ\r\v
  5864. AF\r -\0" A\xC0qA\x80G\r  A?q \bA?qAt A\ftrr;\0A\f\v A\xF4K\rA!  k"
  5865. AH\r -\0"\v\xC0!\b@@@@ A\xF0k\0\v \bA\xF0\0jA\xFFqA0O\r\x07\f\v \bA\x90\x7FN\r\f\v \bA\xBF\x7FJ\r\v
  5866. AF\r -\0"\bA\xC0qA\x80G\r
  5867. AF\r -\0"
  5868. A\xC0qA\x80G\r  kAH\rA!
  5869. A?q"
  5870. \bAt"\fA\xC0q \vA\ftA\x80\xE0q A\x07q"AtrrrA\xFF\xFF\xC3\0K\r 
  5871. \fA\xC0\x07qrA\x80\xB8r;  \bAvAq \vAt" A\xC0q A\btr A<qrrA\xC0\xFF\0jA\x80\xB0r;\0 Aj!A\v j"6\f \0 Aj"6\b\f\v\v  I! \v \f\vA\v  \0(\f6\0 \x07 \0(\b6\0 \0Aj$\0\v\xCB\x7F#\0Ak"\0$\0\x7F \0 6\f \0 6\b@@@  O@A\0!\f\vA!@@ /\0"A\xFF\0M@A!  \0(\b"kA\0L\r \0 Aj6\b  :\0\0\f\v A\xFFM@  \0(\b"kAH\r \0 Aj6\b  AvA\xC0r:\0\0 \0 \0(\b"Aj6\b  A?qA\x80r:\0\0\f\v A\xFF\xAFM@  \0(\b"kAH\r \0 Aj6\b  A\fvA\xE0r:\0\0 \0 \0(\b"Aj6\b  AvA?qA\x80r:\0\0 \0 \0(\b"Aj6\b  A?qA\x80r:\0\0\f\v A\xFF\xB7M@A!  kAH\r /"\bA\x80\xF8qA\x80\xB8G\r  \0(\b" kAH\r \bA\xFF\x07q A
  5872. tA\x80\xF8q A\xC0\x07q"A
  5873. trrA\xFF\xFF?K\r \0 Aj6\f \0 Aj6\b AvAj"AvA\xF0r:\0\0 \0 \0(\b"Aj6\b  AtA0q AvAqrA\x80r:\0\0 \0 \0(\b"Aj6\b  \bAvAq AtA0qrA\x80r:\0\0 \0 \0(\b"Aj6\b  \bA?qA\x80r:\0\0\f\v A\x80\xC0I\r  \0(\b"kAH\r \0 Aj6\b  A\fvA\xE0r:\0\0 \0 \0(\b"Aj6\b  AvA\xBFq:\0\0 \0 \0(\b"Aj6\b  A?qA\x80r:\0\0\v \0 \0(\fAj"6\f\f\v\vA\f\v \f\vA\v  \0(\f6\0 \x07 \0(\b6\0 \0Aj$\0\v3\x7F#\0Ak"$\0  \0H6\fAAA\xCC\xCF(\0(\0\x1B A\fjI Aj$\0\v/\x7F#\0Ak"$\0  H6\f \0   \x98 A\fjI Aj$\0\v\0  6\0 \x07 6\0A\v+\x7F \0A\xDC\x876\0@ \0(\b"E\r\0 \0-\0\fAqE\r\0 !\v \0\v\0 \v'\x7F \0(\0(\0(\0A\x98\xE0A\x98\xE0(\0Aj"6\0 6\v \0 \0(\0#\v\xDB
  5874. \x7F \0A\x94\xE0-\0\0E@A\x8C\xE0-\0\0E@A\xEC\xDEA\xC8\x876\0A\xF0\xDEA\x006\0A\xF8\xDFA\0:\0\0A\xFC\xDEA\x006\0A\xF4\xDEB\x007\0A\xF8\xDEA\x80\xDFA\xE3"\x006\0A\xF4\xDE \x006\0A\xFC\xDE \0A\xF8\0j6\0A\xF4\xDEA\xB9A\xFC\xDFA\xAF\x80A\xF8\xDEA\xF4\xDE(\x006\0A\xFC\xE9A\xE8\x9B6\0A\x80\xEAA\x006\0A\xFC\xE9A\xC4\xDD-.A\x84\xEAA\x88\x9C6\0A\x88\xEAA\x006\0A\x84\xEAA\xCC\xDD-.A\x8C\xEAA\xDC\x876\0A\x94\xEAA\x90\x886\0A\x98\xEAA\0:\0\0A\x90\xEAA\x006\0A\x8C\xEAA\xA4\xE0-.A\x9C\xEAA\xC8\x936\0A\xA0\xEAA\x006\0A\x9C\xEAA\x9C\xE0-.A\xA4\xEAA\xE0\x946\0A\xA8\xEAA\x006\0A\xA4\xEAA\xAC\xE0-.A\xAC\xEAA\x98\x906\0A\xB0\xEAA\x006\0A\xB4\xEA*6\0A\xAC\xEAA\xB4\xE0-.A\xB8\xEAA\xF4\x956\0A\xBC\xEAA\x006\0A\xB8\xEAA\xBC\xE0-.A\xC0\xEAA\xDC\x976\0A\xC4\xEAA\x006\0A\xC0\xEAA\xCC\xE0-.A\xC8\xEAA\xE8\x966\0A\xCC\xEAA\x006\0A\xC8\xEAA\xC4\xE0-.A\xD0\xEAA\xD0\x986\0A\xD4\xEAA\x006\0A\xD0\xEAA\xD4\xE0-.A\xE4\xEAB\x007\0A\xE0\xEAA\xAE\xD8\0;\0A\xD8\xEAA\xC8\x906\0A\xDC\xEAA\x006\0A\xEC\xEAA\x006\0A\xD8\xEAA\xDC\xE0-.A\x80\xEBB\x007\0A\xFC\xEAA,6\0A\xF0\xEAA\xF0\x906\0A\xF4\xEAB\x80\x80\x80\x80\xE07\0A\x88\xEBA\x006\0A\xF0\xEAA\xE4\xE0-.A\x8C\xEBA\xA8\x9C6\0A\x90\xEBA\x006\0A\x8C\xEBA\xD4\xDD-.A\x94\xEBA\xA0\x9E6\0A\x98\xEBA\x006\0A\x94\xEBA\xDC\xDD-.A\x9C\xEBA\xF4\x9F6\0A\xA0\xEBA\x006\0A\x9C\xEBA\xE4\xDD-.A\xA4\xEBA\xE0\xA16\0A\xA8\xEBA\x006\0A\xA4\xEBA\xEC\xDD-.A\xAC\xEBA\xC4\xA96\0A\xB0\xEBA\x006\0A\xAC\xEBA\x94\xDE-.A\xB4\xEBA\xD8\xAA6\0A\xB8\xEBA\x006\0A\xB4\xEBA\x9C\xDE-.A\xBC\xEBA\xCC\xAB6\0A\xC0\xEBA\x006\0A\xBC\xEBA\xA4\xDE-.A\xC4\xEBA\xC0\xAC6\0A\xC8\xEBA\x006\0A\xC4\xEBA\xAC\xDE-.A\xCC\xEBA\xB4\xAD6\0A\xD0\xEBA\x006\0A\xCC\xEBA\xB4\xDE-.A\xD4\xEBA\xDC\xAE6\0A\xD8\xEBA\x006\0A\xD4\xEBA\xBC\xDE-.A\xDC\xEBA\x84\xB06\0A\xE0\xEBA\x006\0A\xDC\xEBA\xC4\xDE-.A\xE4\xEBA\xAC\xB16\0A\xE8\xEBA\x006\0A\xE4\xEBA\xCC\xDE-.A\xF4\xEBA\xD8\xA36\0A\xEC\xEBA\xA8\xA36\0A\xF0\xEBA\x006\0A\xEC\xEBA\xF4\xDD-.A\x80\xECA\xE4\xA56\0A\xF8\xEBA\xB4\xA56\0A\xFC\xEBA\x006\0A\xF8\xEBA\xFC\xDD-.A\x84\xECA\x90\x936\0A\x88\xECA\x006\0*!\0A\x84\xECA\xA4\xA76\0A\x8C\xEC \x006\0A\x84\xECA\x84\xDE-.A\x90\xECA\x90\x936\0A\x94\xECA\x006\0*!\0A\x90\xECA\xC4\xA86\0A\x98\xEC \x006\0A\x90\xECA\x8C\xDE-.A\x9C\xECA\xD4\xB26\0A\xA0\xECA\x006\0A\x9C\xECA\xD4\xDE-.A\xA4\xECA\xCC\xB36\0A\xA8\xECA\x006\0A\xA4\xECA\xDC\xDE-.A\x8C\xE0A:\0\0A\x88\xE0A\xEC\xDE6\0\vA\x90\xE0A\x88\xE0(\0"\x006\0 \0A\xEC\xDEG@ \0 \0(Aj6\vA\x94\xE0A:\0\0\vA\x90\xE0(\0"\x006\0 \0A\xEC\xDEG@ \0 \0(Aj6\v\v\xB1\x7F \0A\xC8\x876\0 \0A\bj!@ \0(\f \0(\b"kAu K@@  Atj(\0"E\r\0  ("Ak6 \r\0  (\0(\b\0\v Aj!\f\v\v \0A\x90j #\0Ak"$\0  6\f (\f"(\0"@  6 (\b A\fj \xE2\v Aj$\0 \0\v \0 \0A\x98\x906\0 \0(\b*G@ \0(\b\xA6\v \0\v\0A\x7F\v\x9D\x07 \x7F  \x006\0AA\0 \x07\x1B! A\x80q!@ AF@ \r( \r,\0\v" A\0H"\x1B"AK@ (\0! AtAk"@  \r(\0 \r \x1BAj \xFC
  5875. \0\0\v   j6\0\v A\xB0q"AG@  A F\x7F (\0 \0\v6\0\v@@@@@@ \b j-\0\0\0\v  (\x006\0\f\v  (\x006\0 A (\0(,\0!\x07  (\0"Aj6\0  \x076\0\f\v \r( \r,\0\v"\x07 \x07A\0H"\x07\x1BE\r \r(\0 \r \x07\x1B(\0!\x07  (\0"Aj6\0  \x076\0\f\v E\r \f( \f,\0\v"\x07 \x07A\0H"\x1B"E\r (\0!\x07 At"@ \x07 \f(\0 \f \x1B \xFC
  5876. \0\0\v  \x07 j6\0\f\v (\0  j"!\x07@@  \x07M\r\0 A\xC0\0 \x07(\0 (\0(\f\0E\r\0 \x07Aj!\x07\f\v\v A\0J@ (\0! !@ E  \x07OrE@ Ak! \x07Ak"\x07(\0!  Aj"6\0  6\0 !\f\v\v \x7F A0 (\0(,\0A\0\v! (\0!@ A\0LE@  Aj"6\0  6\0 Ak! !\f\v\v  (\0"Aj6\0  6\0\v@  \x07F@ A0 (\0(,\0!\x07  (\0"Aj6\0  \x076\0\f\v \v( \v,\0\v" A\0H"\x1B\x7F \v(\0 \v \x1B,\0\0A\x7F\v!A\0!A\0!@  \x07F\r@  G@ !\f\v  (\0"Aj6\0 
  5877. 6\0A\0! Aj" \v( \v,\0\v" A\0H\x1BO@ !\f\vA\x7F! \v(\0" \v A\0H"\x1B j-\0\0A\xFF\0F\r\0  \v \x1B j,\0\0!\v \x07Ak"\x07(\0!  (\0"Aj6\0  6\0 Aj!\f\0\v\0\v (\0\x8F\v Aj!\f\v\v\v\x8A\x7F#\0Ak"
  5878. $\0@ \0@ \xFE!\f\v \xFD!\v@ @
  5879. Aj"\0  (\0(,\0 
  5880. (6\0\0 \0  (\0( \0\f\v
  5881. Aj"\0  (\0((\0 
  5882. (6\0\0 \0  (\0(\0\v \b \0| \0    (\0(\f\0\x006\0   (\0(\0\x006\0
  5883. Aj"\0  (\0(\0  \0X \0  \0  (\0(\0 \x07 \0| \0   (\0($\0\x006\0
  5884. Aj$\0\v\x7FA\f9"\0A\x006\b \0B\x007\0 \0\v\xF7 \x7F  \x006\0 A\x80q!@ AF@ \r( \r,\0\v" A\0H"\x1B"AK@ (\0! Ak"@  \r(\0 \r \x1BAj \xFC
  5885. \0\0\v   j6\0\v A\xB0q"AG@  A F\x7F (\0 \0\v6\0\v@@@@@@ \b j-\0\0\0\v  (\x006\0\f\v  (\x006\0 A (\0(\0!  (\0"Aj6\0  :\0\0\f\v \r( \r,\0\v" A\0H"\x1BE\r \r(\0 \r \x1B-\0\0!  (\0"Aj6\0  :\0\0\f\v E\r \f( \f,\0\v" A\0H"\x1B"E\r (\0! @  \f(\0 \f \x1B \xFC
  5886. \0\0\v   j6\0\f\v (\b! (\0  \x07j"!@@  M\r\0 ,\0\0"A\0H\r\0  Atj-\0\0A\xC0\0qE\r\0 Aj!\f\v\v "A\0J@@ E  OrE@ Ak! Ak"-\0\0!  (\0"Aj6\0  :\0\0\f\v\v \x7F A0 (\0(\0A\0\v!@  (\0"Aj6\0 A\0LE@  :\0\0 Ak!\f\v\v  :\0\0\v@  F@ A0 (\0(\0!  (\0"Aj6\0  :\0\0\f\v \v( \v,\0\v" A\0H"\x1B\x7F \v(\0 \v \x1B,\0\0A\x7F\v!A\0!A\0!@  F\r@  G@ !\f\v  (\0"Aj6\0 
  5887. :\0\0A\0! Aj" \v( \v,\0\v" A\0H\x1BO@ !\f\vA\x7F! \v(\0" \v A\0H"\x1B j-\0\0A\xFF\0F\r\0  \v \x1B j,\0\0!\v Ak"-\0\0!  (\0"Aj6\0  :\0\0 Aj!\f\0\v\0\v (\0c\v Aj!\f\v\v\v\x8A\x7F#\0Ak"
  5888. $\0@ \0@ \x83!\f\v \x82!\v@ @
  5889. Aj"\0  (\0(,\0 
  5890. (6\0\0 \0  (\0( \0\f\v
  5891. Aj"\0  (\0((\0 
  5892. (6\0\0 \0  (\0(\0\v \b \0X \0    (\0(\f\0\0:\0\0   (\0(\0\0:\0\0
  5893. Aj"\0  (\0(\0  \0X \0  \0  (\0(\0 \x07 \0X \0   (\0($\0\x006\0
  5894. Aj$\0\v
  5895. \0 \0A\xA4\xDE^\v
  5896. \0 \0A\xAC\xDE^\v\xD7\x7F@A\xF6\xFF\xFF\xFF k O@ \0,\0\vA\0H! \0(\0A\xF7\xFF\xFF\xFF! A\xF2\xFF\xFF\xFFM@  j" At"  K\x1BArAj!\v \0 \x1B! U!@ E\r\0 At"\x07E\r\0   \x07\xFC
  5897. \0\0\v@  F\r\0  kAt"\x07E\r\0 At" j  j \x07\xFC
  5898. \0\0\v AG@ !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b\f\v0\0\v \0 6\v\xD8\x7F#\0A\x90k"\v$\0 \v
  5899. 6\x88 \v 6\x8C@ \0 \vA\x8Cj(@  (\0Ar6\0A\0!\0\f\v \vA\xE3\x006l \v \vA\xF0\0j"6h \v 6d \v \vA\x80j6\` \vA\x006P \vB\x007H \vA\x006@ \vB\x0078 \vA\x0060 \vB\x007( \vA\x006 \vB\x007 \vA\x006 \vB\x007\b \vA\xC8\0j \vA8j!\f \vA(j \vAj#\0Ak"
  5900. $\0@ @
  5901. Aj" \xFE" (\0(,\0\f\v
  5902. Aj" \xFD" (\0(,\0\v \v
  5903. (6\0\\   (\0( \0 |     (\0(\0 |   \v  (\0(\f\0\x006X \v  (\0(\0\x006T   (\0(\0 X     (\0(\0 \f |   \v  (\0($\0\x006
  5904. Aj$\0 \b(\x006\0 A\x80q!A\0!A\0!
  5905. @
  5906. !@@\x7F@@@@ AF\r\0 \0 \vA\x8Cj(\r\0A\0!@@@@@@ \vA\xDC\0j j"\f-\0\0\0\f\v AF\r
  5907. \x07A \0: \x07(\0(\f\0\r\x07  (\0Ar6\0A\0!\0\f\v AG\r\x07\f \v@ \v(, \v,\x003" A\0H\x1BE\r\0 \0: \v(( \vA(j" \v,\x003"A\0H\x1B(\0G\r\0 \0Q A\0:\0\0   \v(, \v,\x003" A\0H\x1BAK\x1B!
  5908. \f
  5909. \v \v( \v,\0#"
  5910. A\0H\x1B@ \0: \v( \vAj \v,\0#"
  5911. A\0H\x1B(\0F\r \v-\x003!\v \v(
  5912. A\0H\x1B!@ \v(, A\xFFq \xC0A\0H\x1B"@ E\r  (\0Ar6\0A\0!\0\f\v E\r \v  A\0G:\0\0\f\b\v   AIrrE@A\0!
  5913. AF \v-\0_A\0GqE\r \v \v(8" \vA8j \v,\0C"
  5914. A\0H\x1B!@ E\r\0 \fAk-\0\0AK\r\0@@   \vA8j
  5915. \xC0A\0H"\f\x1B \v(<
  5916. A\xFFq \f\x1BAtjF\r\0 \x07A (\0 \x07(\0(\f\0 \v(8! \v-\0C!
  5917. E\r\0 Aj!\f\v\v   \vA8j
  5918. \xC0A\0H\x1B"\fkAu"\r \v(\f \v,\0" A\0H"\x1B"M\x7F At \v(\b \vA\bj \x1Bj"
  5919. \rAtk!#\0Ak"\r$\0  \f
  5920. kA|qhE \rAj$\0\r \v-\0C!
  5921. \v(8 \v \vA8j
  5922. \xC0A\0H\x1B!\v@@  \v(8 \vA8j \v,\0C"A\0H"
  5923. \x1B \v(< 
  5924. \x1BAtjF\r\0 \0 \vA\x8Cj(\r\0 \0: (\0G\r\0 \0Q Aj!\f\v\v E\r\x07 !
  5925.  \v(8 \vA8j \v,\0C"A\0H"\x1B \v(<  \x1BAtjF\r\b  (\0Ar6\0A\0!\0\f\v@@ \0 \vA\x8Cj(\r\0\x7F \x07A\xC0\0 \0:"
  5926. \x07(\0(\f\0@ (\0" \v(\x88F@ \b \vA\x88jk (\0!\v Aj6\0 
  5927. 6\0 Aj\f\v \v(L \v,\0S" A\0H\x1BE Er\r
  5928. \v(TG\r \v(d"
  5929. \v(\`F@ \vA\xE8\0j \vA\xE4\0j \vA\xE0\0jk \v(d!
  5930. \v \v
  5931. Aj6d
  5932. 6\0A\0\v! \0Q\f\v\v E \v(d"
  5933. \v(hFrE@ \v(\`
  5934. F@ \vA\xE8\0j \vA\xE4\0j \vA\xE0\0jk \v(d!
  5935. \v \v
  5936. Aj6d
  5937. 6\0\v@ \v(A\0L\r\0@ \0 \vA\x8Cj(E@ \0: \v(XF\r\v  (\0Ar6\0A\0!\0\f\v@ \0Q \v(A\0L\r@ \0 \vA\x8Cj(E@ \x07A\xC0\0 \0: \x07(\0(\f\0\r\v  (\0Ar6\0A\0!\0\f\v (\0 \v(\x88F@ \b \vA\x88jk\v \0:! (\0"Aj6\0  6\0 \v \v(Ak6\f\0\v\0\v !
  5938. (\0 \b(\0G\r\x07  (\0Ar6\0A\0!\0\f\v \0Q A:\0\0 \vAj  \v( \v,\0#" A\0H\x1BAK\x1B!
  5939. \f\v@ E\r\0A!\x07@ \x07 ( ,\0\v" A\0H\x1BO\r@ \0 \vA\x8Cj(E@ \0: \x07At (\0  ,\0\vA\0H\x1Bj(\0F\r\v  (\0Ar6\0A\0!\0\f\v \0Q \x07Aj!\x07\f\0\v\0\vA!\0 \v(h" \v(d"F\r\0A\0!\0 \vA\x006\0 \vA\xC8\0j   \v5 \v(\0@  (\0Ar6\0\f\vA!\0\v \vA\bj  \vAj  \vA(j  \vA8j  \vA\xC8\0j  \v(h! \vA\x006h E\r  \v(l\0\f\vA\0\f\vA\v!@ E@ \vA\bj \0(\0B\xDDA!\f\v \0 \vA\x8Cj(\r \x07A \0: \x07(\0(\f\0E\rA\0!\f\0\v\0\v !
  5940. \v Aj!\f\0\v\0\v \vA\x90j$\0 \0\v\0 \0@ \01\v \0!\v
  5941. \0 \0A\x94\xDE^\v
  5942. \0 \0A\x9C\xDE^\v\xB8\x7F (\0!\x07A\0 \0(\0" \0(A\xE3\0F"\x1BA\x7FA (\0 k"At" AM\x1B A\xFF\xFF\xFF\xFF\x07O\x1B"\b\x9D"@@ E@ \0 6\0\f\v \0(\0! @   \xFC
  5943. \0\0\v \0 6\0 E\r\0  \0(\0 \0(\0!\v \0A\xE4\x006   \x07 kj6\0  \0(\0 \bj6\0\v0\0\v\xEE\x7F#\0A\x90k"\v$\0 \v
  5944. 6\x88 \v 6\x8C@ \0 \vA\x8Cj)@  (\0Ar6\0A\0!\0\f\v \vA\xE3\x006l \v \vA\xF0\0j"6h \v 6d \v \vA\x80j6\` \vA\x006P \vB\x007H \vA\x006@ \vB\x0078 \vA\x0060 \vB\x007( \vA\x006 \vB\x007 \vA\x006 \vB\x007\b \vA\xC8\0j \vA8j! \vA(j \vAj#\0Ak"
  5945. $\0@ @
  5946. Aj" \x83" (\0(,\0\f\v
  5947. Aj" \x82" (\0(,\0\v \v
  5948. (6\0\\   (\0( \0 X     (\0(\0 X   \v  (\0(\f\0\0:\0[ \v  (\0(\0\0:\0Z   (\0(\0 X     (\0(\0  X   \v  (\0($\0\x006
  5949. Aj$\0 \b(\x006\0 A\x80q!A\0!A\0!
  5950. @@
  5951. !@@@@@@@\x7F@@@ AF\r\0 \0 \vA\x8Cj)\r\0A\0!@@@@@@ \vA\xDC\0j j"\f-\0\0\0\v AF\r\r \0;"A\0N@ \x07(\b Atj-\0\0Aq\r\x07\v  (\0Ar6\0A\0!\0\f\v AG\r\f\f\v@ \v(, \v,\x003" A\0H\x1BE\r\0 \0;A\xFFq \v(( \vA(j" \v,\x003"A\0H\x1B-\0\0G\r\0 \0S A\0:\0\0   \v(, \v,\x003" A\0H\x1BAK\x1B!
  5952. \f\v \v( \v,\0#"
  5953. A\0H\x1B@ \0;A\xFFq \v( \vAj \v,\0#"
  5954. A\0H\x1B-\0\0F\r \v-\x003!\v \v(
  5955. A\0H\x1B!@ \v(, A\xFFq \xC0A\0H\x1B"@ E\r  (\0Ar6\0A\0!\0\f\v E\r\f\v  A\0G:\0\0\f\v\v   AIrrE@A\0!
  5956. AF \v-\0_A\0GqE\r\r\v \v(8" \vA8j \v,\0C"\rA\0H"\x1B! E\r\b \fAk-\0\0AK\r\b  \v(< \r \x1Bj! \x07(\b!\f !
  5957. @ 
  5958. F\r\b
  5959. ,\0\0"A\0H\r\x07 \f Atj-\0\0AqE\r\x07
  5960. Aj!
  5961. \f\0\v\0\v@@ \0 \vA\x8Cj)\r\0\x7F@ \0;"
  5962. A\0H\r\0 \x07(\b
  5963. Atj-\0\0A\xC0\0qE\r\0 (\0" \v(\x88F@ \b \vA\x88j\x84 (\0!\v Aj6\0 
  5964. :\0\0 Aj\f\v \v(L \v,\0S" A\0H\x1BE Er\r \v-\0Z
  5965. A\xFFqG\r \v(d"
  5966. \v(\`F@ \vA\xE8\0j \vA\xE4\0j \vA\xE0\0jk \v(d!
  5967. \v \v
  5968. Aj6d
  5969. 6\0A\0\v! \0S\f\v\v E \v(d"
  5970. \v(hFrE@ \v(\`
  5971. F@ \vA\xE8\0j \vA\xE4\0j \vA\xE0\0jk \v(d!
  5972. \v \v
  5973. Aj6d
  5974. 6\0\v@ \v(A\0L\r\0@ \0 \vA\x8Cj)E@ \0;A\xFFq \v-\0[F\r\v  (\0Ar6\0A\0!\0\f\v@ \0S \v(A\0L\r@@ \0 \vA\x8Cj)\r\0 \0;"A\0H\r\0 \x07(\b Atj-\0\0A\xC0\0q\r\v  (\0Ar6\0A\0!\0\f\v (\0 \v(\x88F@ \b \vA\x88j\x84\v \0;! (\0"Aj6\0  :\0\0 \v \v(Ak6\f\0\v\0\v !
  5975. (\0 \b(\0G\r\v  (\0Ar6\0A\0!\0\f\f\v \0S A:\0\0 \vAj  \v( \v,\0#" A\0H\x1BAK\x1B!
  5976. \f
  5977. \v@ E\r\0A!@  ( ,\0\v" A\0H\x1BO\r@ \0 \vA\x8Cj)E@ \0;A\xFFq (\0  ,\0\vA\0H\x1B j-\0\0F\r\v  (\0Ar6\0A\0!\0\f\r\v \0S Aj!\f\0\v\0\vA!\0 \v(h" \v(d"F\r
  5978. A\0!\0 \vA\x006\0 \vA\xC8\0j   \v5 \v(\0@  (\0Ar6\0\f\v\vA!\0\f
  5979. \vA\0\f\vA\v!@ E@ \vA\bj \0(\0@\xC0\xAAA!\f\v \0 \vA\x8Cj)\r \0;"A\0H\r \x07(\b Atj-\0\0AqE\rA\0!\f\0\v\0\v
  5980. !\v  k"
  5981. \v(\f \v,\0"\f \fA\0H"\f\x1B"M@ \v(\b \vA\bj \f\x1B j"\r
  5982. k"
  5983.  \r
  5984. khE\r \v(8! \v-\0C!\r\v  \vA8j \r\xC0A\0H\x1B!\f\v !\v@@  \v(8 \vA8j \v,\0C"A\0H"
  5985. \x1B \v(< 
  5986. \x1BjF\r\0 \0 \vA\x8Cj)\r\0 \0;A\xFFq -\0\0G\r\0 \0S Aj!\f\v\v \r\v !
  5987. \f\v !
  5988.  \v(8 \vA8j \v,\0C"A\0H"\x1B \v(<  \x1BjF\r\0  (\0Ar6\0A\0!\0\f\v Aj!\f\v\v \vA\bj  \vAj  \vA(j  \vA8j  \vA\xC8\0j  \v(h! \vA\x006h E\r\0  \v(l\0\v \vA\x90j$\0 \0\v\v\0 \0AA-\xDF\v\v\0 \0AA-\xE1\vd\x7F#\0Ak"$\0 A\0:\0  :\0  :\0\r A%:\0\f @  :\0  :\0\r\v   (\0 k A\fj  \0(\0\xB4 j6\0 Aj$\0\vA\0    AN! -\0\0AqE@ \0 A\xD0j A\xECj  A\xE4\0I\x1B A\xC5\0H\x1BA\xECk6\0\v\v@\0   \0A\bj \0(\b(\0\0"\0 \0A\xA0j  A\0\x95 \0k"\0A\x9FL@  \0A\fmA\fo6\0\v\v@\0   \0A\bj \0(\b(\0\0\0"\0 \0A\xA8j  A\0\x95 \0k"\0A\xA7L@  \0A\fmA\x07o6\0\v\vA\0    AO! -\0\0AqE@ \0 A\xD0j A\xECj  A\xE4\0I\x1B A\xC5\0H\x1BA\xECk6\0\v\v@\0   \0A\bj \0(\b(\0\0"\0 \0A\xA0j  A\0\x97 \0k"\0A\x9FL@  \0A\fmA\fo6\0\v\v@\0   \0A\bj \0(\b(\0\0\0"\0 \0A\xA8j  A\0\x97 \0k"\0A\xA7L@  \0A\fmA\x07o6\0\v\v\0A\v\xBD\x7F#\0Ak"
  5989. $\0 =!
  5990. Aj n"\f \f(\0(\0  6\0@@ \0"\b-\0\0"A+k\0\0\v \xC0 (\0(,\0!  (\0"\x07Aj6\0 \x07 6\0 \0Aj!\b\v@@  \b"kAL\r\0 -\0\0A0G\r\0 -\0A rA\xF8\0G\r\0 A0 (\0(,\0!\x07  (\0"\bAj6\0 \b \x076\0 ,\0 (\0(,\0!\x07  (\0"\bAj6\0 \b \x076\0 Aj"\b!@  M\r ,\0\0*!\xB8E\r Aj!\f\0\v\0\v@  M\r ,\0\0*!\xB7E\r Aj!\f\0\v\0\v@
  5991. (\b
  5992. ,\0"\x07 \x07A\0H\x1BE@ \b  (\0 (\0(0\0  (\0  \bkAtj6\0\f\v \b c \f \f(\0(\0\0! \b!\x07@  \x07M@  \b \0kAtj (\0\x8F@
  5993. ("
  5994. Aj"
  5995. ,\0A\0H"\x1B \rj,\0\0A\0L\r\0 \v   \x1B \rj,\0\0G\r\0  (\0"\vAj6\0 \v 6\0A\0!\v \r \r
  5996. (\b
  5997. ,\0" A\0H\x1BAkIj!\r\v \x07,\0\0 (\0(,\0!  (\0"Aj6\0  6\0 \x07Aj!\x07 \vAj!\v\f\v\v\v@@@  M\r Aj!\x07 ,\0\0"A.G@  (\0(,\0!  (\0"\bAj6\0 \b 6\0 \x07!\f\v\v \f \f(\0(\f\0\0!  (\0"\bAj"\v6\0 \b 6\0\f\v (\0!\v !\x07\v \x07  \v (\0(0\0  (\0  \x07kAtj"6\0     \0kAtj  F\x1B6\0
  5998. Aj 
  5999. Aj$\0\v\xC4\x7F#\0A\x90k"$\0A\bAA
  6000. ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! A\x83j!@ E A\x80qEr\r\0 \b@ A0:\0\x83 A\x84j!\f\v \x07A\bG\r\0 A0:\0\x83 A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0\x84 A\x85j!\v A\xF8\0j  A\x90j  \x94 (x!@ A\x88\x80qA\x88\x80G\r\0@  F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v A\x83j"  G! Aj"\x07 $    Aj" A\fj A\bj \x07\x90 (# \0  (\f (\b  \\ A\x90j$\0\vC\x7F#\0Ak"$\0  6\fA\xB0 A\xF0\xC7A\xCB,A A\fj"4A\xF0\xC7A\xCF,A 4 Aj$\0 \0\v\xAC\x7F#\0Ak"
  6001. $\0 >!
  6002. Aj p"\f \f(\0(\0  6\0@@ \0"\b-\0\0"A+k\0\0\v \xC0 (\0(\0!  (\0"\x07Aj6\0 \x07 :\0\0 \0Aj!\b\v@@  \b"kAL\r\0 -\0\0A0G\r\0 -\0A rA\xF8\0G\r\0 A0 (\0(\0!\x07  (\0"\bAj6\0 \b \x07:\0\0 ,\0 (\0(\0!\x07  (\0"\bAj6\0 \b \x07:\0\0 Aj"\b!@  M\r ,\0\0*!\xB8E\r Aj!\f\0\v\0\v@  M\r ,\0\0*!\xB7E\r Aj!\f\0\v\0\v@
  6003. (\b
  6004. ,\0"\x07 \x07A\0H\x1BE@ \b  (\0 (\0( \0  (\0  \bkj6\0\f\v \b c \f \f(\0(\0\0! \b!\x07@  \x07M@  \b \0kj (\0c@
  6005. ("
  6006. Aj"
  6007. ,\0A\0H"\x1B \rj,\0\0A\0L\r\0 \v   \x1B \rj,\0\0G\r\0  (\0"\vAj6\0 \v :\0\0A\0!\v \r \r
  6008. (\b
  6009. ,\0" A\0H\x1BAkIj!\r\v \x07,\0\0 (\0(\0!  (\0"Aj6\0  :\0\0 \x07Aj!\x07 \vAj!\v\f\v\v\v@@@  M@ !\x07\f\v Aj!\x07 ,\0\0"A.G\r \f \f(\0(\f\0\0!  (\0"\bAj6\0 \b :\0\0\v \x07  (\0 (\0( \0  (\0  \x07kj"6\0     \0kj  F\x1B6\0
  6010. Aj 
  6011. Aj$\0\v  (\0(\0!  (\0"\bAj6\0 \b :\0\0 \x07!\f\0\v\0\v\xB9\x7F#\0A@j"$\0A\bAA
  6012. ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! A3j!@ E A\x80qEr\r\0 \b@ A0:\x003 A4j!\f\v \x07A\bG\r\0 A0:\x003 A\xD8\0A\xF8\0 A\x80\x80q\x1B:\x004 A5j!\v A(j  A@k  \x94 ((!@ A\x88\x80qA\x88\x80G\r\0@  F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v A3j"  G! Aj"\x07 $    Aj" A\fj A\bj \x07\x93 (# \0  (\f (\b  Z A@k$\0\v\xED\b\x7F#\0Ak"$\0A\xA5\bAA\xA0 A\xEE AAA\0A\0\fA\x92\fAA\xF4 A\xA8!AAA\0A\0\fA\x88\xCE-\0\0E@A\x88\xCEA:\0\0A\xAC!A\xB8\xC8\x07\vA\xFC A\x9C%A\xD4%A\0A\x8A&AA\x8D&A\0A\x8D&A\0A\x83A\x8F&A\x07
  6013. A\xFC AA\x94&A\x98&A"A\b#\0Ak"\0$\0 \0A 6\fA\xFC A\x9CAA\x9C&A\xA8&A# \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A
  6014. 6\fA\xFC A\xEDAA\xB0&A\xC0&A$ \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A\v6\fA\xFC A\x83AA\xC8&A\xD0&A% \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A\f6\fA\xFC A\xBF
  6015. AA\xF8&A\x84'A& \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A\r6\fA\xFC A\xBB
  6016. AA\x90'A\xA0'A' \0A\fj4A\0A\0A\0 \0Aj$\0A\xFC A\xB8\xC8A\x83A\xBF
  6017.  A\x94\xCE-\0\0E@A\x94\xCEA:\0\0A\xA8'A\xC0\xC7\x07\vA\xB4*A\xE0*A\x98+A\0A\xCE+AA\x8D&A\0A\x8D&A\0A\xD7A\xD1+A
  6018. A\xB4*AA\xD4+A\xD8+A(A#\0Ak"\0$\0 \0A6\fA\xB4*A\x9CAA\xDC+A\xE8+A) \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A6\fA\xB4*A\xEDAA\xF0+A\x80,A* \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A6\fA\xB4*A\x83AA\x88,A\x90,A+ \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A6\fA\xB4*A\xBF
  6019. AA\x9C,A\xA8,A, \0A\fj4A\0A\0A\0 \0Aj$\0#\0Ak"\0$\0 \0A6\fA\xB4*A\xBB
  6020. AA\xB0,A\xC0,A- \0A\fj4A\0A\0A\0 \0Aj$\0A\xB4*A\xC0\xC7A\x83A\xBF
  6021.  A\xB0 A\xA9A\xC6,AA\xC8,A\b AjA\xEB
  6022. A\0\x92A\xB6A\x92#\0Ak"\0$\0 \0A\b6\fA\xB0 A\xC2A\xA8\xC7A\xD4,A \0A\fj"4A\xA8\xC7A\xD8,A\x1B 4 \0Aj$\0A\x8A\vA\flA\xDF\vAlA\x94\vA$lA\xE6\vA0lA\xF5
  6023. A<lA\xC8A\xC8\0lA\xB0 A\xE8,A\x94AAA\0A\xE8,A\xA3A\0A\xE8,A\xBDAA\xE8,A\xB9AA\xE8,A\xB5AA\xE8,A\xB1AA\xE8,A\x9FAA\xE8,A\x9BAA\xE8,A\x93A\x07A\xE8,A\x8FA\bA\xD0 A\xFC
  6024. A\x89-AA\x8B-A\b#\0Ak"\0$\0 \0A\x006\fA\xD0 A\x83A\xE8,A\x8E-A \0A\fj"4A\xE8,A\x92-A! 4 \0Aj$\0A\xD0  Aj$\0\v3\x7F  \0("j!@  F@ \0 6 A\0:\0\0 Aj!\f\v\v\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R!  \0A\xD0j~! \0A\xC4j  \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6025. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6026. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC   \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \x9D6\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@  (\0Ar6\0\v \0(\xCC \0A\xB8j  \0A\xC4j  \0A\xD0j$\0\v8\x7F#\0Ak"$\0  6\f  H6\b \0A\xEC\r (\f\xA9 A\bjI Aj$\0\v\xB1~\x7F#\0A k"\b$\0@@@  G@A\xF8\xD7(\0!\fA\xF8\xD7A\x006\0#\0Ak" $\0*#\0Ak"
  6027. $\0#\0Ak"\v$\0 \v  \bAjA\xBA \v)\0!
  6028. \v)\b7\b
  6029. 7\0 \vAj$\0
  6030. )\0!
  6031. )\b7\b 7\0
  6032. Aj$\0 )\0! \b )\b7 \b 7\b Aj$\0 \b)! \b)\b!A\xF8\xD7(\0"E\r \b( G\r ! !\x07 A\xC4\0G\r\f\v A6\0\f\vA\xF8\xD7 \f6\0 \b( F\r\v A6\0 ! \x07!\v \0 7\0 \0 7\b \bA j$\0\v\xC0\x7F|#\0Ak"$\0@@@ \0 G@A\xF8\xD7(\0!A\xF8\xD7A\x006\0*#\0Ak"$\0  \0 A\fjA\xBA )\0 )\b\xC4! Aj$\0@A\xF8\xD7(\0"\0@ (\f F\r\f\vA\xF8\xD7 6\0 (\f G\r\f\v \0A\xC4\0G\r\f\v A6\0\f\vD\0\0\0\0\0\0\0\0!\v A6\0\v Aj$\0 \v\xBC\x7F}#\0Ak"$\0@@@ \0 G@A\xF8\xD7(\0!A\xF8\xD7A\x006\0*#\0Ak"$\0  \0 A\fjA\0\xBA )\0 )\b\xAB! Aj$\0@A\xF8\xD7(\0"\0@ (\f F\r\f\vA\xF8\xD7 6\0 (\f G\r\f\v \0A\xC4\0G\r\f\v A6\0\f\vC\0\0\0\0!\v A6\0\v Aj$\0 \v\xBD\x7F~#\0Ak"$\0~ \0 G@@@ \0-\0\0"A-G\r\0 \0Aj"\0 G\r\0\f\vA\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xBB!\x07@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0G\r A6\0B\x7F\f\vA\xF8\xD7 6\0 (\f F\r\0\f\vB\0 \x07} \x07 A-F\x1B\f\v\v A6\0B\0\v Aj$\0\v\xD8\x7F~#\0Ak"$\0\x7F@ \0 G@@@ \0-\0\0"A-G\r\0 \0Aj"\0 G\r\0\f\vA\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xBB!\x07@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0F \x07B\xFF\xFF\xFF\xFFVr\r\f\vA\xF8\xD7 6\0  (\fG\r \x07B\x80\x80\x80\x80T\r\v A6\0A\x7F\f\v\v A6\0A\0\f\vA\0 \x07\xA7"\0k \0 A-F\x1B\v Aj$\0\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j  \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6033. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6034. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0   \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \x9D6\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@  (\0Ar6\0\v \0(\xDC \0A\xB8j  \0A\xC8j  \0A\xE0j$\0\v\xDB\x7F~#\0Ak"$\0\x7F@ \0 G@@@ \0-\0\0"A-G\r\0 \0Aj"\0 G\r\0\f\vA\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xBB!\x07@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0F \x07B\xFF\xFFVr\r\f\vA\xF8\xD7 6\0  (\fG\r \x07B\x80\x80T\r\v A6\0A\xFF\xFF\f\v\v A6\0A\0\f\vA\0 \x07\xA7"\0k \0 A-F\x1B\v Aj$\0A\xFF\xFFq\v\xAC\x7F~#\0Ak"$\0@ \0 G@A\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xA3!@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0G\r A6\0B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F B\0U\x1B!\f\vA\xF8\xD7 6\0 (\f F\r\v\v A6\0B\0!\v Aj$\0 \v\xDD\x7F~#\0Ak"$\0\x7F@ \0 G@@A\xF8\xD7(\0!A\xF8\xD7A\x006\0* \0 A\fj \xA3!@A\xF8\xD7(\0"\0@ (\f G\r \0A\xC4\0G\r A6\0A\xFF\xFF\xFF\xFF\x07 B\0U\r\f\vA\xF8\xD7 6\0 (\f F\r\0\f\v B\xFF\xFF\xFF\xFFwW@ A6\0\f\v B\x80\x80\x80\x80\bY@ A6\0A\xFF\xFF\xFF\xFF\x07\f\v \xA7\f\v\v A6\0A\0\f\vA\x80\x80\x80\x80x\v Aj$\0\v\x88\x7F@  kAu"A\xF7\xFF\xFF\xFFI@@ AM@ \0 :\0\v\f\v Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v  k"E  FrE@ \0  \xFC
  6035. \0\0\v \0 jA\x006\0\f\v0\0\v\v\0 \0  B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\xBE\v\x86\b\x7F (\0!@@@@@@@\x7F@@@@ E\r\0 (\0"E\r\0 \0E@ !\f\v A\x006\0 !\f\v@A\xCC\xCF(\0(\0E@ \0E\r E\r\f !@ ,\0\0"@ \0 A\xFF\xBFq6\0 \0Aj!\0 Aj! Ak"\r\f\v\v \0A\x006\0 A\x006\0  k\v ! \0E\r\f\v y\vA!\x07\f\vA\0\f\vA\v!\x07@ \x07E@ -\0\0Av"Ak Au jrA\x07K\r\x7F Aj" A\x80\x80\x80qE\r\0 ,\0\0A@N@ Ak!\f\x07\v Aj" A\x80\x80 qE\r\0 ,\0\0A@N@ Ak!\f\x07\v Aj\v! Ak!A!\x07\f\v@@ Aq ,\0\0"A\0Lr\r\0 (\0"A\x81\x82\x84\bk rA\x80\x81\x82\x84xq\r\0@ Ak! "Aj! ("A\x81\x82\x84\bk rA\x80\x81\x82\x84xqE\r\0\v\v \xC0A\0J@ Ak! Aj!\f\v\v A\xFFqA\xC2k"A2K\r Aj! At(\x80\x84!A\0!\x07\f\0\v\0\v@ \x07E@ E\r\x07@@ -\0\0"\x07\xC0"A\0L\r\0 Aq AIrE@@@ (\0"A\x81\x82\x84\bk rA\x80\x81\x82\x84xq\r \0 A\xFFq6\0 \0 -\06 \0 -\06\b \0 -\06\f \0Aj!\0 Aj! Ak"AK\r\0\v -\0\0!\v A\xFFq!\x07 \xC0A\0L\r\v \0 \x076\0 \0Aj!\0 Aj! Ak"\r\f \v\v \x07A\xC2k"A2K\r Aj! At(\x80\x84!A!\x07\f\v -\0\0"\bAv"Ak  AujrA\x07K\r@@\x7F Aj" \bA\x80k Atr"\x07A\0N\r\0 -\0\0A\x80k"A?K\r  \x07At"\br!\x07 Aj" \bA\0N\r\0 -\0\0A\x80k"A?K\r  \x07Atr!\x07 Aj\v! \0 \x076\0 Ak! \0Aj!\0\f\vA\xF8\xD7A6\0 Ak!\f\vA\0!\x07\f\0\v\0\v Ak! \r -\0\0!\v A\xFFq\r\0 \0@ \0A\x006\0 A\x006\0\v  k\vA\xF8\xD7A6\0 \0E\r\v  6\0\vA\x7F\v  6\0 \v#\x7F \0!@ "Aj! (\0\r\0\v  \0kAu\v\0 \0\xBA@ \0!\v\v%\x7F#\0Ak"$\0  6\f \0A\xE9 \xA9 Aj$\0\v3\x7F A\x80\x80\x80\x80O@\x85\0\v \0 U"6 \0 6\0 \0  Atj6\b\v\xC9\x7F~#\0A\x90k"$\0 A\0A\x90\xFC\v\0 A\x7F6L  \x006, A\xE2\x006  \x006T ! !#\0A\xB0k"$\0 (L@@ (E@ \xC8 (E\r\v -\0\0"E\r@@@@@ A\xFFq"\0_@@ "Aj! -\0_\r\0\v B\0J@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v_\r\0\v (! )pB\0Y@  Ak"6\v  (,k\xAC )x ||!\f\v\x7F@@ \0A%F@ -\0"\0A*F\r \0A%G\r\v B\0J@ -\0\0A%F@@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"_\r\0\v Aj!\f\v ("\0 (hG@  \0Aj6 \0-\0\0!\f\v %!\v -\0\0 G@ )pB\0Y@  (Ak6\v A\0N \rr\r
  6036. \f \v ( (,k\xAC )x ||! !\f\vA\0!\x07 Aj\f\v@ \0A0k"\0A K\r\0 -\0A$G\r\0#\0Ak" 6\f   \0AtjAk  \0AK\x1B"\0Aj6\b \0(\0!\x07 Aj\f\v (\0!\x07 Aj! Aj\v!A\0!\vA\0! -\0\0"A0kA\xFFqA M@@ A
  6037. l A\xFFqjA0k! -\0! Aj! A0kA\xFFqA
  6038. I\r\0\v\v A\xFFqA\xED\0G\x7F A\0! \x07A\0G!\v -\0!A\0!
  6039. Aj\v"Aj!A!\0@@@@@@ A\xFFqA\xC1\0k:        \0      \v Aj  -\0A\xE8\0F"\0\x1B!A~A\x7F \0\x1B!\0\f\v Aj  -\0A\xEC\0F"\0\x1B!AA \0\x1B!\0\f\vA!\0\f\vA!\0\f\vA\0!\0 !\vA \0 -\0\0"\0A/qAF"\x1B!@ \0A r \0 \x1B"\fA\xDB\0F\r\0@ \fA\xEE\0G@ \fA\xE3\0G\rA  AL\x1B!\f\v \x07  \xAA\f\v B\0J@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v_\r\0\v (! )pB\0Y@  Ak"6\v  (,k\xAC )x ||!\v  \xAC"J@ ("\0 (hG@  \0Aj6\f\v %A\0H\r\v )pB\0Y@  (Ak6\vA!@@@@@@@@@@@@ \fA\xD8\0k!\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\v\0\v \fA\xC1\0k"\0AKA \0tA\xF1\0qEr\r
  6040. \v A\bj  A\0\xAD )xB\0 ( (,k\xAC}Q\r \x07E\r )! )\b! \x07 \v \fArA\xF3\0F@ A jA\x7FA\x81\xC6 A\0:\0 \fA\xF3\0G\r\b A\0:\0A A\0:\0. A\x006*\f\b\v A j -\0"\0A\xDE\0F"A\x81\xC6 A\0:\0 Aj Aj \x1B!\x7F@@ AA \x1Bj-\0\0"A-G@ A\xDD\0F\r \0A\xDE\0G!\b \f\v  \0A\xDE\0G"\b:\0N\f\v  \0A\xDE\0G"\b:\0~\v Aj\v!@@ -\0\0"\0A-G@ \0E\r \0A\xDD\0F\r
  6041. \f\vA-!\0 -\0"E A\xDD\0Fr\r\0 Aj!@  Ak-\0\0"M@ !\0\f\v@ Aj" A jj \b:\0\0  -\0\0"\0I\r\0\v\v !\v A j \0j \b:\0 Aj!\f\0\v\0\vA\b!\f\vA
  6042. !\f\vA\0!\vB\0!A\0!A\0!A\0!#\0Ak"\b$\0@ AG A$MqE@A\xF8\xD7A6\0\f\v@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0_\r\0\v@@ \0A+k\0\0\vA\x7FA\0 \0A-F\x1B! ("\0 (hG@  \0Aj6 \0-\0\0!\0\f\v %!\0\v@@@@ A\0G AGq \0A0GrE@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A_qA\xD8\0F@A!\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0AI\r )pB\0Y@  (Ak6\v B\0J\f\v \rA\b!\f\v A
  6043. \x1B" \0A\xF1\x81j-\0\0K\r\0 )pB\0Y@  (Ak6\v B\0JA\xF8\xD7A6\0\f\v A
  6044. G\r\0 \0A0k"A M@A\0!\0@ \0A
  6045. l j"\0A\x99\xB3\xE6\xCCI\x7F (" (hG@  Aj6 -\0\0\f\v %\vA0k"A Mq\r\0\v \0\xAD!\v A K\r B
  6046. ~! \xAD!@@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A0k"A M  |"B\x9A\xB3\xE6\xCC\x99\xB3\xE6\xCCTqE@ A M\r\f\v B
  6047. ~" \xAD"B\x7F\x85X\r\v\vA
  6048. !\f\v@@  Akq@  \0A\xF1\x81j-\0\0"K\r\f\v  \0A\xF1\x81j-\0\0"M\r AlAvA\x07q,\0\xF1\x83!@   t"r! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\x80\x80\x80\xC0\0Iq\r\0\v \xAD! \rB\x7F \xAD"\x88" T\r@ \xADB\xFF\x83  \x86\x84! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r  X\r\0\v\f\v@   lj! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\xC7\xE3\xF18Iq\r\0\v \xAD! \r \xAD!@  ~" \xADB\xFF\x83"B\x7F\x85V\r  |! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r \b B\0 B\02 \b)\bP\r\0\v\v\v  \0A\xF1\x81j-\0\0M\r\0@ \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\vA\xF1\x81j-\0\0K\r\0\vA\xF8\xD7A\xC4\x006\0A\0!B\x7F!\v )pB\0Y@  (Ak6\v ArE B\x7FQq@A\xF8\xD7A\xC4\x006\0B~!\f\v  \xAC"\x85 }!\v \bAj$\0 )xB\0 ( (,k\xAC}Q\r \x07E \fA\xF0\0GrE@ \x07 >\0\f\v \x07  \xAA\f\v \x07  \xAB8\0\f\v \x07  \xC49\0\f\v \x07 7\0 \x07 7\b\f\vA Aj \fA\xE3\0G"\x1B!\b\x7F AF@ \x07! \v@ \bAt/"E\r\v B\x007\xA8A\0!@@@ !\0@ \x7F (" (hG@  Aj6 -\0\0\f\v %\v"j-\0!E\r  :\0\x1B Aj A\x1BjA A\xA8j\x98"A~F\r\0 A\x7FF@A\0! \f\v \0@ \0 Atj (6\0 Aj!\v \vE  \bGr\r\0\v \0 \bAtAr"\bAt\x9D"\r\0\vA\0! \0!
  6049. A!\v\f\b\vA\0! \0 A\xA8j\x7F (\xA8A\0\vE\r\v \0!
  6050. \f\v \v@A\0! \b/"E\r@ !\0@ \x7F (" (hG@  Aj6 -\0\0\f\v %\v"j-\0!E@ \0! A\0\f\v \0 j :\0\0 Aj" \bG\r\0\v \0 \bAtAr"\b\x9D"\r\0\vA\0!
  6051. \0! A!\v\f\vA\0! \x07@@ \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0j-\0!@  \x07j \0:\0\0 Aj!\f \x07"\0! A\0\f\v\0\v\0\v@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v j-\0!\r\0\vA\0!\0A\0! A\0\v!
  6052. (! )pB\0Y@  Ak"6\v )x  (,k\xAC|"P   QrEr\r \v@ \x07 \x006\0\v \fA\xE3\0F\r\0
  6053. @
  6054. AtjA\x006\0\v E@A\0! \f\v  jA\0:\0\0\v ( (,k\xAC )x ||! \r \x07A\0Gj!\r\v Aj! -\0"\r\f\v\vA!\vA\0! A\0!
  6055. \v \rA\x7F \r\x1B!\r\v \vE\r !
  6056. !\f\vA\x7F!\r\v A\xB0j$\0 A\x90j$\0 \r\vC\0@ \0E\r\0@@@@ Aj\0\v \0 <\0\0\v \0 =\0\v \0 >\0\v \0 7\0\v\v\xE4\x7F~#\0A k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!\x07@ B0\x88B\xFF\xFF\x83"\b\xA7"A\x81\xFF\0kA\xFDM@ \x07B\x88\xA7!@ \0P B\xFF\xFF\xFF\x83"\x07B\x80\x80\x80\bT \x07B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \0 \x07B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\vA\0  A\xFF\xFF\xFFK"\x1B!A\x81\x81\x7FA\x80\x81\x7F \x1B j!\f\v \0 \x07\x84P \bB\xFF\xFFRrE@ \x07B\x88\xA7A\x80\x80\x80r!A\xFF!\f\v A\xFE\x80K@A\xFF!\f\vA\x80\xFF\0A\x81\xFF\0 \bP"\x1B" k"A\xF0\0J@A\0!A\0!\f\v \x07 \x07B\x80\x80\x80\x80\x80\x80\xC0\0\x84 \x1B!\x07A\0!  G@ Aj \0 \x07A\x80 k6 ) )\x84B\0R!\v  \0 \x07 g )\b"\0B\x88\xA7!@ )\0 \xAD\x84"\x07P \0B\xFF\xFF\xFF\x83"\0B\x80\x80\x80\bT \0B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \x07 \0B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\v A\x80\x80\x80s  A\xFF\xFF\xFFK"\x1B!\v A j$\0 B \x88\xA7A\x80\x80\x80\x80xq Atr r\xBE\v\x89\x7F~@@\x7F@@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A+k\0\0\v A-F E\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A:k"AuKr\r \0)pB\0S\r \0 \0(Ak6\f\v A:k! !A\0\v! AvI\r\0@ A0kA
  6057. O\r\0A\0!@  A
  6058. lj\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v!A0k! A\xCC\x99\xB3\xE6\0H A0k"A Mq\r\0\v \xAC! A
  6059. O\r\0@ \xAD B
  6060. ~|!\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A0k"A M B0}"B\xAE\x8F\x85\xD7\xC7\xC2\xEB\xA3Sq\r\0\v A
  6061. O\r\0@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\vA0kA
  6062. I\r\0\v\v \0)pB\0Y@ \0 \0(Ak6\vB\0 }  \x1B!\f\vB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F! \0)pB\0S\r\0 \0 \0(Ak6B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\v \v\x842\x7F\x07~|#\0A0k"\r$\0@@ AK\r\0 At"(\xDC\x81! (\xD0\x81!@\x7F (" (hG@  Aj6 -\0\0\f\v %\v"_\r\0\vA!\b@@ A+k\0\0\vA\x7FA A-F\x1B!\b (" (hG@  Aj6 -\0\0!\f\v %!\v@@ A_qA\xC9\0F@@ A\x07F\r\x7F (" (hG@  Aj6 -\0\0\f\v %\v! ,\0\xAF\b Aj! A rF\r\0\v\v AG@ A\bF"\f\r E AIr\r \f\r\v )p"B\0Y@  (Ak6\v E AIr\r\0 B\0S!@ E@  (Ak6\v Ak"AK\r\0\v\vB\0!#\0Ak"$\0 \b\xB2C\0\0\x80\x7F\x94\xBC"A\xFF\xFF\xFFq!\b\x7F Av"A\xFFq"@ A\xFFG@ \b\xADB\x86! A\xFFqA\x80\xFF\0j\f\v \b\xADB\x86!A\xFF\xFF\f\vA\0 \bE\r\0  \b\xADB\0 \bg"A\xD1\0j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85! )\0!A\x89\xFF\0 k\v! \r 7\0 \r \xADB0\x86 Av\xADB?\x86\x84 \x847\b Aj$\0 \r)\b! \r)\0!\f\v@@@@@@ \r\0A\0! A_qA\xCE\0G\r\0@ AF\r\x7F (" (hG@  Aj6 -\0\0\f\v %\v! ,\0\xFC\r Aj! A rF\r\0\v\v \0\v@\x7F (" (hG@  Aj6 -\0\0\f\v %\vA(F@A!\f\vB\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0! )pB\0S\r  (Ak6\f\v@\x7F (" (hG@  Aj6 -\0\0\f\v %\v"A0kA
  6063. I A\xC1\0kAIr A\xDF\0FrE A\xE1\0kAOqE@ Aj!\f\v\vB\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0! A)F\r )p"B\0Y@  (Ak6\v@ @ \r\f\vA\xF8\xD7A6\0B\0!\f\v@ B\0Y@  (Ak6\v Ak"\r\0\v\f\v )pB\0Y@  (Ak6\vA\xF8\xD7A6\0\v B\0J\f\v@ A0G\r\0\x7F (" (hG@  Aj6 -\0\0\f\v %\vA_qA\xD8\0F@#\0A\xB0k"$\0\x7F (" (hG@  Aj6 -\0\0\f\v %\v!@\x7F@ A0G@@ A.G\r (" (hF\r\0  Aj6 -\0\0\f\v (" (hG\x7FA!  Aj6 -\0\0A! %\v!\f\v\v %\v"A0G@A!\v\f\v@ B}!\x7F (" (hG@  Aj6 -\0\0\f\v %\v"A0F\r\0\vA!\vA!\vB\x80\x80\x80\x80\x80\x80\xC0\xFF?!@@ !@@ A0k"\x07A
  6064. I\r\0 A.G"\f A r"A\xE1\0kAKq\r \f\r\0 \v\rA!\v !\f\v A\xD7\0k \x07 A9J\x1B!@ B\x07W@  Atj! \f\v BX@ A0j ? A j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFD?+ Aj )0 )8 ) " )("+  ) )  < )\b! )\0!\f\v E
  6065. r\r\0 A\xD0\0j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF?+ A@k )P )X  <A!
  6066. )H! )@!\v B|!A!\v (" (hG\x7F  Aj6 -\0\0 %\v!\f\v\v~ E@@@ )pB\0Y@  ("Ak6 E\r  Ak6 \vE\r  Ak6\f\v \r\v B\0J\v A\xE0\0jD\0\0\0\0\0\0\0\0 \b\xB7\xA6T )\`! )h\f\v B\x07W@ !@ At! B|"B\bR\r\0\v\v@@@ A_qA\xD0\0F@  \xAC"B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FR\r @ )pB\0Y\r\f\vB\0! B\0JB\0\f\vB\0! )pB\0S\r\v  (Ak6\vB\0!\v E@ A\xF0\0jD\0\0\0\0\0\0\0\0 \b\xB7\xA6T )p! )x\f\v   \v\x1BB\x86 |B }"A\0 k\xADU@A\xF8\xD7A\xC4\x006\0 A\xA0j \b? A\x90j )\xA0 )\xA8B\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ A\x80j )\x90 )\x98B\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ )\x80! )\x88\f\v A\xE2k\xAC W@ A\0N@@ A\xA0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF\xBF\x7F<  B\x80\x80\x80\x80\x80\x80\x80\xFF?\xB2! A\x90j   )\xA0  A\0N"\x1B )\xA8  \x1B<  At"r! B}! )\x98! )\x90! A\0N\r\0\v\v~ A k\xAD|"\xA7"A\0 A\0J\x1B   \xADS\x1B"A\xF1\0O@ A\x80j \b? )\x88! )\x80!B\0\f\v A\xE0jA\x90 k\xC8T A\xD0j \b? )\xD0! A\xF0j )\xE0 )\xE8 )\xD8"\xB1 )\xF8! )\xF0\v! A\xC0j AqE  B\0B\0dA\0G A Iqq"rr A\xB0j   )\xC0 )\xC8+ A\x90j )\xB0 )\xB8  < A\xA0j  B\0  \x1BB\0  \x1B+ A\x80j )\xA0 )\xA8 )\x90 )\x98< A\xF0j )\x80 )\x88  \xBC )\xF0" )\xF8"B\0B\0dE@A\xF8\xD7A\xC4\x006\0\v A\xE0j   \xA7\xB0 )\xE0! )\xE8\f\vA\xF8\xD7A\xC4\x006\0 A\xD0j \b? A\xC0j )\xD0 )\xD8B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ A\xB0j )\xC0 )\xC8B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ )\xB0! )\xB8\v! \r 7 \r 7 A\xB0j$\0 \r)! \r)!\f\v )pB\0S\r\0  (Ak6\v !\x07 ! \b!\f !\bA\0!#\0A\x90\xC6\0k"$\0A\0 k" k!@\x7F@@ A0G@ A.G\r \x07(" \x07(hF\r \x07 Aj6 -\0\0\f\v \x07(" \x07(hG@ \x07 Aj6 -\0\0! \x07%!\vA!\f\v\v \x07%\v"A0F@@ B}!\x7F \x07(" \x07(hG@ \x07 Aj6 -\0\0\f\v \x07%\v"A0F\r\0\vA!\vA!\v\v A\x006\x90~@@@@ A.F" A0k"A Mr@@@ Aq@ \vE@ !A!\v\f\v E!\f\v B|! A\xFCL@  \xA7 A0F\x1B! A\x90j Atj"
  6067. \x7F  (\0A
  6068. ljA0k \v6\0A!A\0
  6069. Aj" A F"\x1B!
  6070.  j! \f\v A0F\r\0  (\x80FAr6\x80FA\xDC\x8F!\v\x7F \x07(" \x07(hG@ \x07 Aj6 -\0\0\f\v \x07%\v"A.F" A0k"A
  6071. Ir\r\0\v\v   \v\x1B! E A_qA\xC5\0GrE@@ \x07 \b\xAC"B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FR\r\0 \bE\rB\0! \x07)pB\0S\r\0 \x07 \x07(Ak6\v  |!\f\v E! A\0H\r\v \x07)pB\0S\r\0 \x07 \x07(Ak6\v E\rA\xF8\xD7A6\0\v \x07B\0JB\0!B\0\f\v (\x90"E@ D\0\0\0\0\0\0\0\0 \f\xB7\xA6T )\b! )\0\f\v  R B Ur AMA\0  v\x1BrE@ A0j \f? A j r Aj )0 )8 ) )(+ )! )\f\v Av\xAD S@A\xF8\xD7A\xC4\x006\0 A\xE0\0j \f? A\xD0\0j )\` )hB\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ A@k )P )XB\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ )H! )@\f\v A\xE2k\xAC U@A\xF8\xD7A\xC4\x006\0 A\x90j \f? A\x80j )\x90 )\x98B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ A\xF0\0j )\x80 )\x88B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ )x! )p\f\v
  6072. @
  6073. A\bL@ A\x90j Atj"(\0!@ A
  6074. l!
  6075. Aj"
  6076. A G\r\0\v  6\0\v Aj! \v@ A N BUr \xA7"
  6077. Hr\r\0 B Q@ A\xC0j \f? A\xB0j (\x90r A\xA0j )\xC0 )\xC8 )\xB0 )\xB8+ )\xA8! )\xA0\f\v B\bW@ A\x90j \f? A\x80j (\x90r A\xF0j )\x90 )\x98 )\x80 )\x88+ A\xE0jA\b
  6078. kAt(\xB0\x81? A\xD0j )\xF0 )\xF8 )\xE0 )\xE8\xAF )\xD8! )\xD0\f\v 
  6079. A}ljA\x1Bj"ALA\0 (\x90" v\x1B\r\0 A\xE0j \f? A\xD0j r A\xC0j )\xE0 )\xE8 )\xD0 )\xD8+ A\xB0j
  6080. AtA\x88\x81j(\0? A\xA0j )\xC0 )\xC8 )\xB0 )\xB8+ )\xA8! )\xA0\f\v@ "Ak! A\x90j Atj"Ak(\0E\r\0\vA\0!@
  6081. A o"E@A\0!\f\v A j  B\0S\x1B!@ E@A\0!A\0!\f\vA\x80\x94\xEB\xDCA\0 kAtA\xD0\x81j(\0"\vm!\x07A\0!A\0!A\0!@ A\x90j Atj"\b  \b(\0" \vn"\bj"6\0 AjA\xFFq  E  Fq"\x1B!
  6082. A k
  6083. \x1B!
  6084. \x07 \b \vlkl! Aj" G\r\0\v E\r\0  6\0 Aj!\v
  6085. kA j!
  6086. \v@ A\x90j Atj!
  6087. A$H!\x07@@ \x07E@
  6088. A$G\r (\0A\xD1\xE9\xF9O\r\v A\xFFj! A\0!@ !\b \xAD A\x90j A\xFFq"\vAtj"5\0B\x86|"B\x81\x94\xEB\xDCT\x7FA\0  B\x80\x94\xEB\xDC\x80"B\x80\x94\xEB\xDC~}! \xA7\v!  >\0 \b \b \b \v B\0R\x1B \v \bAkA\xFFq"G\x1B  \vF\x1B! \vAk!  \vG\r\0\v Ak! \b! E\r\0\v AkA\xFFq" F@ A\x90j"\b A\xFEjA\xFFqAtj" (\0 At \bj(\0r6\0 !\v
  6089. A j!
  6090. A\x90j Atj 6\0\f\v\v@@ AjA\xFFq!\b A\x90j AkA\xFFqAtj!@A A
  6091. A-J\x1B!@@ !A\0!@@@  jA\xFFq" F\r\0 A\x90j Atj(\0" At(\xA0\x81"I\r\0  I\r Aj"AG\r\v\v
  6092. A$G\r\0B\0!A\0!B\0!@   jA\xFFq"F@ AjA\xFFq"At jA\x006\x8C\v A\x80j A\x90j Atj(\0r A\xF0j  B\0B\x80\x80\x80\x80\xE5\x9A\xB7\x8E\xC0\0+ A\xE0j )\xF0 )\xF8 )\x80 )\x88< )\xE8! )\xE0! Aj"AG\r\0\v A\xD0j \f? A\xC0j   )\xD0 )\xD8+B\0! )\xC8! )\xC0! A\xF1\0j" k" A\0 A\0J\x1B  H"\b\x1B"\x07A\xF0\0M\r\f\v  j! !  F\r\0\vA\x80\x94\xEB\xDC v!\vA\x7F tA\x7Fs!A\0! !@ A\x90j"\x07 Atj"  (\0" vj"6\0 AjA\xFFq  E  Fq"\x1B!
  6093. A k
  6094. \x1B!
  6095. q \vl! AjA\xFFq" G\r\0\v E\r  \bG@ At \x07j 6\0 \b!\f\v  (\0Ar6\0\f\v\v\v A\x90jA\xE1 \x07k\xC8T A\xB0j )\x90 )\x98 \xB1 )\xB8! )\xB0! A\x80jA\xF1\0 \x07k\xC8T A\xA0j   )\x80 )\x88\xAE A\xF0j   )\xA0" )\xA8"\xBC A\xE0j   )\xF0 )\xF8< )\xE8! )\xE0!\v@ AjA\xFFq" F\r\0@ A\x90j Atj(\0"A\xFF\xC9\xB5\xEEM@ E AjA\xFFq Fq\r A\xF0j \f\xB7D\0\0\0\0\0\0\xD0?\xA2T A\xE0j   )\xF0 )\xF8< )\xE8! )\xE0!\f\v A\x80\xCA\xB5\xEEG@ A\xD0j \f\xB7D\0\0\0\0\0\0\xE8?\xA2T A\xC0j   )\xD0 )\xD8< )\xC8! )\xC0!\f\v \f\xB7!\x1B  AjA\xFFqF@ A\x90j \x1BD\0\0\0\0\0\0\xE0?\xA2T A\x80j   )\x90 )\x98< )\x88! )\x80!\f\v A\xB0j \x1BD\0\0\0\0\0\0\xE8?\xA2T A\xA0j   )\xB0 )\xB8< )\xA8! )\xA0!\v \x07A\xEF\0K\r\0 A\xD0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?\xAE )\xD0 )\xD8B\0B\0d\r\0 A\xC0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?< )\xC8! )\xC0!\v A\xB0j    < A\xA0j )\xB0 )\xB8  \xBC )\xA8! )\xA0!@ Ak A\xFF\xFF\xFF\xFF\x07qN\r\0  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x837\x98  7\x90 A\x80j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF?+ )\x90 )\x98B\x80\x80\x80\x80\x80\x80\x80\xB8\xC0\0\xB2! )\x88  A\0N"\x1B! )\x80  \x1B! \b \x07 G A\0Hrq  B\0B\0dA\0GqE   j"A\xEE\0jNq\r\0A\xF8\xD7A\xC4\x006\0\v A\xF0j   \xB0 )\xF8! )\xF0\v! \r 7( \r 7 A\x90\xC6\0j$\0 \r)(! \r) !\f\vB\0!\f\vB\0!\v \0 7\0 \0 7\b \rA0j$\0\v\xC0\x7F~#\0A\x80k"$\0@@@  B\0B\0dE\r\0\x7F B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!
  6096. \x7F B0\x88\xA7A\xFF\xFFq"\x07A\xFF\xFFG@A \x07\rAA 
  6097. \x84P\x1B\f\v 
  6098. \x84P\v\vE\r\0 B0\x88\xA7"\bA\xFF\xFFq"A\xFF\xFFG\r\v Aj    +  )" )"  \xAF )\b! )\0!\f\v  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"
  6099.  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" dA\0L@ 
  6100.  d@ !\f\v A\xF0\0j  B\0B\0+ )x! )p!\f\v B0\x88\xA7A\xFF\xFFq!\x07 ~  A\xE0\0j 
  6101. B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )h"
  6102. B0\x88\xA7A\xF8\0k! )\`\v! \x07E@ A\xD0\0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )X" B0\x88\xA7A\xF8\0k!\x07 )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84!\v
  6103. B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84!
  6104.  \x07J@@~
  6105. \v}  V\xAD}" B\0Y@  }"\x84P@ A j  B\0B\0+ )(! ) !\f\v B\x86 B?\x88\x84\f\v
  6106. B\x86 B?\x88\x84\v!
  6107. B\x86! Ak" \x07J\r\0\v \x07!\v@
  6108. \v}  V\xAD}" B\0S@
  6109. ! \f\v  }"\x84B\0R\r\0 A0j  B\0B\0+ )8! )0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@@ B?\x88 Ak! B\x86! B\x86\x84" B\x80\x80\x80\x80\x80\x80\xC0\0T\r\0\v\v \bA\x80\x80q!\x07 A\0L@ A@k  B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 A\xF8\0j \x07r\xADB0\x86\x84B\0B\x80\x80\x80\x80\x80\x80\xC0\xC3?+ )H! )@!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83  \x07r\xADB0\x86\x84!\v \0 7\0 \0 7\b A\x80j$\0\v\x87\x7F~#\0A\xD0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!
  6110.  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83!\f B0\x88\xA7A\xFF\xFFq!\x07@@ B0\x88\xA7A\xFF\xFFq"\bA\xFF\xFFkA\x82\x80~O@ \x07A\xFF\xFFkA\x81\x80~K\r\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f !\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\f\f\v \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!\f\v  \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0 \f  \x84P\x1B!\fB\0!\f\v  \x84P@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xC0j 
  6111. 
  6112. P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )\xC8!
  6113. )\xC0!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A\xB0j  \v  \v \vP" \x1ByB\xC0\0B\0 \x1B|\xA7" Ak6  jAk! )\xB8!\v )\xB0!\v A\xA0j \vB\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86 B1\x88\x84"B\0B\x80\x80\x80\x80\xB0\xE6\xBC\x82\xF5\0 }"B\02 A\x90jB\0 )\xA8}B\0 B\02 A\x80j )\x98B\x86 )\x90B?\x88\x84"B\0 B\02 A\xF0j B\0B\0 )\x88}B\02 A\xE0j )\xF8B\x86 )\xF0B?\x88\x84"B\0 B\02 A\xD0j B\0B\0 )\xE8}B\02 A\xC0j )\xD8B\x86 )\xD0B?\x88\x84"B\0 B\02 A\xB0j B\0B\0 )\xC8}B\02 A\xA0j B\0 )\xB8B\x86 )\xB0B?\x88\x84B}"B\02 A\x90j B\x86B\0 B\02 A\xF0\0j B\0B\0 )\xA8 )\xA0" )\x98|" T\xAD| BV\xAD|}B\02 A\x80jB }B\0 B\02  \b \x07kj"\bA\xFF\xFF\0j!~ )p"B\x86"\r )\x88"B\x86 )\x80B?\x88\x84|"B\xE7\xEC\0}"B \x88"
  6114. B\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86"B \x88"~" B\x86"B \x88"\v  V\xAD \r V\xAD )xB\x86 B?\x88\x84 B?\x88|||B}"B \x88"~|"\r T\xAD \r \r B\xFF\xFF\xFF\xFF\x83" B?\x88"
  6115. B\x86\x84B\xFF\xFF\xFF\xFF\x83"
  6116. ~|"\rV\xAD|  ~|  ~"
  6117. ~|" T\xADB \x86 B \x88\x84| \r B \x86|" \rT\xAD|   B\xFF\xFF\xFF\xFF\x83"
  6118. ~"\r  \v~|" \rT\xAD    B\xFE\xFF\xFF\xFF\x83"\r~|"V\xAD||"V\xAD|   ~" \r ~|" 
  6119. ~|"
  6120. \v ~|"B \x88
  6121. V\xAD  T\xAD 
  6122. V\xAD||B \x86\x84|" T\xAD|     \r~"
  6123. \v ~|"B \x88 
  6124. T\xADB \x86\x84|"
  6125. T\xAD
  6126. B \x86|"
  6127. V\xAD||"V\xAD|  
  6128. B \x86" \r ~| T\xADB\x7F\x85"V 
  6129. Rq\xAD|"V\xAD|"B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0X@  \x84! A\xD0\0j  B\x80\x80\x80\x80\x80\x80\xC0\0T"\x07\xAD"\v\x86"
  6130.  \v\x86 B\x88 \x07A?s\xAD\x88\x84"  2 \bA\xFE\xFF\0j  \x07\x1BAk! B1\x86 )X} )P"B\0R\xAD}!\vB\0 }\f\v A\xE0\0j B?\x86 B\x88\x84"
  6131. B\x88"  2 B0\x86 )h} )\`"B\0R\xAD}!\v !B\0 }\v! A\xFF\xFFN@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v~ A\0J@ \vB\x86 B?\x88\x84! B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84!\v B\x86\f\v A\x8F\x7FL@B\0!\f\v A@k
  6132. A kg A0j   A\xF0\0j6 A j   )@"
  6133. )H"\v2 )8 )(B\x86 ) "B?\x88\x84} )0" B\x86"T\xAD}!  }\v! Aj  BB\02   BB\02 \v
  6134. 
  6135. B\x83" |"T   T\xAD|" V  Q\x1B\xAD|"
  6136. T\xAD|"   B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T  )V  )"V  Q\x1Bq\xAD|"V\xAD|"  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T  )\0V  )\b"V  Q\x1Bq\xAD|" T\xAD| \f\x84!\f\v \0 7\0 \0 \f7\b A\xD0j$\0\v\xBF\x7F#\0A\xD0\0k"$\0@ A\x80\x80N@ A j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+ )(! ) ! A\xFF\xFFI@ A\xFF\xFF\0k!\f\v Aj  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+A\xFD\xFF  A\xFD\xFFO\x1BA\xFE\xFFk! )! )!\f\v A\x81\x80\x7FJ\r\0 A@k  B\0B\x80\x80\x80\x80\x80\x80\x809+ )H! )@! A\xF4\x80~K@ A\x8D\xFF\0j!\f\v A0j  B\0B\x80\x80\x80\x80\x80\x80\x809+A\xE8\x81}  A\xE8\x81}M\x1BA\x9A\xFEj! )8! )0!\v   B\0 A\xFF\xFF\0j\xADB0\x86+ \0 )\b7\b \0 )\x007\0 A\xD0\0j$\0\v<\0 \0 7\0 \0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x83B0\x88\xA7 B0\x88\xA7A\x80\x80qr\xADB0\x86\x847\b\v\xC0\x7F~A\x7F!@ \0B\0R B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1B\r\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Rq\r\0 \0  \x84\x84P@A\0\v  \x83B\0Y@  R  Sq\r \0  \x85\x84B\0R\v \0B\0R  U  Q\x1B\r\0 \0  \x85\x84B\0R!\v \v8\0 \0A\xD0k \0 \0A\x93\xF1\xFF\xFF\x07J\x1B"\0Aq@A\0\v \0A\xECj"\0A\xE4\0o@A\v \0A\x90oE\v\x85\x7F~#\0A\x80k"\b$\0 @\x7F@@\x7F@@@ -\0\0"A%G@ \r
  6137. \f\x07\vA\0!A! @ -\0"\x07A-k\0\v \x07A\xDF\0F\r \x07\r\v \0
  6138. j :\0\0
  6139. Aj\f\v \x07! -\0!\x07A! \vA\0!@\x7F  j \x07"A+Fj" ,\0\0A0kA M@ \bA\fjA
  6140. B\xFF\xFF\xFF\xFF\xBE\xA7! \b(\f\f\v \b 6\fA\0! \v"\x07-\0\0"A\xC3\0k"\vAKA \vtA\x99\x80\x80qEr\r\0 "\r\0 \x07 G!\v A\xCF\0F A\xC5\0Fr\x7F \x07-\0! \x07Aj \x07\v! \bAj!\x07 ! A\0!#\0A\xD0\0k"\v$\0A\x8A !\rA0!A\xA8\x80\b!\f@ \b\x7F@@@@@@@\x7F@@@@@@@@@~@@@@@@@@@@@@@@@@@@@@@@@@@@ \xC0"A%kV!---------------------------'-\x07\b
  6141. ---\r---- ------\0&-\b-\v--\f--%-\x1B-\v ("AM\r"\f*\v ("AK\r) A\x87\x80\bj\f"\v ("A\vK\r( A\x8E\x80\bj\f!\v ("A\vK\r' A\x9A\x80\bj\f \v 4B\xEC|B\xE4\0\x7F!\f#\vA\xDF\0!\v 4\f!\f!\vA\xD2!\r\f\v 4"B\xEC|!@ ("AL@  B\xEB| \xBDAF\x1B!\f\v A\xE9I\r\0 B\xED|  \xBDAF\x1B!\v A\xE7\0F\r\f \v 4\b!\f\vA! (\b"E@B\f!\f \v \xAC"B\f}  A\fJ\x1B!\f\v (Aj\xAC!A!\f\v (Aj\xAC!\f\x1B\v 4!\f\v \bA6|A\xD4!\f\vA\xA7\x80\bA\xA6\x80\b (\bA\vJ\x1B\f\vA\xF7!\r\f\vA\0!\fA\0!#\0Ak"$\0 4!~ ("\rA\fO@ \r \rA\fm"A\flk"A\fj  A\0H\x1B!\r  Auj\xAC |!\v A\fj! B}B\x88X@ \xA7"\fA\xC4\0kAu!@ \x7F \fAqE@ Ak! E\rA\f\v E\rA\0\v6\0\v \fA\x80\xE7\x84l A\x80\xA3ljA\x80\xD6\xAF\xE3\x07j\xAC\f\v B\xE4\0}" B\x90\x7F"B\x90~}"B?\x87\xA7 \xA7j!@@@ \xA7"A\x90j  B\0S\x1B"\x7F\x7F A\xC8N@ A\xACO@A!\f A\xACk\f\vA!\f A\xC8k\f\v A\xE4\0k  A\xE3\0J"\f\x1B\v"\rA\0A\v! \r\f\v Av! AqE! E\r\v  6\0\v B\x80\xE7\x84~  \fAl A\xE1\0ljj k\xACB\x80\xA3~|B\x80\xAA\xBA\xC3|\v! \rAtA\x80\xFE\0j(\0"A\x80\xA3j  (\f\x1B  \rAJ\x1B! (\f! 4\b! 4! 4\0 Aj$\0  \xAC| Ak\xACB\x80\xA3~| B\x90~| B<~|| 4$}\f\b\v 4\0!\f\v \bA6|A\xD6!\f\vA\xE4!\r\f\v ("A\x07 \x1B\xAC\f\v ( (kA\x07jA\x07n\xAD!\f\v ( (AjA\x07pkA\x07jA\x07n\xAD!\f\v \xBD\xAD!\f\v 4\v!A!\f\vA\xA9\x80\b!\f\f
  6142. \vA\xAA\x80\b!\f\f \v 4B\xEC|B\xE4\0\x81" B?\x87"\x85 }!\f
  6143. \v 4"B\xEC|! B\xA4?S\r
  6144. \v 70 \b \x07A\x9B \vA0je6| \x07!\f\v ( A\0H@ \bA\x006|A\xD7!\f\v \v ($"A\x90m"A\xE4\0l  A\x90lk\xC1A<m\xC1j6@ \b \x07A\xA1 \vA@ke6| \x07!\f\r\v ( A\0H@ \bA\x006|A\xD7!\f\r\v ((A\xB4\xDC(\0E@A\xAC\xDCA\xB0\xDCA\xC0\xDCA\xE0\xDCA\xB8\xDCA\xE0\xDC6\0A\xB4\xDCA\xC0\xDC6\0\v\f\v\v \bA6|A\xEA!\f\v\v B\xE4\0\x81!\f\v A\x80\x80\br\v \xB5\f\x07\vA\xAB\x80\b!\f\v \f \xB5!\r\v \b \x07A\xE4\0 \r  \xB4"6| \x07A\0 \x1B!\f\vA!\f\vA!\v@  \x1B"A\xDF\0G@ A-G\r \v 7 \b \x07A\x9C \vAje6| \x07!\f\v \v 7( \v 6 \b \x07A\x95 \vA je6| \x07!\f\v \v 7\b \v 6\0 \b \x07A\x8E \ve6| \x07!\f\vA\x9C\v"y6|\v \vA\xD0\0j$\0 E\r@ E@ \b(|! \f\v\x7F@@ -\0\0"A+k\0\0\v \b(|\f\v -\0! Aj! \b(|Ak\v! @ A\xFFqA0G\r\0@ ,\0"\x07A0kA K\r Aj! Ak! \x07A0F\r\0\v\v \b 6|A\0!@ "\x07Aj!  \x07j,\0\0A0kA
  6145. I\r\0\v  I\x1B!@ \0
  6146. j (A\x94qH\x7FA- A+G\r  k \x07jAA \b(\f-\0\0A\xC3\0F\x1BI\rA+\v:\0\0 Ak!
  6147. Aj!
  6148. \v  M 
  6149. Mr\r\0@ \0
  6150. jA0:\0\0
  6151. Aj!
  6152. Ak" M\r 
  6153. K\r\0\v\v \b 
  6154. k"\x07 \x07 K\x1B"\x076| \0
  6155. j  \x07Y \b(|
  6156. j\v!
  6157. Aj! 
  6158. K\r\v\v Ak
  6159. 
  6160. F\x1B!
  6161. A\0\v! \0
  6162. jA\0:\0\0\v \bA\x80j$\0 \v\xB8\x7F \0AF@A\xF4\x1BA\x84 (\0\x1B\v \0A\xFF\xFFq"A\xFF\xFFG \0Au"AJrE@  Atj(\0"\0A\bjA\xAF \0\x1B\vA\xD7!\0@\x7F@@@ Ak\0\v AK\rA\xB0\xFE\0\f\v A1K\rA\xC0\xFE\0\f\v AK\rA\x80\x81\v!\0 E\r\0@ \0"Aj!\0 -\0\0\r\0 Ak"\r\0\v\v \0\v,\x7F A\0H@\x85\0\v \0 9"6 \0 6\0 \0  j6\b\v
  6163. \0 \0A0kA
  6164. I\v\0 \0A0kA
  6165. I \0A rA\xE1\0kAIr\v\0 \0A r \0 \0A\xC1\0kAI\x1B\v'\0 \0A\0G \0A\xF8\xFC\0Gq \0A\x90\xFD\0Gq \0A\xF8\xDBGq \0A\x90\xDCGq\v\xE4\x7F@ -\0\0\r\0A\xFD\xBF"@ -\0\0\r\v \0A\flA\xB0\xFD\0j\xBF"@ -\0\0\r\vA\x8A\xBF"@ -\0\0\r\vA\xF2\x1B!\v@@  j-\0\0"E A/FrE@A! Aj"AG\r\f\v\v !\vA\xF2\x1B!@@@@@ -\0\0"A.F\r\0  j-\0\0\r\0 ! A\xC3\0G\r\v -\0E\r\v A\xF2\x1B\x9BE\r\0 A\xD1\x9B\r\v \0E@A\xD4\xFC\0! -\0A.F\r\vA\0\vA\xF4\xDB(\0"@@  A\bj\x9BE\r ( "\r\0\v\vA$/"@ A\xD4\xFC\0)\x007\0 A\bj"  Y  jA\0:\0\0 A\xF4\xDB(\x006 A\xF4\xDB 6\0\v A\xD4\xFC\0 \0 r\x1B!\v \v(\x7F \0(\0"@ CA\x7FG@ \0(\0E\v \0A\x006\0\vA\v(\x7F \0(\0"@ AA\x7FG@ \0(\0E\v \0A\x006\0\vA\vT\x7F@ \0(\0"E\r\0\x7F (" (F@   (\0(4\0\f\v  6\0  Aj6 \vA\x7FG\r\0 \0A\x006\0\v\v.\x7F#\0Ak"$\0  \x006\0A\x8F\f a\`A\xB0\xF1\0(\0L Aj$\0\v$\x7F@ \0(\0"E\r\0  \xC3A\x7FG\r\0 \0A\x006\0\v\v\0 \0AjK \0!\v=\x7F @ \0 \xB6 \0(!  k"E  FrE@   \xFC
  6166. \0\0\v \0  j6\v\vB\x7F \0(" \0(F@ \0 A\xFFq \0(\0(4\0\v  :\0\0 \0 \0(Aj6 A\xFFq\v\x96\x7F#\0Ak"$\0 \0 \0(\0A\fk(\0j(@  \x006\f A\0:\0\b \0 \0(\0A\fk(\0j"(E@ (H"@ \xC4\v A:\0\b\v@ -\0\bAG\r\0 \0 \0(\0A\fk(\0j(" (\0(\0\0A\x7FG\r\0 \0 \0(\0A\fk(\0jA\x99\v@ (\f"\0 \0(\0A\fk(\0j"\0(E\r\0 \0(\r\0 \0-\0A qE\r\0 (\f"\0 \0(\0A\fk(\0j("\0 \0(\0(\0\0A\x7FG\r\0 (\f"\0 \0(\0A\fk(\0jA\x99\v\v Aj$\0\v\0 \0A\bjK \0!\v\0A\x7F\v-\0 \0A\xC8\0j1 \0A<j1 \0A0j1 \0A$j1 \0Aj1 \0A\fj1\v|\x7F \0 \0(H"Ak r6H \0( \0(G@ \0A\0A\0 \0($\0\v \0A\x006 \0B\x007 \0(\0"Aq@ \0 A r6\0A\x7F\v \0 \0(, \0(0j"6\b \0 6 A\x1BtAu\v\xAD\v\x07\x7F \0 j!@@ \0("Aq\r\0 AqE\r \0(\0" j!@@@ \0 k"\0A\x90\xD8(\0G@ \0(\f! A\xFFM@  \0(\b"G\rA\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v \0(! \0 G@ \0(\b" 6\f  6\b\f\v \0("\x7F \0Aj \0("E\r \0Aj\v!@ !\x07 "Aj! ("\r\0 Aj! ("\r\0\v \x07A\x006\0\f\v ("AqAG\rA\x84\xD8 6\0  A~q6 \0 Ar6  6\0\v  6\f  6\b\f\vA\0!\v E\r\0@ \0("At"(\xAC\xDA \0F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ \0 (F@  6\f\v  6\v E\r\v  6 \0("@  6  6\v \0("E\r\0  6  6\v@@@@ ("AqE@A\x94\xD8(\0 F@A\x94\xD8 \x006\0A\x88\xD8A\x88\xD8(\0 j"6\0 \0 Ar6 \0A\x90\xD8(\0G\rA\x84\xD8A\x006\0A\x90\xD8A\x006\0\vA\x90\xD8(\0"\b F@A\x90\xD8 \x006\0A\x84\xD8A\x84\xD8(\0 j"6\0 \0 Ar6 \0 j 6\0\v Axq j! (\f! A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v  6\f  6\b\f\v (!  G@ (\b" 6\f  6\b\f\v ("\x7F Aj ("E\r Aj\v!@ !\x07 "Aj! ("\r\0 Aj! ("\r\0\v \x07A\x006\0\f\v  A~q6 \0 Ar6 \0 j 6\0\f\vA\0!\v E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("@  6  6\v ("E\r\0  6  6\v \0 Ar6 \0 j 6\0 \0 \bG\r\0A\x84\xD8 6\0\v A\xFFM@ A\xF8qA\xA4\xD8j!\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7  r6\0 \f\v (\b\v!  \x006\b  \x006\f \0 6\f \0 6\b\vA! A\xFF\xFF\xFF\x07M@ A& A\bvg"kvAq AtrA>s!\v \0 6 \0B\x007 AtA\xAC\xDAj!@@A\x80\xD8(\0"A t"\x07qE@A\x80\xD8  \x07r6\0  \x006\0 \0 6\f\v A AvkA\0 AG\x1Bt! (\0!@ "(Axq F\r Av! At!  Aqj"\x07("\r\0\v \x07 \x006 \0 6\v \0 \x006\f \0 \x006\b\v (\b" \x006\f  \x006\b \0A\x006 \0 6\f \0 6\b\v\v\0 \0E@A\0\v \0 \xC5\v\0 \0  A4A5\xD0\v-\0 \0A\xCC\0j1 \0A@k1 \0A4j1 \0A(j1 \0Aj1 \0Aj1\v\xBC\0@@@@@@@@@@@ A k\0\b
  6167. \b 
  6168. \b \x07\v  (\0"Aj6\0 \0 (\x006\0\v  (\0"Aj6\0 \0 2\x007\0\v  (\0"Aj6\0 \0 3\x007\0\v  (\0"Aj6\0 \0 0\0\x007\0\v  (\0"Aj6\0 \0 1\0\x007\0\v  (\0A\x07jAxq"A\bj6\0 \0 +\x009\0\v \0  \0\v\v  (\0"Aj6\0 \0 4\x007\0\v  (\0"Aj6\0 \0 5\x007\0\v  (\0A\x07jAxq"A\bj6\0 \0 )\x007\0\vo\x7F \0(\0",\0\0A0k"A K@A\0\v@A\x7F! A\xCC\x99\xB3\xE6\0M@A\x7F  A
  6169. l"j  A\xFF\xFF\xFF\xFF\x07sK\x1B!\v \0 Aj"6\0 ,\0 ! !A0k"A
  6170. I\r\0\v \v\xF5\x7F~#\0A@j"\b$\0 \b 6< \bA)j! \bA'j! \bA(j!@@@@@A\0!\x07@ !\r \x07 A\xFF\xFF\xFF\xFF\x07sJ\r \x07 j!@@@@ "\x07-\0\0"\v@@@@ \vA\xFFq"E@ \x07!\f\v A%G\r \x07!\v@ \v-\0A%G@ \v!\f\v \x07Aj!\x07 \v-\0 \vAj"!\vA%F\r\0\v\v \x07 \rk"\x07 A\xFF\xFF\xFF\xFF\x07s"J\r \0@ \0 \r \x073\v \x07\r\x07 \b 6< Aj!\x07A\x7F!@ ,\0A0k"
  6171. A K\r\0 -\0A$G\r\0 Aj!\x07A!
  6172. !\v \b \x076<A\0!\f@ \x07,\0\0"\vA k"AK@ \x07!
  6173. \f\v \x07!
  6174. A t"A\x89\xD1qE\r\0@ \b \x07Aj"
  6175. 6<  \fr!\f \x07,\0"\vA k"A O\r
  6176. !\x07A t"A\x89\xD1q\r\0\v\v@ \vA*F@\x7F@
  6177. ,\0A0k"A K\r\0
  6178. -\0A$G\r\0\x7F \0E@  AtjA
  6179. 6\0A\0\f\v  Atj(\0\v!
  6180. Aj!A\f\v \r
  6181. Aj! \0E@ \b 6<A\0!A\0!\f\v  (\0"\x07Aj6\0 \x07(\0!A\0\v! \b 6< A\0N\rA\0 k! \fA\x80\xC0\0r!\f\f\v \bA<j\xCE"A\0H\r
  6182. \b(<!\vA\0!\x07A\x7F! \x7FA\0 -\0\0A.G\r\0 -\0A*F@\x7F@ ,\0A0k"
  6183. A K\r\0 -\0A$G\r\0 Aj!\x7F \0E@ 
  6184. AtjA
  6185. 6\0A\0\f\v 
  6186. Atj(\0\v\f\v \r Aj!A\0 \0E\r\0  (\0"
  6187. Aj6\0
  6188. (\0\v! \b 6< A\0N\f\v \b Aj6< \bA<j\xCE! \b(<!A\v!@ \x07!A!
  6189. ",\0\0"\x07A\xFB\0kAFI\r\v Aj! A:l \x07jA\xFF\xF0\0j-\0\0"\x07AkA\xFFqA\bI\r\0\v \b 6<@ \x07A\x1BG@ \x07E\r\f A\0N@ \0E@  Atj \x076\0\f\f\v \b  Atj)\x0070\f\v \0E\r\b \bA0j \x07  \xCD\f\v A\0N\r\vA\0!\x07 \0E\r\b\v \0-\0\0A q\r\v \fA\xFF\xFF{q"\v \f \fA\x80\xC0\0q\x1B!\fA\0!A\x93 ! !
  6190. @@\x7F@@@@@@\x7F@@@@@@@ -\0\0"\x07\xC0"ASq  \x07AqAF\x1B  \x1B"\x07A\xD8\0k! 
  6191. \0\v@ \x07A\xC1\0k\x07\v\0\v \x07A\xD3\0F\r\v\f\v \b)0!A\x93 \f\vA\0!\x07@@@@@@@ \b\0\v \b(0 6\0\f\x1B\v \b(0 6\0\f\v \b(0 \xAC7\0\f\v \b(0 ;\0\f\v \b(0 :\0\0\f\v \b(0 6\0\f\v \b(0 \xAC7\0\f\vA\b A\bM\x1B! \fA\br!\fA\xF8\0!\x07\v ! \x07A q!\r \b)0""\x1BPE@@ Ak" \x1B\xA7Aq-\0\x90u \rr:\0\0 \x1BB\x88"\x1BB\0R\r\0\v\v !\r \fA\bqE Pr\r \x07AvA\x93 j!A!\f\v ! \b)0""\x1BPE@@ Ak" \x1B\xA7A\x07qA0r:\0\0 \x1BB\x88"\x1BB\0R\r\0\v\v !\r \fA\bqE\r  k"  H\x1B! \f\v \b)0"B\0S@ \bB\0 }"70A!A\x93 \f\v \fA\x80q@A!A\x94 \f\vA\x95 A\x93 \fAq"\x1B\v!  x!\r\v  A\0Hq\r \fA\xFF\xFF{q \f \x1B!\f B\0R rE@ !\rA\0! \f\v P  \rkj"  H\x1B! \f\r\v \b-\x000!\x07\f\v\v \b(0"A\xC4 \x1B"\rA\0A\xFF\xFF\xFF\xFF\x07 A\xFF\xFF\xFF\xFF\x07O\x1B"\x07\xCA" \rk \x07 \x1B" \rj!
  6192. A\0N@ \v!\f ! \f\f\v \v!\f !
  6193. -\0\0\r\f\v\v \b)0"\x1BPE\rA\0!\x07\f \v @ \b(0\f\vA\0!\x07 \0A A\0 \f7\f\v \bA\x006\f \b \x1B>\b \b \bA\bj"\x0760A\x7F! \x07\v!\vA\0!\x07@@ \v(\0"\rE\r\0 \bAj \r\xCA"\rA\0H\r \r \x07kK\r\0 \vAj!\v \x07 \rj"\x07 I\r\v\vA=!
  6194. \x07A\0H\r\f \0A  \x07 \f7 \x07E@A\0!\x07\f\vA\0!
  6195. \b(0!\v@ \v(\0"\rE\r \bAj" \r\xCA"\r
  6196. j"
  6197. \x07K\r \0 \r3 \vAj!\v \x07
  6198. K\r\0\v\v \0A  \x07 \fA\x80\xC0\0s7  \x07 \x07 H\x1B!\x07\f\b\v  A\0Hq\r A=!
  6199. \0 \b+0  \f \x07 \0"\x07A\0N\r\x07\f
  6200. \v \x07-\0!\v \x07Aj!\x07\f\0\v\0\v \0\r E\rA!\x07@  \x07Atj(\0"\0@  \x07Atj \0  \xCDA! \x07Aj"\x07A
  6201. G\r\f\v\v\v \x07A
  6202. O@A!\f
  6203. \v@  \x07Atj(\0\rA! \x07Aj"\x07A
  6204. G\r\0\v\f \vA!
  6205. \f\v \b \x07:\0'A! !\r \v!\f\v
  6206. \rk"\v \vJ\x1B" A\xFF\xFF\xFF\xFF\x07sJ\rA=!
  6207.   j" H\x1B"\x07 K\r \0A \x07 \f7 \0  3 \0A0 \x07 \fA\x80\x80s7 \0A0  \vA\07 \0 \r \v3 \0A \x07 \fA\x80\xC0\0s7 \b(<!\f\v\v\vA\0!\f\vA=!
  6208. \vA\xF8\xD7
  6209. 6\0\vA\x7F!\v \bA@k$\0 \v\xC2\x7F#\0A\xD0k"$\0  6\xCC A\xA0j"A\0A(\xFC\v\0  (\xCC6\xC8@A\0  A\xC8j A\xD0\0j   \xCFA\0H@A\x7F!\f\v \0(LA\0H \0 \0(\0"\bA_q6\0\x7F@@ \0(0E@ \0A\xD0\x0060 \0A\x006 \0B\x007 \0(,! \0 6,\f\v \0(\r\vA\x7F \0\xC9\r\v \0  A\xC8j A\xD0\0j A\xA0j  \xCF\v! @ \0A\0A\0 \0($\0 \0A\x0060 \0 6, \0A\x006 \0(! \0B\x007 A\x7F \x1B!\v \0 \0(\0"\0 \bA qr6\0A\x7F  \0A q\x1B!\r\0\v A\xD0j$\0 \v\x7F\x7F~ \0\xBD"B4\x88\xA7A\xFFq"A\xFFG| E@  \0D\0\0\0\0\0\0\0\0a\x7FA\0 \0D\0\0\0\0\0\0\xF0C\xA2 \xD1!\0 (\0A@j\v6\0 \0\v  A\xFE\x07k6\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x87\x80\x7F\x83B\x80\x80\x80\x80\x80\x80\x80\xF0?\x84\xBF \0\v\v\0 !\v \0  l/\v$\x7F \0("\0yAj"/"\x7F  \0 YA\0\v\v0\x7F#\0Ak"$\0 \0(\0!\0  :\0   Aj \0\0 Aj$\0\v\x8D\x7F|#\0Ak"$\0 Aj   \0(\0\x07\0  /\0;\f#\0Ak"$\0@ -\0\rAF@#\0Ak"$\0A\x9C\xCE-\0\0AqE@AA\x94,A!\0A\x9C\xCEA:\0\0A\x98\xCE \x006\0\v  -\0\f6\b A\x006A\x98\xCE(\0A\0A\0 Aj A\bj!  (6\0 A\bj"\0 \xFC6 \0A\xEC\xCE6\0 \xD2 Aj$\0 \0(! \0A\x006 \0\x84\f\v A\x006\f A\xEC\xCE6\b A\bj\x84A!\v Aj$\0 Aj$\0 \v0\x7F#\0Ak"$\0 \0(\0!\0  :\0   Aj \0\x07\0 Aj$\0\v.\x7F#\0Ak"$\0 \0(\0!\0  :\0  Aj \0\0 Aj$\0\v0\x7F#\0Ak"$\0 \0(\0!\0  8\f   A\fj \0\0 Aj$\0\v\x8D\x7F|#\0Ak"$\0 A\bj   \0(\0\x07\0  )\b7\0#\0Ak"$\0@ -\0AF@#\0Ak"$\0A\x90\xCE-\0\0AqE@AA\xD4&A!\0A\x90\xCEA:\0\0A\x8C\xCE \x006\0\v  *\x008\b A\x006A\x8C\xCE(\0A\0A\0 Aj A\bj!  (6\0 A\bj"\0 \xFC6 \0A\xEC\xCE6\0 \xD2 Aj$\0 \0(! \0A\x006 \0\x84\f\v A\x006\f A\xEC\xCE6\b A\bj\x84A!\v Aj$\0 Aj$\0 \v0\x7F#\0Ak"$\0 \0(\0!\0  8\f   A\fj \0\x07\0 Aj$\0\v.\x7F#\0Ak"$\0 \0(\0!\0  8\f  A\fj \0\0 Aj$\0\v\x7FA9"\0A\x006\0 \0\v\xA9\x7F   \0(\0j"\0G@@ (" (\0"kAu" \0(\b \0(\0"kAuM@  \0(" k"AuK@  G@ @   \xFC
  6210. \0\0\v \0(!\v   j"k"E  FrE@   \xFC
  6211. \0\0\v \0  j6\f\v  k"E  FrE@   \xFC
  6212. \0\0\v \0  j6\f\v \0(\0"@ \0 6 \0(\b ! \0A\x006\b \0B\x007\0\v \0 \0 \x86\xA8 \0(!  k"E  FrE@   \xFC
  6213. \0\0\v \0  j6\v\v\v\0  \0(\0j!\0A\f9 \0b\v\0  \0(\0j :\0\0\v\r\0  \0(\0j-\0\0\v\x1B\0 \0 (\b M@    \xA7\v\v8\0 \0 (\b M@    \xA7\v \0(\b"\0      \0(\0(\v\0\v\x92\x7F \0 (\b M@    \xA7\v -\x005 \0(\f! A\0:\x005 -\x004 A\0:\x004 \0Aj"     \xA6 -\x004"
  6214. r!\b -\x005"\vr!\x07@ AI\r\0 Atj! \0Aj!@ -\x006\r@
  6215. Aq@ (AF\r \0-\0\bAq\r\f\v \vAqE\r\0 \0-\0\bAqE\r\v A\0;4      \xA6 -\x005"\v \x07rAq!\x07 -\x004"
  6216. \brAq!\b A\bj" I\r\0\v\v  \x07Aq:\x005  \bAq:\x004\v\xA4\0@ \0 (\b M@  (G\r (AF\r  6\v \0 (\0 ME\r\0@ ( G@  (G\r\v AG\r A6 \v  6  6  ((Aj6(@ ($AG\r\0 (AG\r\0 A:\x006\v A6,\v\v\x88\0@ \0 (\b M@  (G\r (AF\r  6\v \0 (\0 M@@ ( G@  (G\r\v AG\r A6 \v  6 @ (,AF\r\0 A\0;4 \0(\b"\0   A  \0(\0(\v\0 -\x005AF@ A6, -\x004E\r\f\v A6,\v  6  ((Aj6( ($AG\r (AG\r A:\x006\v \0(\b"\0     \0(\0(
  6217. \0\v\v\xC1\x7F@ \0 (\b M@  (G\r (AF\r  6\v@ \0 (\0 M@@ ( G@  (G\r\v AG\r A6 \v  6 (,AF\r \0Aj" \0(\fAtj!\x07A\0!@@@ \x7F@  \x07O\r\0 A\0;4    A \xA6 -\x006\r\0 -\x005AG\r -\x004AF@ (AF\rA!A! \0-\0\bAqE\r\f\vA! \0-\0\bAq\rA\f\vAA \x1B\v6, \r\f\v A6,\f\v A\bj!\f\0\v\0\v \0(\f! \0Aj"    \x88 AI\r  Atj! \0Aj!@ \0(\b"\0AqE@ ($AG\r\v@ -\x006\r     \x88 A\bj" I\r\0\v\f\v \0AqE@@ -\x006\r ($AF\r     \x88 A\bj" I\r\0\f\v\0\v@ -\x006\r ($AF@ (AF\r\v     \x88 A\bj" I\r\0\v\f\v  6  ((Aj6( ($AG\r\0 (AG\r\0 A:\x006\v\v\xCB\x7F#\0A@j"$\0@@@ (A\xA2\xC7F@ A\x006\0\f\v@ \0  \0-\0\bAq\x7FA E\r A\xF8\xC4E"E\r -\0\bAqA\0G\vM!\v @A! (\0"\0E\r  \0(\x006\0\f\v A\xA8\xC5E"E\rA\0! (\0"@  (\0"6\0\v (\b"\x07 \0(\b"A\x7FsqA\x07q \x07A\x7Fs qA\xE0\0qr\r \0(\f"\x07(" (\f"\0(G\r\vA!\f\v A\xA0\xC7F@ \0A\xD8\xC5EE!\f\vA\0! \x07A\xA8\xC5E"@ AqE\r\x7F !A\0!@@A\0 \0E\r \0A\xA8\xC5E"\0E\r \0(\b (\b"A\x7Fsq\rA (\f"( \0(\f"\0(F\r AqE\r A\xA8\xC5E"\r\0\v A\x8C\xC6E"E\r\0  \0\xD9!\v \v!\f\v \x07A\x8C\xC6E"@ AqE\r  \0\xD9!\f\v \x07A\xC8\xC4E"E\r\0 \0A\xC8\xC4E"\0E\r\0 A\bjA\0A8\xFC\v\0  A\0G:\0; A\x7F6  6\f  \x006 A64 \0 Aj A \0(\0(\b\0 ("\0AF@  (A\0 \x1B6\0\v \0AF!\v A@k$\0 \vr\x7F \0( (\b(F@   \xA8\v \0(\f! \0Aj"   \xDA@ AI\r\0  Atj! \0Aj!\0@ \0   \xDA -\x006\r \0A\bj"\0 I\r\0\v\v\v\0 \0@ \0\xC7\v \0!\v5\0 \0( (\b(F@   \xA8\v \0(\b"\0    \0(\0(\b\0\v\0 \0( (\b(F@   \xA8\v\v\xC4\x7F#\0A\xD0\0k"$\0@\x7FA \0( (F\r\0A\0 A\xC8\xC4E"E\r\0 (\0"E\r AjA\0A8\xFC\v\0 A:\0K A\x7F6  \x006  6 A6D  Aj A (\0(\b\0 (,"\0AF@  ($6\0\v \0AF\v A\xD0\0j$\0\v A\xC16\b A\xE76 A\x9F\r6\0\x9C\0\v\x7FA\xD4\09"\0A\0A\xD4\0\xFC\v\0 \0\v\0 \0(\0 j -\0\0:\0\0A\v \0A\xEC\xE1 \v3\x7F ( (\0"k K@A!  j-\0\0!\v \0 :\0 \0 :\0\0\v$\0A\xF8\xE1-\0\0E@A\xEC\xE1A\xD8\x92jA\xF8\xE1A:\0\0\vA\xEC\xE1\v \0A\xDC\xE1 \v$\0A\xE8\xE1-\0\0E@A\xDC\xE1A\xE3\r\x80A\xE8\xE1A:\0\0\vA\xDC\xE1\v \0A\xCC\xE1 \v$\0A\xD8\xE1-\0\0E@A\xCC\xE1A\x84\x92jA\xD8\xE1A:\0\0\vA\xCC\xE1\v \0A\xBC\xE1 \v$\0A\xC8\xE1-\0\0E@A\xBC\xE1A\xBC\x80A\xC8\xE1A:\0\0\vA\xBC\xE1\v \0A\xAC\xE1 \v$\0A\xB8\xE1-\0\0E@A\xAC\xE1A\xE0\x91jA\xB8\xE1A:\0\0\vA\xAC\xE1\v \0A\xDC\xCC \v\r\0 \0( \0(\0k\v\0A\xA9\xE1-\0\0E@A\xA9\xE1A:\0\0\vA\xDC\xCC\v \0A\x9C\xE1 \v$\0A\xA8\xE1-\0\0E@A\x9C\xE1A\xBC\x91jA\xA8\xE1A:\0\0\vA\x9C\xE1\v \0A\xD0\xCC \v\0A\x99\xE1-\0\0E@A\x99\xE1A:\0\0\vA\xD0\xCC\v\x1B\0A\xF8\xE9!\0@ \0A\fk "\0A\xE0\xE9G\r\0\v\vT\0A\x98\xE1-\0\0@A\x94\xE1(\0\vA\xF8\xE9-\0\0E@A\xF8\xE9A:\0\0\vA\xE0\xE9A\xF8\xBA&A\xEC\xE9A\x84\xBB&A\x98\xE1A:\0\0A\x94\xE1A\xE0\xE96\0A\xE0\xE9\v\x1B\0A\xD8\xE9!\0@ \0A\fk "\0A\xC0\xE9G\r\0\v\vR\0A\x90\xE1-\0\0@A\x8C\xE1(\0\vA\xD8\xE9-\0\0E@A\xD8\xE9A:\0\0\vA\xC0\xE9A\xF4'A\xCC\xE9A\xF1'A\x90\xE1A:\0\0A\x8C\xE1A\xC0\xE96\0A\xC0\xE9\v\x1B\0A\xB0\xE9!\0@ \0A\fk "\0A\x90\xE7G\r\0\v\v\xF1\x7F@ \0( \0(\0"k" I@#\0A k"$\0@  k" \0(\b \0("kM@  \0("j!@  F@ \0 6  -\0\0:\0\0 Aj!\f\v\v\f\v  A\fj \0  j \0(\0k\x83 \0( \0(\0k \0\x8C"(\b"j!@  G@  -\0\0:\0\0 Aj!\f\v\v  6\b \0 \xA9 \x87\v A j$\0\f\v  I@ \0  j6\v\v\v\xB0\0A\x88\xE1-\0\0@A\x84\xE1(\0\vA\xB0\xE9-\0\0E@A\xB0\xE9A:\0\0\vA\x90\xE7A\xF0\xB6&A\x9C\xE7A\x90\xB7&A\xA8\xE7A\xB4\xB7&A\xB4\xE7A\xCC\xB7&A\xC0\xE7A\xE4\xB7&A\xCC\xE7A\xF4\xB7&A\xD8\xE7A\x88\xB8&A\xE4\xE7A\x9C\xB8&A\xF0\xE7A\xB8\xB8&A\xFC\xE7A\xE0\xB8&A\x88\xE8A\x80\xB9&A\x94\xE8A\xA4\xB9&A\xA0\xE8A\xC8\xB9&A\xAC\xE8A\xD8\xB9&A\xB8\xE8A\xE8\xB9&A\xC4\xE8A\xF8\xB9&A\xD0\xE8A\xE4\xB7&A\xDC\xE8A\x88\xBA&A\xE8\xE8A\x98\xBA&A\xF4\xE8A\xA8\xBA&A\x80\xE9A\xB8\xBA&A\x8C\xE9A\xC8\xBA&A\x98\xE9A\xD8\xBA&A\xA4\xE9A\xE8\xBA&A\x88\xE1A:\0\0A\x84\xE1A\x90\xE76\0A\x90\xE7\v\x1B\0A\x80\xE7!\0@ \0A\fk "\0A\xE0\xE4G\r\0\v\v\x98\0A\x80\xE1-\0\0@A\xFC\xE0(\0\vA\x80\xE7-\0\0E@A\x80\xE7A:\0\0\vA\xE0\xE4A\xC0\b'A\xEC\xE4A\xB7\b'A\xF8\xE4A\xDF'A\x84\xE5A\xAE'A\x90\xE5A\x86 'A\x9C\xE5A\xAA'A\xA8\xE5A\xC8\b'A\xB4\xE5A\xB8 'A\xC0\xE5A\xFA\f'A\xCC\xE5A\xE9\f'A\xD8\xE5A\xF1\f'A\xE4\xE5A\x84\r'A\xF0\xE5A\xFF\r'A\xFC\xE5A\xB8'A\x88\xE6A\x9B\r'A\x94\xE6A\x9B\f'A\xA0\xE6A\x86 'A\xAC\xE6A\xF3\r'A\xB8\xE6A\xA5'A\xC4\xE6A\xE5'A\xD0\xE6A\xDF\r'A\xDC\xE6A\xC3
  6218. 'A\xE8\xE6A\xB0 'A\xF4\xE6A\x9B'A\x80\xE1A:\0\0A\xFC\xE0A\xE0\xE46\0A\xE0\xE4\v\x1B\0A\xD8\xE4!\0@ \0A\fk "\0A\xB0\xE3G\r\0\v\v\xCC\0A\xF8\xE0-\0\0@A\xF4\xE0(\0\vA\xD8\xE4-\0\0E@A\xD8\xE4A:\0\0\vA\xB0\xE3A\x9C\xB4&A\xBC\xE3A\xB8\xB4&A\xC8\xE3A\xD4\xB4&A\xD4\xE3A\xF4\xB4&A\xE0\xE3A\x9C\xB5&A\xEC\xE3A\xC0\xB5&A\xF8\xE3A\xDC\xB5&A\x84\xE4A\x80\xB6&A\x90\xE4A\x90\xB6&A\x9C\xE4A\xA0\xB6&A\xA8\xE4A\xB0\xB6&A\xB4\xE4A\xC0\xB6&A\xC0\xE4A\xD0\xB6&A\xCC\xE4A\xE0\xB6&A\xF8\xE0A:\0\0A\xF4\xE0A\xB0\xE36\0A\xB0\xE3\v\x1B\0A\xA8\xE3!\0@ \0A\fk "\0A\x80\xE2G\r\0\v\v\xBE\0A\xF0\xE0-\0\0@A\xEC\xE0(\0\vA\xA8\xE3-\0\0E@A\xA8\xE3A:\0\0\vA\x80\xE2A\xF1\b'A\x8C\xE2A\xF8\b'A\x98\xE2A\xD6\b'A\xA4\xE2A\xDE\b'A\xB0\xE2A\xCD\b'A\xBC\xE2A\xFF\b'A\xC8\xE2A\xE8\b'A\xD4\xE2A\xEF\r'A\xE0\xE2A\xF7\r'A\xEC\xE2A\x8D'A\xF8\xE2A\xCE'A\x84\xE3A\xB4 'A\x90\xE3A\xC4'A\x9C\xE3A\xE7
  6219. 'A\xF0\xE0A:\0\0A\xEC\xE0A\x80\xE26\0A\x80\xE2\v
  6220. \0 \0A\xA4\x91j\v
  6221. \0 \0A\x91\x80\v\x90\x7F \0\x7F \0(" \0(\bI@  -\0\0:\0\0 Aj\f\v#\0A k"$\0 A\fj \0 \0( \0(\0kAj\x83 \0( \0(\0k \0\x8C"(\b -\0\0:\0\0  (\bAj6\b \0 \xA9 \0( \x87 A j$\0\v6\v
  6222. \0 \0A\x90\x91j\v
  6223. \0 \0A\x88\x80\v\f\0 \0 Aj\xA3\v\f\0 \0 A\fj\xA3\v\x07\0 \0(\f\v\x07\0 \0,\0 \v\x07\0 \0(\b\v\x07\0 \0,\0\b\v \0 \0\xE5!\v\0A\xB4*\v \0 \0\xE6!\v\0 \0(\0 Atj *\x008\0A\v\0 \0(\b"\0E@A\v \0\xED\v\x87\x7F@@  F  \bMr\r\0A! \0(\b!#\0Ak"\x07$\0 \x07 H6\fA\0   k A\xC0\xDD \x1B\x98! \x07A\fjI \x07Aj$\0@@ Aj\0\v !\v \bAj!\b  j!  j!\f\v\v \vA\x7F \0(\b!#\0Ak"$\0  H6\f A\fjI Aj$\0 \0(\b"\0E@A\v \0\xEDAF\v\x89\x7F#\0Ak"$\0  6\0\x7FA A\fj"A\0 \0(\b\xAF"\0AjAI\r\0A \0Ak"  (\0kK\r\0\x7F \x7F -\0\0!\0  (\0"Aj6\0  \0:\0\0 Ak! Aj!\fA\0\v\v\v Aj$\0\v\xBD\f\x7F#\0Ak"$\0 !\b@@  \bF@ !\b\f\v \b-\0\0E\r\0 \bAj!\b\f\v\v \x07 6\0  6\0@@\x7F@  F  Fr\r\0  )\x007\b \0(\b! #\0Ak"$\0  H6\f \b k!A\0!
  6224. #\0A\x90\bk"\f$\0 \f (\0" 6\f  \fAj \x1B!@@@ E  kAuA\x80 \x1B"\rErE@@ A\x83K Av"\v \rOrE@ !\v\f\v  \fA\fj \v \r \v \rI\x1B \xA4! \f(\f!\v A\x7FF@A\0!\rA\x7F!
  6225. \f\v \r A\0  \fAjG\x1B"k!\r  Atj! j \vkA\0 \v\x1B!
  6226. j!
  6227. \vE\r \v! \r\r\0\f\v\0\v !\v\v \vE\r\v \rE Er\r\0
  6228. ! @@@  \v  \x98"
  6229. AjAM@@@
  6230. Aj\0\v \fA\x006\f\f\v A\x006\0\f\v \f \f(\f
  6231. j"\v6\f Aj! \rAk"\r\r\v !
  6232. \f\v Aj! 
  6233. k! !
  6234. \r\0\v\v @  \f(\f6\0\v \fA\x90\bj$\0 A\fjI Aj$\0@@@@
  6235. A\x7FF@@@ \x07 6\0  (\0F\r\0A!@@@   \b k A\bj \0(\b\xEE"Aj\b\0\v  6\0\f\v !\v  j! \x07(\0Aj!\f\v\v  6\0\f\v \x07 \x07(\0
  6236. Atj"6\0  F\r (\0!  \bF\r  A  \0(\b\xEEE\r\vA\f\v \x07 \x07(\0Aj"6\0  (\0Aj"6\0 !\b@  \bF\r \b-\0\0E\r \bAj!\b\f\0\v\0\v  6\0A\f\v (\0!\v  G\v Aj$\0\v !\b\f\0\v\0\v\x9F\v\x7F#\0Ak"$\0 !\b@@  \bF@ !\b\f\v \b(\0E\r\0 \bAj!\b\f\v\v \x07 6\0  6\0@@@@  F  Fr\x7F   )\x007\bA! \0(\b! #\0Ak"$\0  H6\f !  k!
  6237. A\0!\f#\0Ak"$\0@ (\0"\vE \b kAu"Er\r\0
  6238. A\0 \x1B!
  6239. @ A\fj
  6240. AI\x1B \v(\0\xC5"\rA\x7FF@A\x7F!\f\f\v \x7F
  6241. AM@
  6242. \rI\r A\fj \rY\v
  6243. \rk!
  6244. \rjA\0\v! \v(\0E@A\0!\v\f\v \f \rj!\f \vAj!\v Ak"\r\0\v\v @  \v6\0\v Aj$\0 A\fjI Aj$\0@@@@ \fAj\0\b\v \x07 6\0@  (\0F\r  (\0 \0(\b\xAF"A\x7FF\r \x07 \x07(\0 j"6\0 Aj!\f\0\v\0\v \x07 \x07(\0 \fj"6\0  F\r  \bF@ (\0! !\b\f\v Aj"A\0 \0(\b\xAF"\bA\x7FF\r  \x07(\0k \bI\r@ \b@ -\0\0! \x07 \x07(\0" Aj6\0 :\0\0 \bAk!\b Aj!\f\v\v  (\0Aj"6\0 !\b@  \bF@ !\b\f\v \b(\0E\r \bAj!\b\f\0\v\0\v  6\0\f\v (\0\v G!\f\v \x07(\0!\f\v\vA!\v Aj$\0 \v \0 \0\xF6!\v=\0 \0\x7F ( (\0"kAu K@ \0  Atj*\x008\0A\f\v \0A\0:\0\0A\0\v:\0\v\0  k"\0  \0 I\x1B\v4\0@  FE@   ,\0\0"\0 \0A\0H\x1B:\0\0 Aj! Aj!\f\v\v \v\f\0   A\0H\x1B\v*\0@  FE@  -\0\0:\0\0 Aj! Aj!\f\v\v \v9\0@  FE@  -\0\0"\0 \0A r \0A\xDB\0kA\xFFqA\xE6I\x1B:\0\0 Aj!\f\v\v \v\0  A r A\xDB\0kA\xFFqA\xE6I\x1B\v:\0@  FE@  -\0\0"\0 \0A\xDF\0q \0A\xFB\0kA\xFFqA\xE6I\x1B:\0\0 Aj!\f\v\v \v\0  A\xDF\0q A\xFB\0kA\xFFqA\xE6I\x1B\v\0 \0( \0(\0kAu\v \0 \0\xF0!\v5\0@  FE@  (\0"\0  \0A\x80I\x1B:\0\0 Aj! Aj!\f\v\v \v\0   A\x80I\x1B\xC0\v*\0@  FE@  ,\0\x006\0 Aj! Aj!\f\v\v \v4\0@  FE@  (\0"\0 \0A r \0A\xDB\0kAfI\x1B6\0 Aj!\f\v\v \v\0  A r A\xDB\0kAfI\x1B\v5\0@  FE@  (\0"\0 \0A\xDF\0q \0A\xFB\0kAfI\x1B6\0 Aj!\f\v\v \v\0  A\xDF\0q A\xFB\0kAfI\x1B\v\x86\x7F@ \0( \0(\0"kAu" I@#\0A k"$\0@  k" \0(\b \0("kAuM@ \0(" Atj!@  F@ \0 6  *\x008\0 Aj!\f\v\v\f\v A\fj \0  \0(\0kAu j\x86 \0( \0(\0kAu \0\xB8"(\b" Atj!@  G@  *\x008\0 Aj!\f\v\v  6\b \0 \x96 \xB5\v A j$\0\f\v  I@ \0  Atj6\v\v\v7\0@@  F\r\0 (\0"\0A\xFF\0K\r\0 \0At(\x90\x88 qE\r\0 Aj!\f\v\v \v7\0@@  F\r\0 (\0"\0A\xFF\0M@ \0At(\x90\x88 q\r\v Aj!\f\v\v \vF\x7F@  FE@A\0!\0  (\0"A\xFF\0M\x7F At(\x90\x88A\0\v6\0 Aj! Aj!\f\v\v \v"\0A\0!\0 A\xFF\0M\x7F At(\x90\x88 qA\0GA\0\v\v\0 \0 \0(\0(\0\v \0 \0\xF5!\v\x95\x7F \0\x7F \0(" \0(\bI@  *\x008\0 Aj\f\v#\0A k"$\0 A\fj \0 \0( \0(\0kAuAj\x86 \0( \0(\0kAu \0\xB8"(\b" *\x008\0  Aj6\b \0 \x96 \0( \xB5 A j$\0\v6\v\xA1\0@ ,\0\vA\0N@ \0 (\b6\b \0 )\x007\0\f\v (\0!@@@ ("AM@ \0 :\0\v\f\v A\xF7\xFF\xFF\xFFO\r Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v AtAj"@ \0  \xFC
  6245. \0\0\v\f\v0\0\v\v\v \0 \0 \xA3\v\x9F\x07\x7F#\0A\xF0k"$\0 A\xECj"\0 $ \0=!
  6246. ( ,\0\v"\0 \0A\0H"\0\x1B@ (\0  \0\x1B(\0
  6247. A-
  6248. (\0(,\0F!\x07\v A\x006\xD8 B\x007\xD0 A\x006\xC8 B\x007\xC0 A\x006\xB8 B\x007\xB0  \x07 A\xECj A\xE8j A\xE4j A\xE0j A\xD0j A\xC0j A\xB0j A\xACj\xF9@\x7F\x7F ("\v ,\0\v"\b \bA\0H\x1B"\0 (\xAC" J@ \0 kAtj (\xB4 ,\0\xBB"\0 \0A\0H\x1Bj (\xC4 ,\0\xCB"\0 \0A\0H\x1BjAj\f\v (\xB4 ,\0\xBB"\0 \0A\0H\x1Bj (\xC4 ,\0\xCB"\0 \0A\0H\x1BjAj\v"\0A\xE5\0I@A\0! Aj\f\v \0At/"E\r -\0\v!\b (!\v \v"\0 A\fj A\bj ( (\0  \b\xC0A\0H"\x1B"\f \f \v \b \x1BAtj
  6249. \x07 A\xE8j (\xE4 (\xE0 A\xD0j" A\xC0j"\x07 A\xB0j"\b \xF8  \0 (\f (\b  \\ ! \b  \x07    (\xEC# A\xF0j$\0\v0\0\v\xE4\b\x7F#\0A\xA0\bk"\0$\0 \0 7 \0 7 \0 \0A\xB0\x07j"\x076\xAC\x07 \0A\x90j! @ \x07A\xE3 \0Aje"\x07A\xE4\0O@*!\x07 \0 7\0 \0 7\b \0A\xAC\x07j \x07A\xE3 \0P"\x07A\x7FF\r \0(\xAC\x07!\r \x07At/"\v! \vE\r\v \0A\x8Cj"\b $ \b=" \0(\xAC\x07"\b \x07 \bj (\0(0\0 \x07A\0J@ \0(\xAC\x07-\0\0A-F!
  6250. \v \0A\x006\xF8 \0B\x007\xF0 \0A\x006\xE8 \0B\x007\xE0 \0A\x006\xD8 \0B\x007\xD0 
  6251. \0A\x8Cj \0A\x88j \0A\x84j \0A\x80j \0A\xF0j \0A\xE0j \0A\xD0j \0A\xCCj\xF9@\x7F \0(\xCC"\b \x07H@ \b \x07 \bkAtj \0(\xD4 \0,\0\xDB" A\0H\x1Bj \0(\xE4 \0,\0\xEB" A\0H\x1BjAj\f\v \b \0(\xD4 \0,\0\xDB" A\0H\x1Bj \0(\xE4 \0,\0\xEB" A\0H\x1BjAj\v"A\xE5\0I@ \0A0j!\f\v At/"\f! \fE\r\v  \0A,j \0A(j ( \x07Atj 
  6252. \0A\x88j \0(\x84 \0(\x80 \0A\xF0j"
  6253. \0A\xE0j"\x07 \0A\xD0j" \b\xF8   \0(, \0((  \\ \f!   \x07 
  6254.   \0(\x8C# \v! \r! \0A\xA0\bj$\0\v0\0\v\x99\x07\x7F#\0A\xB0k"$\0 A\xACj"\0 $ \0>!
  6255. ( ,\0\v"\0 \0A\0H"\0\x1B@ (\0  \0\x1B-\0\0
  6256. A-
  6257. (\0(\0A\xFFqF!\x07\v A\x006\xA0 B\x007\x98 A\x006\x90 B\x007\x88 A\x006\x80 B\x007x  \x07 A\xACj A\xA8j A\xA7j A\xA6j A\x98j A\x88j A\xF8\0j A\xF4\0j\xFC@\x7F\x7F ("\v ,\0\v"\b \bA\0H\x1B"\0 (t" J@ \0 kAtj (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\f\v (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\v"\0A\xE5\0I@A\0! Aj\f\v \0/"E\r -\0\v!\b (!\v \v"\0 A\fj A\bj ( (\0  \b\xC0A\0H"\x1B"\f \f \v \b \x1Bj
  6258. \x07 A\xA8j ,\0\xA7 ,\0\xA6 A\x98j" A\x88j"\x07 A\xF8\0j"\b \xFB  \0 (\f (\b  Z ! \b  \x07    (\xAC# A\xB0j$\0\v0\0\v\xDB\b\x7F#\0A\xB0k"\0$\0 \0 7 \0 7 \0 \0A\xC0j"\x076\xBC \0A\xD0j! @ \x07A\xE3 \0Aje"\x07A\xE4\0O@*!\x07 \0 7\0 \0 7\b \0A\xBCj \x07A\xE3 \0P"\x07A\x7FF\r \0(\xBC!\r \x07/"\v! \vE\r\v \0A\xCCj"\b $ \b>" \0(\xBC"\b \x07 \bj (\0( \0 \x07A\0J@ \0(\xBC-\0\0A-F!
  6259. \v \0A\x006\xC0 \0B\x007\xB8 \0A\x006\xB0 \0B\x007\xA8 \0A\x006\xA0 \0B\x007\x98 
  6260. \0A\xCCj \0A\xC8j \0A\xC7j \0A\xC6j \0A\xB8j \0A\xA8j \0A\x98j \0A\x94j\xFC@\x7F \0(\x94"\b \x07H@ \b \x07 \bkAtj \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\f\v \b \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\v"A\xE5\0I@ \0A0j!\f\v /"\f! \fE\r\v  \0A,j \0A(j ( \x07 j 
  6261. \0A\xC8j \0,\0\xC7 \0,\0\xC6 \0A\xB8j"
  6262. \0A\xA8j"\x07 \0A\x98j" \b\xFB   \0(, \0((  Z \f!   \x07 
  6263.   \0(\xCC# \v! \r! \0A\xB0j$\0\v0\0\v\xC0\x7F#\0A\xC0k"\0$\0 \0 6\xB8 \0 6\xBC \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07=! \0A\0:\0 \0A\xBCj   \x07 (  \0Aj  \0Aj \0Aj \0A\xB0j\x80@@ ,\0\vA\0H@ (\0A\x006\0 A\x006\f\v A\0:\0\v A\x006\0\v \0-\0AF@  A- (\0(,\0\xDD\v A0 (\0(,\0! \0("Ak! \0(!@@  O\r\0 (\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@  F\r\0 ,\0\v! (\b!\b (!\x07  (\0  ,\0\v" A\0H"
  6264. \x1B"\vO  \v (
  6265. \x1BAtjAjIqE@ \x07  A\0H" \x1B"  k"Au"
  6266. j!\x07
  6267. \bA\xFF\xFF\xFF\xFF\x07qAkA \x1B"\b kK@  \b \x07 \bk  \xFF\v At (\0  ,\0\vA\0H\x1Bj! @   \xFC
  6268. \0\0\v  jA\x006\0 ,\0\vA\0H@  \x076\f\v  \x07A\xFF\0q:\0\v\f\v Aj"\x07  \xA2 ( \x07 ,\0"A\0H"
  6269. \x1B!@ (\b 
  6270. \x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA ,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0  \bA\0H\x1B!\b At" @ \b Atj  \xFC
  6271. \0\0\v  j!@ ,\0\vA\0H@  6\f\v  A\xFF\0q:\0\v\v \b AtjA\x006\0\f\v   j k  A\0  \xDE\v \x07 \v Aj$\0\v \0A\xBCj \0A\xB8j(@  (\0Ar6\0\v \0(\xBC \0(# \0(! \0A\x006 @  \0(\0\v \0A\xC0j$\0\v\xDD\x7F#\0A\xF0k"\x07$\0 \x07 6\xE8 \x07 6\xEC \x07A\xE3\x006\xCC \x07 \x07A\xD0j6\xC8 \x07A\xC0j" $ =!\0 \x07A\0:\0\xBF@ \x07A\xECj    (  \x07A\xBFj \0 \x07A\xC8j \x07A\xC4j \x07A\xE0j\x80E\r\0 \x07A\xEE\x1B(\0\x006\0\xB7 \x07A\xE7\x1B)\0\x007\xB0 \0 \x07A\xB0j \x07A\xBAj \x07A\x80j \0(\0(0\0 \x07Aj!\0@ \x07(\xC4" \x07(\xC8"k"A\x89N@ AvAj/"\0!\b \0E\r\v \0! \x07-\0\xBFAF@ \0A-:\0\0 \0Aj!\v \x07A\xA8j!@  M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v  \x07A\xB0j \x07A\x80j"  \xB1 kAuj-\0\0:\0\0 Aj! Aj! \x07(\xC4!\f\v\v0\0\v0\0\v \x07A\xECj \x07A\xE8j(@  (\0Ar6\0\v \x07(\xEC \x07(\xC0# \x07(\xC8!\0 \x07A\x006\xC8 \0@ \0 \x07(\xCC\0\v \x07A\xF0j$\0\v\xAE\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07>! \0A\0:\0 \0A\x8Cj   \x07 (  \0Aj  \0Aj \0Aj \0A\x84j\x85@@ ,\0\vA\0H@ (\0A\0:\0\0 A\x006\f\v A\0:\0\v A\0:\0\0\v \0-\0AF@  A- (\0(\0\xAA\v A0 (\0(\0 \0("Ak! \0(!A\xFFq!@@  O\r\0 -\0\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@  F\r\0 ,\0\v! (\b!\b (!\x07  (\0  ,\0\v" A\0H"
  6272. \x1B"\vO  \v (
  6273. \x1BjAjIqE@ \x07  A\0H" \x1B"  k"j!\x07  \bA\xFF\xFF\xFF\xFF\x07qAkA
  6274. \x1B"\b kK@  \b \x07 \bk  \xA4\v (\0  ,\0\vA\0H\x1B j! @   \xFC
  6275. \0\0\v  jA\0:\0\0 ,\0\vA\0H@  \x076\f\v  \x07A\xFF\0q:\0\v\f\v Aj"\x07  \xCE ( \x07 ,\0"A\0H"
  6276. \x1B!@ (\b 
  6277. \x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA
  6278. ,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0  \bA\0H\x1B!\b @  \bj  \xFC
  6279. \0\0\v  j!@ ,\0\vA\0H@  6\f\v  A\xFF\0q:\0\v\v  \bjA\0:\0\0\f\v   j k  A\0  \x89\v \x07 \v Aj$\0\v \0A\x8Cj \0A\x88j)@  (\0Ar6\0\v \0(\x8C \0(# \0(! \0A\x006 @  \0(\0\v \0A\x90j$\0\v\xD1\x7F#\0A\x90k"\x07$\0 \x07 6\x88 \x07 6\x8C \x07A\xE3\x006\x9C \x07 \x07A\xA0j6\x98 \x07A\x90j" $ >!\0 \x07A\0:\0\x8F@ \x07A\x8Cj    (  \x07A\x8Fj \0 \x07A\x98j \x07A\x94j \x07A\x84j\x85E\r\0 \x07A\xEE\x1B(\0\x006\0\x87 \x07A\xE7\x1B)\0\x007\x80 \0 \x07A\x80j \x07A\x8Aj \x07A\xF6\0j \0(\0( \0 \x07Aj!\0@ \x07(\x94" \x07(\x98"k"A\xE3\0N@ Aj/"\0!\b \0E\r\v \0! \x07-\0\x8FAF@ \0A-:\0\0 \0Aj!\v \x07A\x80j!@  M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v  \x07A\xF6\0j  \xB4 \x07k \x07j-\0
  6280. :\0\0 Aj! Aj! \x07(\x94!\f\v\v0\0\v0\0\v \x07A\x8Cj \x07A\x88j)@  (\0Ar6\0\v \x07(\x8C \x07(\x90# \x07(\x98!\0 \x07A\x006\x98 \0@ \0 \x07(\x9C\0\v \x07A\x90j$\0\v\0A\xFC \v\xC7\x7F#\0A\xA0k"\b$\0 \b \bA\xA0j"6\f#\0A\x90k"\x07$\0 \x07 \x07A\x84j6 \0A\bj \x07A j" \x07Aj   \x88 \x07B\x007 \x07 6\f \b(\f \bAj"kAu! \0(\b!\0#\0Ak"$\0  \0H6\f  \x07A\fj  \x07Aj\xA4!\0 A\fjI Aj$\0 \0A\x7FF@0\0\v \b  \0Atj6\f \x07A\x90j$\0 \b(\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0  6\f@ \0 G@ A\fj (\0\xBE Aj!\f\v\v  6\b  (\f6\f Aj$\0  )\b7\b Aj$\0 (\f Aj$\0 $\0\v\xB8\0#\0A\x80k"$\0  A\xF4\0j6\f \0A\bj Aj" A\fj   \x88 (\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0  6\f@ \0 G@ A\fj ,\0\0\xC0 Aj!\f\v\v  6\b  (\f6\f Aj$\0  )\b7\b Aj$\0 (\f Aj$\0 A\x80j$\0\v\xB8\r\x7F#\0A0k"\x07$\0 \x07 6, A\x006\0 \x07 $ \x07=!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07
  6281. \0\b \v\f\r\v\v \0 Aj \x07A,j   \b\x8B\f\v \0 Aj \x07A,j   \b\x8A\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(,     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BAtjV6,\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AkAKrE@  \x006\f\f\v  Ar6\0\v\f\v \x07A\xA8\x86)\x007 \x07A\xA0\x86)\x007 \x07A\x98\x86)\x007\b \x07A\x90\x86)\x007\0 \x07 \0      \x07 \x07A jV6,\f\v \x07A\xC8\x86)\x007 \x07A\xC0\x86)\x007 \x07A\xB8\x86)\x007\b \x07A\xB0\x86)\x007\0 \x07 \0      \x07 \x07A jV6,\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AJrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AkA\vKrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0A\xEDJrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0Ak"\0A\vKrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0A;JrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j!\0#\0Ak"$\0  6\f@@ \0 A\fj(\r\0 \bA \0: \b(\0(\f\0E\r\0 \0Q\f\v\v \0 A\fj(@  (\0Ar6\0\v Aj$\0\f\r\v \x07A,j!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@  (\0Ar6\0\f\v   \0 \0Aj \b A\0\x95" \0G (\b"A\fGrE@ A\x006\b\f\v  \0kA\fG A\vJrE@  A\fj6\b\v\v\f\f\v \x07A\xD0\x86A,\xFC
  6282. \0\0 \x07 \0      \x07 \x07A,jV6,\f\v\v \x07A\x90\x87(\x006 \x07A\x88\x87)\x007\b \x07A\x80\x87)\x007\0 \x07 \0      \x07 \x07AjV6,\f
  6283. \v \x07A,j   \bAN!\0@ (\0"Aq \0A<JrE@  \x006\0\f\v  Ar6\0\v\f \v \x07A\xB8\x87)\x007 \x07A\xB0\x87)\x007 \x07A\xA8\x87)\x007\b \x07A\xA0\x87)\x007\0 \x07 \0      \x07 \x07A jV6,\f\b\v \x07A,j   \bAN!\0@ (\0"Aq \0AJrE@  \x006\f\v  Ar6\0\v\f\x07\v \0      \0(\0(\0\f\x07\v \0A\bj \0(\b(\0\0! \x07 \0 \x07(,     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BAtjV6,\f\v Aj \x07A,j   \b\x89\f\v \x07A,j   \bAN!\0 -\0\0AqE@  \0A\xECk6\v\f\v A%F\r\v  (\0Ar6\0\f\v#\0Ak"\0$\0 \0 6\f@ \x7FA \x07A,j" \0A\fj"(\r\0A \b :A\0 \b(\0(4\0A%G\r\0 Q (E\rA\v (\0r6\0\v \0Aj$\0\v \x07(,\v \x07A0j$\0\v \0  \0\0\0\vK\x7F#\0Ak"$\0  6\f A\bj" $ =! (\b# Aj A\fj   \x89 (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ =! (\b# \0 Aj A\fj   \x8A (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ =! (\b# \0 Aj A\fj   \x8B (\f Aj$\0\vF\0 \0      \0A\bj \0(\b(\0\0"\0(\0 \0 \0,\0\v"A\0H"\x1B"  \0(  \x1BAtjV\vX\x7F#\0A k"$\0 A\xB8\x87)\x007 A\xB0\x87)\x007 A\xA8\x87)\x007\b A\xA0\x87)\x007\0 \0       A j"V $\0\v\xDB\f\x7F#\0Ak"\x07$\0 \x07 6\f A\x006\0 \x07 $ \x07>!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07
  6284. \0\b \v\f\r\v\v \0 Aj \x07A\fj   \b\x8E\f\v \0 Aj \x07A\fj   \b\x8D\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(\f     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BjW6\f\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AkAKrE@  \x006\f\f\v  Ar6\0\v\f\v \x07B\xA5\xDA\xBD\xA9\xC2\xEC\xCB\x92\xF9\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\v \x07B\xA5\xB2\xB5\xA9\xD2\xAD\xCB\x92\xE4\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AJrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AkA\vKrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0A\xEDJrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0Ak"\0A\vKrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0A;JrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj!\0#\0Ak"$\0  6\f@@ \0 A\fj)\r\0 \0;"A\0H\r\0 \b(\b Atj-\0\0AqE\r\0 \0S\f\v\v \0 A\fj)@  (\0Ar6\0\v Aj$\0\f\r\v \x07A\fj!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@  (\0Ar6\0\f\v   \0 \0Aj \b A\0\x97" \0G (\b"A\fGrE@ A\x006\b\f\v  \0kA\fG A\vJrE@  A\fj6\b\v\v\f\f\v \x07A\xF8\x85(\0\x006\0\x07 \x07A\xF1\x85)\0\x007\0 \x07 \0      \x07 \x07A\vjW6\f\f\v\v \x07A\x80\x86-\0\0:\0 \x07A\xFC\x85(\0\x006\0 \x07 \0      \x07 \x07AjW6\f\f
  6285. \v \x07A\fj   \bAO!\0@ (\0"Aq \0A<JrE@  \x006\0\f\v  Ar6\0\v\f \v \x07B\xA5\x90\xE9\xA9\xD2\xC9\xCE\x92\xD3\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\b\v \x07A\fj   \bAO!\0@ (\0"Aq \0AJrE@  \x006\f\v  Ar6\0\v\f\x07\v \0      \0(\0(\0\f\x07\v \0A\bj \0(\b(\0\0! \x07 \0 \x07(\f     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BjW6\f\f\v Aj \x07A\fj   \b\x8C\f\v \x07A\fj   \bAO!\0 -\0\0AqE@  \0A\xECk6\v\f\v A%F\r\v  (\0Ar6\0\f\v#\0Ak"\0$\0 \0 6\f@ \x7FA \x07A\fj" \0A\fj")\r\0A \b ;A\0 \b(\0($\0A%G\r\0 S )E\rA\v (\0r6\0\v \0Aj$\0\v \x07(\f\v \x07Aj$\0\v\x9B\x7F#\0A\xE0\0k"$\0 A\fj"   (\0 \0\b\0A\xD4\09"\0 -\0\b:\0\b \0 )\x007\0 \0A\fj A\fjb \0Aj Ajb \0A$j A$jb \0A0j A0jb \0A<j A<jb \0A\xC8\0j A\xC8\0jb \xC7 A\xE0\0j$\0 \0\vK\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# Aj A\fj   \x8C (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# \0 Aj A\fj   \x8D (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# \0 Aj A\fj   \x8E (\f Aj$\0\vC\0 \0      \0A\bj \0(\b(\0\0"\0(\0 \0 \0,\0\v"A\0H"\x1B"  \0(  \x1BjW\v;\x7F#\0Ak"$\0 B\xA5\x90\xE9\xA9\xD2\xC9\xCE\x92\xD3\x007\b \0      A\bj Aj"W $\0\v+\x7F  ("A\xB5\xFB~qA\x88r6    \x91  6\v\xB7\x07\x7F\x7F#\0A\x90k"\0$\0 \0B%7\x88 \0A\x88j"\x07ArA\x82 (\x91!\b \0 \0A\xE0j" 6\xDC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6  \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xE0j  \0A\x88j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xDCj  \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xDCj  \0A\x88j \0P\v"A\x7FF\r \0(\xDC\f\vA\0\v \0(\xDC"\x07  \x07j"
  6286. G!\v@ \0A\xE0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v
  6287.  \0A\xEC\0j \0A\xE8\0j \f\x90 \0(d#   \0(l \0(h  \\! \b!! \0A\x90j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xF0k"\0$\0 \0B%7\xE8 \0A\xE8j"ArA\xD7 (\x91!\x07 \0 \0A\xC0j"\b6\xBC*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b   \0Aj]"AJ\r\f\v \0 90 \0A\xC0j  \0A\xE8j" \0A0j]"AL\r*! \0 9 \0A\xBCj   \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\xBCj  \0A\xE8j \0P\v"A\x7FF\r \0(\xBC\f\vA\0\v \0(\xBC"  j" G!
  6288. @ \0A\xC0j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $ 
  6289.  \0A\xCC\0j \0A\xC8\0j \v\x90 \0(D#   \0(L \0(H  \\! \x07!! \0A\xF0j$\0 \f\v0\0\v\v\xC7\x7F#\0A\xF0k"\0$\0A\bAA
  6290. ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! \0A\xD0j!@ A\x80qE Pr\r\0 \b@ \0A0:\0\xD0 Ar!\f\v \x07A\bG\r\0 \0A0:\0\xD0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0\xD1 \0A\xD0jAr!\v \0A\xC8j  \0A\xE8j  \x92 \0(\xC8!\x07@ A\x88\x80qA\x88\x80G\r\0@  \x07F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v \0A\xD0j" \x07 G! \0Aj"\b $   \x07 \0Aj" \0A\fj \0A\bj \b\x90 \0(#   \0(\f \0(\b  \\ \0A\xF0j$\0\v\r\0    \x91\v\xA8\x7F~#\0A\xF0k"$\0 A\xD0j!\0~ ("A\xCA\0q"\x07A\bF"\b B\0YrE@  \x07A\xC0\0F\r A-:\0\xD0 \0Ar!\0B\0 }\f\v \v!
  6291. \b \x07A\xC0\0F" r A\x80qE B\0SrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA
  6292. \b\x1B \x1B!\b@ A\x80qE Pr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xC8j \0 A\xE8j
  6293. \b\x92@ A\x88\x80qA\x88\x80F@@ \0 (\xC8"F\r \0 \0-\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (\xC8!\v A\xD0j"\0  G!\x07 Aj"\b $ \0 \x07  Aj"\0 A\fj A\bj \b\x90 (#  \0 (\f (\b  \\ A\xF0j$\0\v\xA5\x7F#\0A\x90k"$\0 A\x83j!\0\x7F ("A\xCA\0q"\x07A\bF"\b A\0NrE@  \x07A\xC0\0F\r A-:\0\x83 A\x84j!\0A\0 k\f\v \v! \b \x07A\xC0\0F"
  6294. r A\x80qE A\0HrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA
  6295. \b\x1B
  6296. \x1B!\b@ E A\x80qEr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xF8\0j \0 A\x90j \b\x94@ A\x88\x80qA\x88\x80F@@ \0 (x"F\r \0 \0-\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (x!\v A\x83j"\0  G! Aj"\x07 $ \0   Aj"\0 A\fj A\bj \x07\x90 (#  \0 (\f (\b  \\ A\x90j$\0\v\xDE\x7F#\0Ak"$\0  6\f@ -\0AqE@ \0     \0(\0( \0!\f\v  $ n!\0 (\0#  \0 \0(\0AA \x1Bj(\0\0 (\0"  ,\0\v"A\0H\x1B!@   \xC0A\0H"\0\x1B ( A\xFFq \0\x1BAtj F@ (\f!   A\fj (\0\xBE Aj! (\0! -\0\v!\f\v\v\v Aj$\0 \v+\x7F  ("A\xB5\xFB~qA\x88r6    \x94  6\v\xB7\x07\x7F\x7F#\0A\xE0k"\0$\0 \0B%7\xD8 \0A\xD8j"\x07ArA\x82 (\x91!\b \0 \0A\xB0j" 6\xAC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6  \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xB0j  \0A\xD8j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xACj  \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xACj  \0A\xD8j \0P\v"A\x7FF\r \0(\xAC\f\vA\0\v \0(\xAC"\x07  \x07j"
  6297. G!\v@ \0A\xB0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v
  6298.  \0A\xEC\0j \0A\xE8\0j \f\x93 \0(d#   \0(l \0(h  Z! \b!! \0A\xE0j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xC0k"\0$\0 \0B%7\xB8 \0A\xB8j"ArA\xD7 (\x91!\x07 \0 \0A\x90j"\b6\x8C*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b   \0Aj]"AJ\r\f\v \0 90 \0A\x90j  \0A\xB8j" \0A0j]"AL\r*! \0 9 \0A\x8Cj   \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\x8Cj  \0A\xB8j \0P\v"A\x7FF\r \0(\x8C\f\vA\0\v \0(\x8C"  j" G!
  6299. @ \0A\x90j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $ 
  6300.  \0A\xCC\0j \0A\xC8\0j \v\x93 \0(D#   \0(L \0(H  Z! \x07!! \0A\xC0j$\0 \f\v0\0\v\v\xC3\x7F#\0A\xF0\0k"\0$\0A\bAA
  6301. ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! \0A\xD0\0j!@ A\x80qE Pr\r\0 \b@ \0A0:\0P Ar!\f\v \x07A\bG\r\0 \0A0:\0P \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0Q \0A\xD0\0jAr!\v \0A\xC8\0j  \0A\xE8\0j  \x92 \0(H!\x07@ A\x88\x80qA\x88\x80G\r\0@  \x07F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v \0A\xD0\0j" \x07 G! \0Aj"\b $   \x07 \0Aj" \0A\fj \0A\bj \b\x93 \0(#   \0(\f \0(\b  Z \0A\xF0\0j$\0\v\r\0    \x94\v\xA5\x7F~#\0A\xF0\0k"$\0 A\xD0\0j!\0~ ("A\xCA\0q"\x07A\bF"\b B\0YrE@  \x07A\xC0\0F\r A-:\0P \0Ar!\0B\0 }\f\v \v!
  6302. \b \x07A\xC0\0F" r A\x80qE B\0SrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA
  6303. \b\x1B \x1B!\b@ A\x80qE Pr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xC8\0j \0 A\xE8\0j
  6304. \b\x92@ A\x88\x80qA\x88\x80F@@ \0 (H"F\r \0 \0-\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (H!\v A\xD0\0j"\0  G!\x07 Aj"\b $ \0 \x07  Aj"\0 A\fj A\bj \b\x93 (#  \0 (\f (\b  Z A\xF0\0j$\0\v\x9D\x7F#\0A@j"$\0 A3j!\0\x7F ("A\xCA\0q"\x07A\bF"\b A\0NrE@  \x07A\xC0\0F\r A-:\x003 A4j!\0A\0 k\f\v \v! \b \x07A\xC0\0F"
  6305. r A\x80qE A\0HrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA
  6306. \b\x1B
  6307. \x1B!\b@ E A\x80qEr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A(j \0 A@k \b\x94@ A\x88\x80qA\x88\x80F@@ \0 (("F\r \0 \0-\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v ((!\v A3j"\0  G! Aj"\x07 $ \0   Aj"\0 A\fj A\bj \x07\x93 (#  \0 (\f (\b  Z A@k$\0\v\xDB\x7F#\0Ak"$\0  6\f@ -\0AqE@ \0     \0(\0( \0!\f\v  $ p!\0 (\0#  \0 \0(\0AA \x1Bj(\0\0 (\0"  ,\0\v"A\0H\x1B!@   \xC0A\0H"\0\x1B ( A\xFFq \0\x1Bj F@ (\f!   A\fj ,\0\0\xC0 Aj! (\0! -\0\v!\f\v\v\v Aj$\0 \v\xED\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC \0A\x006\xD8 \0B\x007\xD0 \0Aj" $ ="A\xD0\x85A\xEA\x85 \0A\xE0j (\0(0\0 \0(# \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
  6308. " \0 \0(\xC0  \0,\0\xCBA\0H\x1B"6\xBC \0 6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xBC  \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
  6309. \0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0  \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\xCCCA  \0A\xBCj \0A\bjA\0 \0A\xD0j \0Aj \0A\fj \0A\xE0jm\r\0 \0(\xCCB\f\v\v \0A\xC0j" \0(\xBC k" \0(\xC0 \0,\0\xCB!*! \0 6\0  A\0H\x1B  \0\x98AG@ A6\0\v \0A\xCCj \0A\xC8j(@  (\0Ar6\0\v \0(\xCC \0A\xC0j  \0A\xD0j  \0A\xD0j$\0\v\xBD\x7F~\x7F#\0A\xF0k"\0$\0 \0 6\xE8 \0 6\xEC \0A\xDCj  \0A\xF0j \0A\xECj \0A\xE8j\xB3 \0A\x006\xD8 \0B\x007\xD0 \0A\xD0j"A
  6310. " \0 \0(\xD0  \0,\0\xDBA\0H\x1B"6\xCC \0 \0A j6 \0A\x006 \0A:\0 \0A\xC5\0:\0A\0!@@@@ \0A\xECj \0A\xE8j(\r\0 \0(\xCC  \0(\xD4 \0,\0\xDB" A\0H\x1B"jF@ \0A\xD0j" At" A
  6311. \0(\xD8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xDBA\0N\x1B" \0 \0(\xD0  \0,\0\xDBA\0H\x1B" j6\xCC\v \0(\xECC \0Aj \0Aj  \0A\xCCj \0(\xEC \0(\xE8 \0A\xDCj \0A j \0Aj \0Aj \0A\xF0j\xB2\r\0 \rA\0! \0(\xCC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
  6312. I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xE0 \0,\0\xE7" A\0H\x1BE\r\0 \0-\0AqE\r\0 \0(" \0A jkA\x9FJ\r\0 \0 Aj6  \0(6\0\v \0  \0(\xCC \x99 \0)\0!\b  \0)\b7\b  \b7\0 \0A\xDCj \0A j \0( 5 \0A\xECj \0A\xE8j(@  (\0Ar6\0\v \0(\xEC \0A\xD0j  \0A\xDCj  \0A\xF0j$\0\f\vA!\v \0(\xECB\f\0\v\0\v\v\xA6\x7F\x7F#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC \0A\xCCj  \0A\xE0j \0A\xDCj \0A\xD8j\xB3 \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
  6313. " \0 \0(\xC0  \0,\0\xCBA\0H\x1B"6\xBC \0 \0Aj6\f \0A\x006\b \0A:\0\x07 \0A\xC5\0:\0A\0!@@@@ \0A\xDCj \0A\xD8j(\r\0 \0(\xBC  \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
  6314. \0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0  \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\xDCC \0A\x07j \0Aj  \0A\xBCj \0(\xDC \0(\xD8 \0A\xCCj \0Aj \0A\fj \0A\bj \0A\xE0j\xB2\r\0 \rA\0! \0(\xBC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
  6315. I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xD0 \0,\0\xD7" A\0H\x1BE\r\0 \0-\0\x07AqE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xBC \x9A9\0 \0A\xCCj \0Aj \0(\f 5 \0A\xDCj \0A\xD8j(@  (\0Ar6\0\v \0(\xDC \0A\xC0j  \0A\xCCj  \0A\xE0j$\0\f\vA!\v \0(\xDCB\f\0\v\0\v\v\xA6\x7F\x7F#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC \0A\xCCj  \0A\xE0j \0A\xDCj \0A\xD8j\xB3 \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
  6316. " \0 \0(\xC0  \0,\0\xCBA\0H\x1B"6\xBC \0 \0Aj6\f \0A\x006\b \0A:\0\x07 \0A\xC5\0:\0A\0!@@@@ \0A\xDCj \0A\xD8j(\r\0 \0(\xBC  \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
  6317. \0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0  \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\xDCC \0A\x07j \0Aj  \0A\xBCj \0(\xDC \0(\xD8 \0A\xCCj \0Aj \0A\fj \0A\bj \0A\xE0j\xB2\r\0 \rA\0! \0(\xBC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
  6318. I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xD0 \0,\0\xD7" A\0H\x1BE\r\0 \0-\0\x07AqE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xBC \x9B8\0 \0A\xCCj \0Aj \0(\f 5 \0A\xDCj \0A\xD8j(@  (\0Ar6\0\v \0(\xDC \0A\xC0j  \0A\xCCj  \0A\xE0j$\0\f\vA!\v \0(\xDCB\f\0\v\0\v\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R!  \0A\xD0j~! \0A\xC4j  \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6319. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6320. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC   \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \x9C7\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@  (\0Ar6\0\v \0(\xCC \0A\xB8j  \0A\xC4j  \0A\xD0j$\0\v\x07\0 \0(\0\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R!  \0A\xD0j~! \0A\xC4j  \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6321. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6322. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC   \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \x9F;\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@  (\0Ar6\0\v \0(\xCC \0A\xB8j  \0A\xC4j  \0A\xD0j$\0\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R!  \0A\xD0j~! \0A\xC4j  \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6323. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6324. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC   \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \xA07\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@  (\0Ar6\0\v \0(\xCC \0A\xB8j  \0A\xC4j  \0A\xD0j$\0\v\xF1\x7F#\0A\xD0k"\0$\0 \0 6\xC8 \0 6\xCC R!  \0A\xD0j~! \0A\xC4j  \0A\xC4j} \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6325. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xCCj \0A\xC8j(\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6326. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC   \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \xA16\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@  (\0Ar6\0\v \0(\xCC \0A\xB8j  \0A\xC4j  \0A\xD0j$\0\v\x99\x8B.\x7F}|#\0Ak"$\0  6\f A\x006\b B\x007\0    j"  k\xC2#\0A\xE0\0k"%$\0 %A\bj! (\0"! ( k!#\0A\xC0k"$\0 A\x006\xA0 B\x007\x98 A\x006\xB0 B\x007\xA8 A\xB4j"A\x006\b B\x007\0 A\x80\xC0\0\xB6 A\x80\xC0\0\x96 A\fjA\0A0\xFC\v\0  6\b  6@\x7F Aj!\v\x7FAzA\x94-\0\0A1G\r\0A~ \vE\r \vA\x006 \v( "E@ \vA\x006( \vA/6 A/!\v \v($E@ \vA06$\vA| \v((AA\xD07 \0"E\r \v 6 A\x0068  \v6\0 A\xB4\xFE\x006A~!@ \vE\r\0 \v( E\r\0 \v($"E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0@@ (8"@ ((AG\r\v A6( A6\f\f\v \v((  \0 A\x0068 \v( A6( A6\fE\r\v \v($E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0A\0! A\x0064 B\x007, A\x006 \vA\x006\b \vB\x007 (\f"@ \v Aq60\v B\x007< A\x006$ A\x80\x806 B\x80\x80\x80\x80p7 B\xB4\xFE\x007 B\x81\x80\x80\x80p7\xC47  A\xB4
  6327. j"6p  6T  6P\vA\0 E\r\0 \v((  \v($\0 \vA\x006 \v\vE@ A\x006\xAC@@  (\0"6  ( k6A\0!\v#\0Ak"$\0A~!\x1B@ Aj"\rE\r\0 \r( E\r\0 \r($E\r\0 \r("\x07E\r\0 \x07(\0 \rG\r\0 \x07("A\xB4\xFE\0kAK\r\0 \r(\f"E\r\0 \r(\0"E@ \r(\r\v A\xBF\xFE\0F@ \x07A\xC0\xFE\x006A\xC0\xFE\0!\v \x07A\xDC\0j!- \x07A\xF2\0j!. \x07A\xF4j!" \x07A\xD8\0j!& \x07A\xF0\0j!# \x07A\xB4
  6328. j! \x07A\xF4\0j! \x07(@! \x07(<! \r("'! \r("!@@@@@@A}!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xB4\xFE\0k\x07
  6329. \r9:;<%&(\0*@BCD\v \x07(L! \f(\v \x07(L! \f%\v \x07(l! \f!\v \x07(\f!\f9\v AO\r E\r< A\bj! Aj! Ak! -\0\0 t j! AM\r ! ! !\f\v A O\r E\r; Aj! Ak! -\0\0 t j! AM\r\r ! !\f\v AO\r E\r: A\bj! Aj! Ak! -\0\0 t j! A\x07M\r ! ! !\f\v \x07(\f"
  6330. E\r@ AO\r\0 E\r: A\bj! Aj! Ak! -\0\0 t j! A\x07K@ ! ! !\f\v E@ !A\0! ! \v!\f<\v Ar! Ak! -\0 t j! Aj!\v
  6331. AqE A\x9F\x96GrE@ \x07((E@ \x07A6(\vA\0! \x07A\0A\0A\0D"6 A\x9F\x96;\f  A\fjAD! \x07A\xB5\xFE\x006 \x07 6A\0! \x07(!\f7\v \x07($"@ A\x7F60\v A\btA\x80\xFEq A\bvjApE
  6332. AqqE@ \rA\xD96 \x07A\xD1\xFE\x006 \x07(!\f7\v AqA\bG@ \rA\xBA6 \x07A\xD1\xFE\x006 \x07(!\f7\v Av"Aq" A\bj!
  6333. A\x07M \x07(("\x7F  \x07
  6334. 6(
  6335. \v
  6336. OqE@ Ak! \rA\xF46 \x07A\xD1\xFE\x006 ! \x07(!\f7\vA\0! \x07A\x006 \x07A\x80 t6 \x07A\0A\0A\0\x82"6 \r 60 \x07A\xBD\xFE\0A\xBF\xFE\0 A\x80\xC0\0q\x1B6A\0! \x07(!\f6\v E@ !A\0! ! \v!\f:\v Ar! Ak! -\0 t j! Aj!\v \x07 6 A\xFFqA\bG@ \rA\xBA6 \x07A\xD1\xFE\x006 \x07(!\f5\v A\x80\xC0q@ \rA\x90
  6337. 6 \x07A\xD1\xFE\x006 \x07(!\f5\v \x07($"@  A\bvAq6\0\v@ A\x80qE\r\0 \x07-\0\fAqE\r\0 A\b:\0\f  A\bv:\0\r \x07 \x07( A\fjAD6\v \x07A\xB6\xFE\x006A\0!A\0!\f\v AK\r\v E\r5 Aj! Ak! -\0\0 t j! AK@ ! !\f\v A\bj! E@ !A\0! ! \v!\f7\v Aj! Ak! -\0 t j! AK@ ! !\f\v Aj! E@ !A\0! ! \v!\f7\v Aj! Ak! -\0 t j! A\x07K@ ! !\f\v Aj! E@ !\f6\v Ak! -\0 t j! Aj!\v \x07($"@  6\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0  6\f \x07 \x07( A\fjAD6\v \x07A\xB7\xFE\x006A\0!A\0!\f\v AK\r\v E\r2 Aj! Ak! -\0\0 t j! A\x07K@ ! !\f\v A\bj! E@ !\f3\v Ak! -\0 t j! Aj!\v \x07($"@  A\bv6\f  A\xFFq6\b\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0  ;\f \x07 \x07( A\fjAD6\v \x07A\xB8\xFE\x006A\0!A\0!A\0! \x07("A\x80\bq\r\f'\v \x07("A\x80\bqE@ !\f'\v ! AK\r\v E@A\0! ! \v!\f1\v Aj! Ak!
  6338. -\0\0 t j! A\x07K@ !
  6339. !\f\v A\bj!
  6340. E@ !\f0\v Ak! -\0 t j! Aj!\v \x07 6D \x07($"@  6\vA\0!@ A\x80qE\r\0 \x07-\0\fAqE\r\0  ;\f \x07 \x07( A\fjAD6\vA\0!\f%\v A\bj! E@ !A\0! ! \v!\f/\v Aj! Ak! -\0 t j! AK@ ! !\f\v Aj! E@ !A\0! ! \v!\f/\v Aj! Ak! -\0 t j! A\x07K@ ! !\f\v Aj! E@ !\f.\v Ak! -\0 t j! Aj!\v \x07 AxA\xFF\x81\xFC\x07q A\xFF\x81\xFC\x07qA\bxr"6 \r 60 \x07A\xBE\xFE\x006A\0!A\0!\v \x07(E@ \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6<A!\x1B\f/\v \x07A\0A\0A\0\x82"6 \r 60 \x07A\xBF\xFE\x006\v\x7F@ \x07(\bE@  AK\r \r\f-\v \x07A\xCE\xFE\x006  A\x07qv! Axq! \x07(!\f)\v Ak! -\0\0 t j! Aj! A\br\v \x07 Aq6\bA\xC1\xFE\0!@@@@@ AvAqAk\0\v \x07A\x90\xDC\x006P \x07B\x89\x80\x80\x80\xD0\x007X \x07A\x90\xEC\x006T \x07A\xC7\xFE\x006\f\vA\xC4\xFE\0!\f\v \rA\x976A\xD1\xFE\0!\v \x07 6\vAk! Av! \x07(!\f'\v  A\x07qv!\x7F Axq"\b AK\r\0 E@A\0! \b! \v!\f,\v \bA\bj! Aj! Ak! -\0\0 \bt j! AK@ ! ! \f\v E@ !A\0! ! \v!\f,\v \bAj!
  6341. Aj! Ak! -\0 t j! AK@ ! !
  6342. \f\v E@ !A\0!
  6343. ! \v!\f,\v \bAj! Aj! Ak! -\0
  6344. t j! A\x07K@ ! ! \f\v E@ !A\0! ! \v!\f,\v Ak! -\0 t j! Aj!A \v! A\xFF\xFFq" A\x7FsAvG@ \rA\xC2\v6 \x07A\xD1\xFE\x006 \x07(!\f'\v \x07A\xC2\xFE\x006 \x07 6DA\0!A\0!\v \x07A\xC3\xFE\x006\v \x07(D"@    I\x1B"   I\x1B"E@ \v!\f*\v @   \xFC
  6345. \0\0\v \x07 \x07(D k6D  j!  k!  j!  k! \x07(!\f%\v \x07A\xBF\xFE\x006 \x07(!\f$\v E@ !A\0! ! \v!\f(\v Ar! Ak! -\0 t j! Aj!\v \x07 Aq"A\x81j6d \x07 AvAq"Aj6h \x07 A
  6346. vAqAj"
  6347. 6\` Ak! Av! AI AMqE@ \rA\x9E\v6 \x07A\xD1\xFE\x006 \x07(!\f#\v \x07A\xC5\xFE\x006A\0! \x07A\x006l\f\v \x07(l" \x07(\`"
  6348. I\r\f\v E\r\r  \x07(D:\0\0 \x07A\xC8\xFE\x006 Ak! Aj! \x07(!\f \v \x07(\f"E@A\0!\f\v@ AK@ ! \f\v E\r# A\bj! Aj! Ak!
  6349. -\0\0 t j! AK@
  6350. ! !\f\v
  6351. E@ !A\0! ! \v!\f%\v Aj!
  6352. Aj! Ak!\b -\0 t j! AK@ \b!
  6353. !\f\v \bE@ !A\0!
  6354. ! \v!\f%\v Aj! Aj! Ak!\b -\0
  6355. t j! A\x07K@ \b! !\f\v \bE@ !A\0! ! \v!\f%\v A r! Aj! Ak! -\0 t j!\v \r  k"
  6356. \r(j6 \x07 \x07(
  6357. j6 Aq"E  Fr\x7F  
  6358. k! \x07(! \x07\x7F \x07(@  
  6359. D\f\v  
  6360. \x82\v"6 \r 60 \x07(\f"Aq\vE\r \x07(  AxA\xFF\x81\xFC\x07q A\xFF\x81\xFC\x07qA\bxr \x07(\x1BF\r \rA\x876 \x07A\xD1\xFE\x006 ! ! \x07(!\f\v \x07A\xC0\xFE\x006\f\v !A\0!A\0! !\v \x07A\xCF\xFE\x006\f\x1B\v@ AM@ E\r Ak! -\0\0 t j! A\br! Aj!\v \x07 Aj"6l  At/\xE0[Atj A\x07q;\0 Ak! Av! "
  6361. G\r\0\v
  6362. !\v AM@A\0! "Aq"\vAG@@  At/\xE0[AtjA\0;\0 Aj! \v Aj" sAG\r\0\v\v AM@@  At"A\xE0\xDB\0j/\0AtjA\0;\0  A\xE2\xDB\0j/\0AtjA\0;\0  A\xE4\xDB\0j/\0AtjA\0;\0  A\xE6\xDB\0j/\0AtjA\0;\0 Aj"AG\r\0\v\v \x07A6l\v \x07A\x076X \x07 6P \x07 6pA\0! A\0 A # & "\xA2"\v@ \rA\xF7 6 \x07A\xD1\xFE\x006 \x07(!\f\x1B\v \x07A\xC6\xFE\x006 \x07A\x006lA\0!\v\v \x07(d" \x07(hj" K@A\x7F \x07(XtA\x7Fs! \x07(P!@ !\f ! !@@@@@@   q"Atj-\0"\b M@ !
  6363. \f\v@ E\r -\0\0 \ft!\b Aj! Ak! \fA\bj"
  6364. !\f
  6365.   \bj" q"Atj-\0"\bI\r\0\v\v  Atj/"AM@ \x07 Aj"6l  Atj ;\0
  6366. \bk!  \bv! ! \f\v\x7F\x7F@@@ Ak\0\v \bAj"
  6367. K@@ E\r Ak! -\0\0
  6368. t j! Aj!
  6369. A\bj"
  6370. I\r\0\v\v
  6371. \bk!  \bv!
  6372. E@ \rA\xCD
  6373. 6 \x07A\xD1\xFE\x006 ! !
  6374. ! \x07(!\f%\v Ak!
  6375. Av!
  6376. AqAj!\b . Atj/\0\f\v \bAj"
  6377. K@@ E\r Ak! -\0\0
  6378. t j! Aj!
  6379. A\bj"
  6380. I\r\0\v\v
  6381. \bkAk!  \bv"Av! A\x07qAj\f\v \bA\x07j"
  6382. K@@ E\r Ak! -\0\0
  6383. t j! Aj!
  6384. A\bj"
  6385. I\r\0\v\v
  6386. \bkA\x07k!  \bv"A\x07v! A\xFF\0qA\vj\v!\bA\0\v!\f \b j K\rA\0!
  6387. \bAq"E\r \b!@  Atj \f;\0 Aj! Ak!
  6388. Aj"
  6389. G\r\0\v\f\v  j!  Atj!\f"\v \b!\f\v \rA\xCD
  6390. 6 \x07A\xD1\xFE\x006 ! ! \x07(!\f\v \bAO@@  Atj" \f;\0  \f;  \f;  \f; Aj! Ak"\r\0\v\v \x07 6l\v ! ! I\r\0\v\v \x07/\xF4E@ \rA\xB46 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A 6X \x07 6P \x07 6pA   # & "\xA2"\v@ \rA\xDB 6 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A6\\ \x07 \x07(p6TA  \x07(dAtj \x07(h # - "\xA2"\v@ \rA\xA9
  6391. 6 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xC7\xFE\x006A\0!\v\v \x07A\xC8\xFE\x006\v AI A\x82IrE@ \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6< \r("(4"\bA\x07q!( \b j!/ \b (,"0j!1 \r(\f" \r("j"$A\x81k!)   kj! \r(\0" \r(jAk!*A\x7F (\\tA\x7Fs!A\x7F (XtA\x7Fs! (T!+ (P!, (@! (<!\f (8!
  6392. (0!@ AM\x7F -\0\0 t \fj -\0 A\bjtj!\f Aj! Ar \v , \f qAtj"-\0"k! \f v!\f@@@@@ \x7F \r\x7F@@ -\0\0"E@  -\0:\0\0 Aj!\f\b\v Aq@ /!\x7F Aq"E@ ! \f\f\v\x7F  M@ ! \f\v A\bj! -\0\0 t \fj!\f Aj\v!  k! \fA\x7F tA\x7Fsq j! \f v\v! AM@ -\0\0 t j -\0 A\bjtj! Ar! Aj!\v  +  qAtj"-\0" k!  v!\f -\0\0"Aq\r@ A\xC0\0qE@  + /Atj \fA\x7F tA\x7FsqAtj"-\0"k! \f v!\f -\0\0"AqE\r\f\v\v ! A\x93\f\v A\xC0\0qE@  , /Atj \fA\x7F tA\x7FsqAtj"-\0"k! \f v!\f\f\v\vA\xBF\xFE\0 A q\rA\xF7\f\v /!\x7F Aq" M@ ! \f\v -\0\0 t \fj!\f Aj  A\bj"M\r\0 -\0 t \fj!\f Aj! Aj\v! \fA\x7F tA\x7Fsq!  k! \f v!\f  j"!  k"M\r ! k" M\r (\xC47E\rA\xA6\v6A\xD1\xFE\0\v6\f\v@@ \bE@
  6393. 0 kj!  O@ !\f\vA\0! ! "A\x07q"@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v  $j jk jAxK\r@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\f\v  \bK@
  6394. 1 kj!  \bk" O@ !\f\vA\0! ! "A\x07q"@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v / $j jk jAxM@@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v \b  k"O@
  6395. !\f\vA\0! \b!
  6396. ! (@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" (G\r\0\v\v \bA\bO@@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v  !k!  \bk!\f\v
  6397. \b kj!  O@ !\f\vA\0! ! "A\x07q"@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v  $j jk jAxK\r\0@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v  !k!  k!\v@ AI\r\0A\0! Ak"AnAjAq"@@  -\0\0:\0\0  -\0:\0  -\0:\0 Ak! Aj! Aj! Aj" G\r\0\v\v A I\r\0@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07  -\0\b:\0\b  -\0 :\0  -\0
  6398. :\0
  6399.  -\0\v:\0\v A\fj! A\fj! A\fk"AK\r\0\v\v E@ !\f\v  -\0\0:\0\0 AF\r Aj!\f\v  !k!@ " "-\0\0:\0\0  -\0:\0  -\0:\0 Aj! Aj! Ak"AK\r\0\v E\r  -\0\0:\0 AG@ Aj!\f\v  -\0:\0 Aj!\f\v  -\0:\0 Aj!\v *O\r\0  )I\r\v\v \r 6\f \r Avk"6\0 \r ) kA\x81j6 \r * kAj6  A\x07q"6@  \fA\x7F tA\x7Fsq6< \x07(@! \x07(<! \r(! \r(\0! \r(! \r(\f! \x07(A\xBF\xFE\0G\r \x07A\x7F6\xC87 \x07(!\f\v \x07A\x006\xC87 ! ! !@ \x07(P" A\x7F \x07(XtA\x7Fs"qAtj"\b-\0"\f M@ !
  6400. \f\v@ E\r\r -\0\0 t!\b Aj! Ak! A\bj"
  6401. !
  6402.   \bj" qAtj"\b-\0"\fI\r\0\v\v \f! \b/!@ \b-\0\0"\bAkA\xFFqAK@A\0! ! !\f\v ! !@
  6403. "   Atj" A\x7F  \bjtA\x7Fs"q vAtj"-\0"\fjO@
  6404. !\b\f\v@ E\r\r -\0\0 t!\f Aj! Ak! A\bj"\b!    \fj" q vAtj"-\0"\fj \bK\r\0\v\v \b k!
  6405.  v! -\0\0!\b /!\v \x07 A\xFF\xFFq6D \x07  \fj6\xC87
  6406. \fk!  \fv! \bA\xFFq"E@ \x07A\xCD\xFE\x006 \x07(!\f\v A q@ \x07A\xBF\xFE\x006 \x07A\x7F6\xC87 \x07(!\f\v A\xC0\0q@ \rA\xF76 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xC9\xFE\x006 \x07 Aq" 6L\v !
  6407. !\b@ E@ \x07(D!\f\v ! !  I@@ E\r\v Ak! -\0\0 t j! Aj"! A\bj" I\r\0\v\v \x07 \x07(\xC87 j6\xC87 \x07 \x07(D A\x7F tA\x7Fsqj"6D  k!  v!\v \x07A\xCA\xFE\x006 \x07 6\xCC7\v ! ! !@ \x07(T" A\x7F \x07(\\tA\x7Fs"qAtj"\b-\0"\f M@ !
  6408. \f\v@ E\r\b -\0\0 t!\b Aj! Ak! A\bj"
  6409. !
  6410.   \bj" qAtj"\b-\0"\fI\r\0\v\v \b/! \x07\x7F \b-\0\0" AO@ ! ! \f!\b \x07(\xC87\f\v ! !@
  6411. " \f  Atj" A\x7F \fjtA\x7Fs"q \fvAtj"-\0"\bjO@ ! \f\v@ E\r\b -\0\0 t!\b Aj! Ak! A\bj" ! \f   \bj" q \fvAtj"-\0"\bj K\r\0\v\v \fk!
  6412.  \fv! -\0\0! /! \x07(\xC87 \fj\v \bj6\xC87
  6413. \bk!  \bv! A\xC0\0q@ \rA\x936 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xCB\xFE\x006 \x07 Aq" 6L \x07 A\xFF\xFFq6H\v !
  6414. !\b @ ! !  I@@ E\r Ak! -\0\0 t j! Aj"! A\bj" I\r\0\v\v \x07 \x07(\xC87 j6\xC87 \x07 \x07(H A\x7F tA\x7Fsqj6H  v!  k!\v \x07A\xCC\xFE\x006\v \r\vA\0! \v!\f\v\x7F \x07(H"  k"K@@  k" \x07(0M\r\0 \x07(\xC47E\r\0 \rA\xA66 \x07A\xD1\xFE\x006 \x07(!\f\v\x7F \x07(4" I@ \x07(8 \x07(,  k"kj\f\v \x07(8  kj\v!  \x07(D"  I\x1B\f\v  k! \x07(D" \v! \x07    I\x1B"
  6415. k6D
  6416. Ak!\fA\0!
  6417. A\x07q"\bE\r
  6418. !@  -\0\0:\0\0 Ak! Aj! Aj! Aj" \bG\r\0\v\f\x07\v \b
  6419. j!  \bAtj!\f\v  j!
  6420. Atj!\f\v  j!  Atj!\f\v \b
  6421. j!  \bAtj!\f\v  j!
  6422. Atj!\f\v  j!  Atj!\f\v
  6423. !\v \fA\x07O@@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v 
  6424. k! \x07(D\r\0 \x07A\xC8\xFE\x006 \x07(!\f \v \x07(!\f\b\vA\0! !
  6425. ! \v!\f\v\v \x07($"@ A\x006\v !\v \x07A\xB9\xFE\x006\v@ \x07(" A\x80\bqE\r\0 \x07(D"   K\x1B"\f@@ \x07($"\bE\r\0 \b("
  6426. E\r\0 \b(" \b( k"M\r\0  k \f  \fj K\x1B"@ 
  6427. j  \xFC
  6428. \0\0\v \x07(! \v@ A\x80qE\r\0 \x07-\0\fAqE\r\0 \x07 \x07(  \fD6\v \x07 \x07(D \fk"6D  \fk!  \fj!\v E\r\0 \v!\f \v \x07A\xBA\xFE\x006 \x07A\x006D\v@ \x07-\0A\bq@A\0! E\r\b@  j-\0\0!\b@ \x07($"
  6429. E\r\0
  6430. ("E\r\0 \x07(D"
  6431. ( O\r\0 \x07 Aj6D  j \b:\0\0\v \bA\0  Aj"K\x1B\r\0\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 \x07 \x07(  D6\v  j!  k! \bE\r \v!\f \v \x07($"E\r\0 A\x006\v \x07A\xBB\xFE\x006 \x07A\x006D\v@ \x07-\0Aq@A\0! E\r\x07@  j-\0\0!\b@ \x07($"
  6432. E\r\0
  6433. ($"E\r\0 \x07(D"
  6434. ((O\r\0 \x07 Aj6D  j \b:\0\0\v \bA\0  Aj"K\x1B\r\0\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 \x07 \x07(  D6\v  j!  k! \bE\r \v!\f\b\v \x07($"E\r\0 A\x006$\v \x07A\xBC\xFE\x006\v \x07("
  6435. A\x80q@@ AK@ !\f\v E\r A\bj! Aj! Ak! -\0\0 t j! A\x07K@ ! !\f\v E@ !A\0! ! \v!\f\b\v Ar! Aj! Ak! -\0 t j!\v@ \x07-\0\fAqE\r\0  \x07/F\r\0 \rA\xCB6 \x07A\xD1\xFE\x006 ! \x07(!\f\vA\0!A\0! !\v \x07($"@ A60 
  6436. A vAq6,\v \x07A\0A\0A\0D"6 \r 60 \x07A\xBF\xFE\x006 \x07(!\f\v E\r \x07(E\r@ AK@ !\f\v E\r A\bj! Aj! Ak!
  6437. -\0\0 t j! AK@
  6438. ! !\f\v
  6439. E@ !A\0! ! \v!\f\v Aj!
  6440. Aj! Ak!\b -\0 t j! AK@ \b!
  6441. !\f\v \bE@ !A\0!
  6442. ! \v!\f\v Aj! Aj! Ak!\b -\0
  6443. t j! A\x07K@ \b! !\f\v \bE@ !A\0! ! \v!\f\v A r! Aj! Ak! -\0 t j!\v@ AqE\r\0  \x07( F\r\0 \rA\xF06 \x07A\xD1\xFE\x006 ! \x07(!\f\v\v !A\0!A\0!\v \x07A\xD0\xFE\x006\vA!\f\vA\0! \v!\v \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6<@@ \x07(,E@  F\r \x07(A\xD0\xFE\0K\r\v\x7F  k! @@ \r("
  6444. (8"\vE@A!
  6445. \r((A
  6446. ((tA \r( \0"\v68 \vE\r\v
  6447. (,"E@
  6448. B\x0070
  6449. A
  6450. ((t"6,\v  M@ @ \v  k \xFC
  6451. \0\0\v
  6452. A\x0064\f\v 
  6453. (4"k"  I\x1B"@  \vj  k \xFC
  6454. \0\0\v  I@ k"@
  6455. (8  k \xFC
  6456. \0\0\v
  6457. 64\f\vA\0!
  6458. (4 j"A\0 
  6459. (,"G\x1B64 
  6460. (0"M\r\0
  6461.  j60\v \f\v
  6462. (,60A\0\v\r \r(! \r(!\v \r \r(\b ' kj6\b \r  k" \r(j6 \x07 \x07( j6 \x07-\0\fAqE  FrE@ \r(\f k! \x07(! \x07\x7F \x07(@   D\f\v   \x82\v"6 \r 60\v \r \x07(@A\xC0\0A\0 \x07(\b\x1BjA\x80A\0 \x07("A\xBF\xFE\0F\x1BjA\x80A\x80A\0 A\xC2\xFE\0F\x1B A\xC7\xFE\0F\x1Bj6, A{ \x1B   F\x1B   'F\x1B!\x1B\f\v \x07A\xD2\xFE\x006\vA|!\x1B\v Aj$\0 \x1BAK\r A\xA8j!
  6463. (\xAC!\b (\0! ( (k!#\0A k"$\0@  k" A\0L\r\0
  6464. (\b
  6465. ("\vk N@ \v \bk" H@   j"k"E  FrE@ \v  \xFC
  6466. \0\0\v
  6467.  \vj6 A\0L\r
  6468. \b \v \b j\xD1  \bj!@  \bF\r \b -\0\0:\0\0 Aj! \bAj!\b\f\0\v\0\v
  6469. \b \v \b j"\xD1@  \bF\r \b -\0\0:\0\0 Aj! \bAj!\b\f\0\v\0\v A\fj
  6470. (\0k \vj\x83 \b
  6471. (\0k
  6472. \x8C"\v(\b"j!@  G@  -\0\0:\0\0 Aj! Aj!\f\v\v \v 6\b \v(
  6473. ( \bk"@ \v(\b \b \xFC
  6474. \0\0\v \v \v(\b
  6475. ( \bkj6\b
  6476. \b6 \v(
  6477. (\0" \bkj! \b k"@   \xFC
  6478. \0\0\v \v 6
  6479. (\0"6
  6480. \v(6\0 \v 6
  6481. (!
  6482. \v(\b6 \v 6\b
  6483. (\b!
  6484. \v(\f6\b \v 6\f \v \v(6\0 \v\x87\v A j$\0 \x1BAG\r\0\v \r\xCB 1 A\x98j" (\xA8" (\xAC k\xE0
  6485. 1 \rA\x006\\ \rA\xF8\xF9\x006@ \rA\xD0\xF9\x006\0 \rA\xE4\xF9\x006\b \rA\x88\xFA\0(\0"6\0 \r A\fk(\0jA\x8C\xFA\0(\x006\0 \rA\x006 \r \r(\0A\fk(\0j"A\x006  \rA\fj""6 A\x006\f B\x82\xA0\x80\x80\xE0\x007  E6 A jA\0A(\xFC\v\0 Aj\xF4 A\0:\0P B\x80\x80\x80\x80p7H \rA\x90\xFA\0(\0"6\b A\fk(\0 \rA\bjjA\x94\xFA\0(\x006\0 \rA\x84\xFA\0(\0"6\0 \r A\fk(\0jA\x98\xFA\0(\x006\0 \rA\x9C\xFA\0(\x006\b \r"A\xD0\xF9\x006\0 A\xE4\xF9\x006\b A\xF8\xF9\x006@ A\xA8\xF5\x006\0 Aj\xF4 B\x007 B\x007 B\x007\b B\x007 A\xE8\xF5\x006\0 B\x007( A60  A j"\vG@@ ,\0\v! \v,\0\vA\0H@ (\0  A\0H"\x1B!@ (  \x1B" \v(\bA\xFF\xFF\xFF\xFF\x07q"I@ \v 6 \v(\0! @   \xFC
  6486. \0\0\v  jA\0:\0\0\f\v \v Ak  kAj \v("A\0   \x89\v\f\v A\0H@ (\0!@ ("A
  6487. M@ \v :\0\v @ \v  \xFC
  6488. \0\0\v  \vjA\0:\0\0\f\v \vA
  6489. A
  6490. k \v-\0\vA\xFF\0q"A\0   \x89\v\f\v \v (\b6\b \v )\x007\0\v\v A\x006, ( A j" ,\0+"A\0H"\x1B!
  6491. ($  \x1B! (0"A\bq@ 
  6492. 6\f 
  6493. 6\b 
  6494. j"6  6,\v@ AqE\r\0 
  6495. j6, A
  6496. ((A\xFF\xFF\xFF\xFF\x07qAk A\0N\x1B" 
  6497. 6 
  6498. 6 
  6499. ($ ,\0+" A\0H\x1Bj6 -\x000AqE\r\0@ A\0H@ 
  6500. A\xFF\xFF\xFF\xFF\x07j"
  6501. 6 A\xFF\xFF\xFF\xFF\x07k! \f\v\v E\r\0 
  6502. j6\v#\0A\xC0k"\b$\0 \bB\x007\xB8 \bB\xCE\x8E\xCD\x8257\xB0  \bA\xB0jAf@@  (\0A\fk(\0j-\0AqE@ \b(\xB0A\xCE\x8E\xCD\x82F\r\vA\xD5\xBF B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b(\xB4AkA|M@A\xD9 \bA\xB4j\xC7 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b(\xB8"A\x81\xAD\xE2O@A\xDB \bA\xB8j\xC7 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b-\0\xBC"AO@ \b 6\0A\x97 \ba\`A\xB0\xF1\0(\0L B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \xCD! \b(\xB4! \bA:\0e \bA\xE8\0j"
  6503. A\0A\xC8\0\xFC\v\0 \b 6X \b \b-\0\xBC6\\ \b \b-\0\xBD6\` \b \b-\0\xBEAq:\0d
  6504. Al"AA AF\x1Blz \bA\xF4\0j"\v z \b AK":\0e \bA\x80j"AA \x1B lz \bA\x8Cj" z \bA\x98j" z \bA\xA4j"  lz  \b(h \bA\xCC\0j
  6505. u" ( (\0kf 1  \b(\x8C \bA@k u"( (\0kf 1  \b(\x98 \bA4j u"( (\0kf 1  \b(t \bA(j \vu"( (\0kf 1  \b(\x80 \bAj u"( (\0kf 1  \b(\xA4 \bAj u"( (\0kf 1@  (\0A\fk(\0j-\0Aq@A\xB6\f\xBF B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v  \bA\xD8\0j")7  )\x007\0 Aj Ajt Aj Ajt A(j A(jt A4j A4jt A@k A@kt A\xCC\0j A\xCC\0jt\v \bA\xD8\0j\xCC\v \bA\xC0j$\0 \x81\f\v Aj\xCB\v 1 A\xA8j1 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\v A\x98j  A\xC0j$\0#\0A\x90k"\b$\0 (\0! (\xCD!@@@ ( (k"\v Al"
  6506. AA \v (\0"Al"F\x1BlG@ \bA\xA568 \bA\xF8\x0064 \bA\x9F60A\xED\v \bA0ja\`A\xB0\xF1\0(\0L\f\v
  6507. ( (kG@ \bA\xF9\x006< \bA<jA\xF5\xD0\f\v (, ((kAA -\0\r"Aq\x1B lG@ \bA\xCD6( \bA\xFA\x006$ \bA\x9F6 A\xED\v \bA ja\`A\xB0\xF1\0(\0L\f\v (8 (4kG@ \bA\x9E6 \bA\xFB\x006 \bA\x9F6A\xED\v \bAja\`A\xB0\xF1\0(\0L\f\v
  6508. (D (@kG@ \bA\xFC\x006< \bA<jA\xCB\xD0\f\v (P (Lk" 
  6509. lF\r \bA\x9F6\b \bA\xFD\x006 \bA\x9F6\0A\xED\v \ba\`A\xB0\xF1\0(\0L\v \0A\0:\0\b \0B\x007\0 \0A\fjA\0A\xC8\0\xFC\v\0\f\v \0A\fj"A\0A\xC8\0\xFC\v\0 \0 6\0 \0 (6 \0 -\0\f:\0\b 
  6510. w \0Aj
  6511. w \0A$j Atw \0A0j w \0A<j
  6512. w \0A\xC8\0j w@  \vF@ (\0! (!A\0!\f@
  6513. \fF\r  \fAtj}C\0\0\x80?C\0\0\x80\xBF  \fAtj/\0"\xC1A\0N\x1B!2 A\xFF\x07q!@ A
  6514. vAq"AG@ \r 2C\0\0\x808\x94 \xB3\x94C\0\0\x80:\x94\f\vC\0\0\xC0\x7F 2C\0\0\x80\x7F\x94 \x1B\f\vC\0\0\x80?!3@ Ak"A\x80N@C\0\0\0\x7F!3 A\xFFI@ A\xFF\0k!\f\vC\0\0\x80\x7F!3A\xFD  A\xFDO\x1BA\xFEk!\f\v A\x81\x7FJ\r\0C\0\0\x80\f!3 A\x9B~K@ A\xE6\0j!\f\vC\0\0\0\0!3A\xB6}  A\xB6}M\x1BA\xCCj!\v \xB3C\0\0\x80:\x94C\0\0\x80?\x92 2 3 AtA\x80\x80\x80\xFCj\xBE\x94\x94\x94\v8\0 \fAj!\f\f\0\v\0\vD\0\0\0\0\0\0\xF0?A (\bt\xB7\xA3\xB6!2 (\0! (!A\0!\f@
  6515. \fF\r  \fAtj 2  \fAlj"/\0\0 ,\0"A\xFFqAtrA\x80\x80\x80xA\0 A\0H\x1Br\xB2\x948\0 \fAj!\f\f\0\v\0\v \0(! (!A\0!\f@
  6516. \fF@ \bA\xD4\0j!\vA\0!\f Aq!\x7F \fF\x7F \0(0! (4!A\0@ @ \0($ ((! \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7L \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7D \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7< \vA\xD8A<\xFC
  6517. \0\0 \fAtj! \bA<j!C\0\0\0\0!3  \fAtj"/\0\0 -\0Atr -\0"Atr! Av!A!\x7F A\0H\x7F  AtjC\0\0\x80? 3\x93\x918\0 A\fj!A\0  G@  Atj A\xFFq\xB3C\xF35?\x94C\0\x80\xFFC\x95"2\x8C 2 A\x80q\x1B"28\0 2 2\x94 3\x92!3 A
  6518. v!\v Ak!\f\v\v!@ AG@  At"j"  j*\0 *\0\x948\0 Aj!\f\v\v\f\v \0($ (( \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7L \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7D \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7< \vA\xD8A<\xFC
  6519. \0\0#\0Ak"$\0 \fAlj"-\0! -\0!  -\0\0\xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*H\x948  \xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*L\x948\b  \xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*P\x94"28\f \fAtj" 28\b  )7\0 C\0\0\x80? *\f *\f\x94 * *\x94 *\b *\b\x94\x92\x92\x93"2C\0\0\0\0 2C\0\0\0\0^\x1B\x918\f Aj$\0\v \fAj!\f\f\v\v!\f@ \fG@  \fAtj}C\0\0\0\0  \fj-\0\0\xB3C\0\0\x7FC\x95"2C\0\0\x80? 2\x93\x95"3\xBC"A\x80\x80\x80\xFCF\r\0@ A\x80\x80\x80\xFC\x07kA\xFF\xFF\xFF\x87xM@ At"E@#\0Ak"C\0\0\x80\xBF8\f *\fC\0\0\0\0\x95\f\v A\x80\x80\x80\xFC\x07F\r A\x80\x80\x80xI A\0NqE@ 3 3\x93"2 2\x95\f\v 3C\0\0\0K\x94\xBCA\x80\x80\x80\xDC\0k!\vA\x98\xF1\0+\0  A\x80\x80\xCC\xF9k"A\x80\x80\x80|qk\xBE\xBB AvA\xF0q"+\x90o\xA2D\0\0\0\0\0\0\xF0\xBF\xA0"7 7\xA2"8\xA2A\xA0\xF1\0+\0 7\xA2A\xA8\xF1\0+\0\xA0\xA0 8\xA2 Au\xB7A\x90\xF1\0+\0\xA2 +\x98o\xA0 7\xA0\xA0\xB6!3\v 3\v8\0 \fAj!\f\f\v\v \0(<! (@!A\0!\f@
  6520. \fF@ (P (L"k! \0(H!A\0!@  F@ (\f!A\0!#\0A\xE0\0k"\v$\0#\0Ak"$\0A!\x7FA!A A\0L\r\0 AkAs"A\x7FsAq! AqE! AqE\v!  :\0  :\0  :\0\r -\0! -\0! -\0\r! \vA\x80\x80\x80\xFC6@ \vA\x80\x80\x80\xFC68 \vC\0\0\x80?C\0\0\x80\xBF \x1B"68\\ \vC\0\0\x80?C\0\0\x80\xBF \x1B"58X \v 68T \v 58P \vC\0\0\x80?C\0\0\x80\xBF \x1B"48L \v 48D \v 68, \v 58( \v 48$ \v 58 \v 48 \v 68\f \v 6 5\x94"38< \v 4 5\x94"284 \v 6 4\x94"480 \v 48 \v 38 \v 28 \v 4 5\x948H Aj$\0 \0( \0(\f"kAu!@  M@ \0(( \0($"kAu!A\0!@  M@@ \0(L \0(H"kAuAn" \0(\0n! \vA$j!\0A\0!A\0!@A\0!\f  M\r@  \fM@  j!\f  Atj" \0 \fAtj*\0"2 *\0\x948\0  2 *\x948  2 *\b\x948\b Aj! \fAj!\f\f\v\0\v\0\v\0\v  Atj" \v* *\0\x948\0  \v* *\x948  \v* *\b\x948\b Aj!\f\v\v \vA\xE0\0j$\0  Atj" \v*\f *\0\x948\0  \v* *\x948  \v* *\b\x948\b Aj!\f\v\v  Atj  j-\0\0\xB3C\0\0\0\xC3\x92C\0\0\0<\x948\0 Aj!\f\v\v  \fAtj  \fj-\0\0\xB3C\0\0\x7FC\x95C\0\0\0\xBF\x92C\x9A\x99>\x958\0 \fAj!\f\f\v\v  \fAtj  \fj-\0\0\xB3C\0\0\x80=\x94C\0\0 \xC1\x928\0 \fAj!\f\f\v\v\v \bA\x90j$\0 \xCC %A\xE0\0j$\0 1 Aj$\0\v\x81\x7F#\0A k"$\0  6@ -\0AqE@ A\x7F6\0 \0      \0(\0(\0!@@@ (\0\0\v A\0:\0\0\f\v A:\0\0\f\v A:\0\0 A6\0\f\v  $ =! (\0#  $ n!\0 (\0#  \0 \0(\0(\0 A\fr \0 \0(\0(\0  Aj   Aj"  A\x95 F:\0\0 (!@ A\fk " G\r\0\v\v A j$\0 \v\xEE\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\x006\xD8 \0B\x007\xD0 \0Aj" $ >"A\xD0\x85A\xEA\x85 \0A\xE0j (\0( \0 \0(# \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
  6521. " \0 \0(\xC0  \0,\0\xCBA\0H\x1B"6\xBC \0 6\f \0A\x006\b@@ \0A\x8Cj \0A\x88j)\r\0 \0(\xBC  \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
  6522. \0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0  \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\x8CA\xC0A  \0A\xBCj \0A\bjA\0 \0A\xD0j \0Aj \0A\fj \0A\xE0jo\r\0 \0(\x8C@\f\v\v \0A\xC0j" \0(\xBC k" \0(\xC0 \0,\0\xCB!*! \0 6\0  A\0H\x1B  \0\x98AG@ A6\0\v \0A\x8Cj \0A\x88j)@  (\0Ar6\0\v \0(\x8C \0A\xC0j  \0A\xD0j  \0A\x90j$\0\v\xBE\x7F~\x7F#\0A\xA0k"\0$\0 \0 6\x98 \0 6\x9C \0A\xE0j  \0A\xF0j \0A\xEFj \0A\xEEj\xB7 \0A\x006\xD8 \0B\x007\xD0 \0A\xD0j"A
  6523. " \0 \0(\xD0  \0,\0\xDBA\0H\x1B"6\xCC \0 \0A j6 \0A\x006 \0A:\0 \0A\xC5\0:\0A\0!@@@@ \0A\x9Cj \0A\x98j)\r\0 \0(\xCC  \0(\xD4 \0,\0\xDB" A\0H\x1B"jF@ \0A\xD0j" At" A
  6524. \0(\xD8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xDBA\0N\x1B" \0 \0(\xD0  \0,\0\xDBA\0H\x1B" j6\xCC\v \0(\x9CA\xC0 \0Aj \0Aj  \0A\xCCj \0,\0\xEF \0,\0\xEE \0A\xE0j \0A j \0Aj \0Aj \0A\xF0j\xB6\r\0 \rA\0! \0(\xCC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
  6525. I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xE4 \0,\0\xEB" A\0H\x1BE\r\0 \0-\0AqE\r\0 \0(" \0A jkA\x9FJ\r\0 \0 Aj6  \0(6\0\v \0  \0(\xCC \x99 \0)\0!\b  \0)\b7\b  \b7\0 \0A\xE0j \0A j \0( 5 \0A\x9Cj \0A\x98j)@  (\0Ar6\0\v \0(\x9C \0A\xD0j  \0A\xE0j  \0A\xA0j$\0\f\vA!\v \0(\x9C@\f\0\v\0\v\v\xA7\x7F\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\xD0j  \0A\xE0j \0A\xDFj \0A\xDEj\xB7 \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
  6526. " \0 \0(\xC0  \0,\0\xCBA\0H\x1B"6\xBC \0 \0Aj6\f \0A\x006\b \0A:\0\x07 \0A\xC5\0:\0A\0!@@@@ \0A\x8Cj \0A\x88j)\r\0 \0(\xBC  \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
  6527. \0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0  \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\x8CA\xC0 \0A\x07j \0Aj  \0A\xBCj \0,\0\xDF \0,\0\xDE \0A\xD0j \0Aj \0A\fj \0A\bj \0A\xE0j\xB6\r\0 \rA\0! \0(\xBC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
  6528. I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xD4 \0,\0\xDB" A\0H\x1BE\r\0 \0-\0\x07AqE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xBC \x9A9\0 \0A\xD0j \0Aj \0(\f 5 \0A\x8Cj \0A\x88j)@  (\0Ar6\0\v \0(\x8C \0A\xC0j  \0A\xD0j  \0A\x90j$\0\f\vA!\v \0(\x8C@\f\0\v\0\v\v\xA7\x7F\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\xD0j  \0A\xE0j \0A\xDFj \0A\xDEj\xB7 \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A
  6529. " \0 \0(\xC0  \0,\0\xCBA\0H\x1B"6\xBC \0 \0Aj6\f \0A\x006\b \0A:\0\x07 \0A\xC5\0:\0A\0!@@@@ \0A\x8Cj \0A\x88j)\r\0 \0(\xBC  \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A
  6530. \0(\xC8A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xCBA\0N\x1B" \0 \0(\xC0  \0,\0\xCBA\0H\x1B" j6\xBC\v \0(\x8CA\xC0 \0A\x07j \0Aj  \0A\xBCj \0,\0\xDF \0,\0\xDE \0A\xD0j \0Aj \0A\fj \0A\bj \0A\xE0j\xB6\r\0 \rA\0! \0(\xBC k"A\0L\r@@ -\0\0"A+k"\x07\0\0\v A.F\rA! A0kA\xFFqA
  6531. I\r\f\v AF\r@ \x07\0\0\v -\0"A.F\rA! A0kA\xFFqA M\r\v@ \0(\xD4 \0,\0\xDB" A\0H\x1BE\r\0 \0-\0\x07AqE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xBC \x9B8\0 \0A\xD0j \0Aj \0(\f 5 \0A\x8Cj \0A\x88j)@  (\0Ar6\0\v \0(\x8C \0A\xC0j  \0A\xD0j  \0A\x90j$\0\f\vA!\v \0(\x8C@\f\0\v\0\v\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j  \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6532. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6533. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0   \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \x9C7\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@  (\0Ar6\0\v \0(\xDC \0A\xB8j  \0A\xC8j  \0A\xE0j$\0\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j  \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6534. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6535. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0   \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \x9F;\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@  (\0Ar6\0\v \0(\xDC \0A\xB8j  \0A\xC8j  \0A\xE0j$\0\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j  \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6536. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6537. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0   \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \xA07\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@  (\0Ar6\0\v \0(\xDC \0A\xB8j  \0A\xC8j  \0A\xE0j$\0\v\xE6\0#\0A\xE0k"\0$\0 \0 6\xD8 \0 6\xDC R! \0A\xC8j  \0A\xD7j\x7F \0A\x006\xC0 \0B\x007\xB8 \0A\xB8j"A
  6538. " \0 \0(\xB8  \0,\0\xC3A\0H\x1B"6\xB4 \0 \0Aj6\f \0A\x006\b@@ \0A\xDCj \0A\xD8j)\r\0 \0(\xB4  \0(\xBC \0,\0\xC3" A\0H\x1B"jF@ \0A\xB8j" At" A
  6539. \0(\xC0A\xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xDCA\xC0   \0A\xB4j \0A\bj \0,\0\xD7 \0A\xC8j \0Aj \0A\fjA\xD0\x85o\r\0 \0(\xDC@\f\v\v@ \0(\xCC \0,\0\xD3" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \xA16\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@  (\0Ar6\0\v \0(\xDC \0A\xB8j  \0A\xC8j  \0A\xE0j$\0\v\x81\x7F#\0A k"$\0  6@ -\0AqE@ A\x7F6\0 \0      \0(\0(\0!@@@ (\0\0\v A\0:\0\0\f\v A:\0\0\f\v A:\0\0 A6\0\f\v  $ >! (\0#  $ p!\0 (\0#  \0 \0(\0(\0 A\fr \0 \0(\0(\0  Aj   Aj"  A\x97 F:\0\0 (!@ A\fk " G\r\0\v\v A j$\0 \v@\x7FA\0!\0\x7F  F\x7F \0 (\0 \0Atj"\0A\x80\x80\x80\x80\x7Fq"Av r \0s!\0 Aj!\f\v\v\v\v\0 \0  \xA2\vT\x7F@@  G@A\x7F!\0  F\r (\0" (\0"H\r  J@A Aj! Aj!\f\v\0\v\v  G!\0\v \0\v@\x7FA\0!\0\x7F  F\x7F \0 ,\0\0 \0Atj"\0A\x80\x80\x80\x80\x7Fq"Av r \0s!\0 Aj!\f\v\v\v\v\0 \0  \xCE\v^\x7F   kj!@@  G@A\x7F!\0  F\r ,\0\0" ,\0\0"\x07H\r  \x07J@A Aj! Aj!\f\v\0\v\v  G!\0\v \0\vT\x7F  \0(T" A\0 A\x80j"\xCA" k  \x1B"   K\x1B"Y \0  j"6T \0 6\b \0  j6 \v\xA8\x7F \0(T"(\0! (" \0( \0("\x07k"  I\x1B"@  \x07 Y  (\0 j"6\0  ( k"6\v    K\x1B"@   Y  (\0 j"6\0  ( k6\v A\0:\0\0 \0 \0(,"6 \0 6 \v\b\0 \0K!\v\0 \0 \0(\0A\fk(\0j\xC0\v\0 \0 \0(\0A\fk(\0j\x81\v
  6540. \0 \0A\bk\xC0\v
  6541. \0 \0A\bk\x81\v\0 \0  )\bA\0  (\0(\0\v \0 \0\xB0!\v\x95\x7F~ (," ("I@  6, !\vB\x7F!
  6542. @ Aq"\x07E AF \x07AFqr\r\0 @  ( A j ,\0+A\0H\x1Bk\xAC! \v@@@ \0\v A\bq@ (\f (\bk\xAC!\b\f\v  (k\xAC!\b\f\v !\b\v  \b|"B\0S  Ur\r\0 A\bq!@ P\r\0 @ (\fE\r\v AqE\r\0 E\r\v @  6  (\b \xA7j6\f\v Aq@  ( \xA7j6\v !
  6543. \v \0
  6544. 7\b \0B\x007\0\v\x99\b\x7F A\x7FF@A\0\v \0(\b! \0(\f! \0\x7F \0(" \0(G@ \0(,\f\v \0-\x000AqE@A\x7F\v \0(,!\x07 \0(! \0A j"A\0\xAA A
  6545. \0((A\xFF\xFF\xFF\xFF\x07qAk \0,\0+A\0N\x1B" \0 \0(  \0,\0+"\bA\0H" \x1B"6 \0  \0($ \b \x1Bj6 \0   kj"6  \x07 kj\v" Aj"  I\x1B"6, \0-\x000A\bq@ \0 6 \0 \0( \0A j \0,\0+A\0H\x1B"6\b \0   kj6\f\v \0 \xC0\xC3\v\x8E\x7F \0(," \0("I@ \0 6, !\v\x7FA\x7F \0(\f" \0(\bM\r\0 A\x7FF@ \0 6 \0 Ak6\fA\0\v \0-\x000AqE@A\x7F Ak-\0\0 A\xFFqG\r\v \0 6 \0 Ak"\x006\f \0 :\0\0 \v\v_\x7F \0(," \0("I@ \0 6, !\vA\x7F!@ \0-\x000A\bqE\r\0  \0("K\x7F \0 6  \v \0(\f"\0M\r\0 \0-\0\0!\v \v\0 \0 \0(\0A\fk(\0j\xC1\v
  6546. \0 \0A\bk\xC1\v \0 \0A\f\xA5\v\0 \0AjK \0A\bk\v\f\0 \0A\fjK \0\v\0 \0 \0(\0A\fk(\0j\xC1\v \0 \0A\xA5\v\f\0 \0AjK \0\v\0 \0 \0(\0A\fk(\0j\xC5\v \0 \0A\b\xA5\v\f\0 \0A\bjK \0\v\x96\x7F@@  L\r\0 \0(" \0("O@ \0 -\0\0 \0(\0(4\0A\x7FF\r Aj! Aj!\f \0  k"  k"  J\x1B"\x7F @   \xFC
  6547. \0\0\v \0( \v j6  j!  j!\f\v\0\v\v \v3\x7FA\x7F! \0 \0(\0($\0\0A\x7FG@ \0(\f"-\0\0! \0 Aj6\f\v \v\0A\x7F\v\x91\x7F@@  L\r\0@ \0(\f" \0("I@ \0  k"  k"  J\x1B"\x7F @   \xFC
  6548. \0\0\v \0(\f \v j6\f\f\v \0 \0(\0((\0\0"A\x7FF\r  :\0\0A!\v  j!  j!\f\v\v \v\0 \0B\x7F7\b \0B\x007\0\v\0 \0B\x7F7\b \0B\x007\0\v\0 \0\v\f\0 \0\xC3 \0!\v\f\0 \0(<\x9E\v;\x7F \0(<#\0Ak"\0$\0  A\xFFq \0A\bj\x9E! \0)\b! \0Aj$\0B\x7F  \x1B\v)\0  (\0A\x07jAxq"Aj6\0 \0 )\0 )\b\xC49\0\v\xB4\x7F|~#\0A\xB0k"\v$\0 \vA\x006,@ \xBD"B\0S@A!A\x9D ! \x9A"\xBD!\f\v A\x80q@A!A\xA0 !\f\vA\xA3 A\x9E Aq"\x1B! E!\v@ B\x80\x80\x80\x80\x80\x80\x80\xF8\xFF\0\x83B\x80\x80\x80\x80\x80\x80\x80\xF8\xFF\0Q@ \0A  Aj" A\xFF\xFF{q7 \0  3 \0A\xFB\rA\xED A q"\x1BA\xCEA\x97 \x1B  b\x1BA3 \0A   A\x80\xC0\0s7    J\x1B!\r\f\v \vAj!@@@  \vA,j\xD1" \xA0"D\0\0\0\0\0\0\0\0b@ \v \v(,"Ak6, A r"A\xE1\0G\r\f\v A r"A\xE1\0F\r \v(,!\f\f\v \v Ak"\f6, D\0\0\0\0\0\0\xB0A\xA2!\vA  A\0H\x1B!
  6549. \vA0jA\xA0A\0 \fA\0N\x1Bj"!\x07@ \x07 \xFC"6\0 \x07Aj!\x07  \xB8\xA1D\0\0\0\0e\xCD\xCDA\xA2"D\0\0\0\0\0\0\0\0b\r\0\v@ \fA\0L@ \f! \x07! !\b\f\v !\b \f! @A AO\x1B!@ \x07Ak" \bI\r\0 \xAD!\x1BB\0!@  5\0 \x1B\x86 |" B\x80\x94\xEB\xDC\x80"B\x80\x94\xEB\xDC~}>\0 Ak" \bO\r\0\v B\x80\x94\xEB\xDCT\r\0 \bAk"\b >\0\v@ \b \x07"I@ Ak"\x07(\0E\r\v\v \v \v(, k" 6, !\x07 A\0J\r\0\v\v A\0H@
  6550. AjA nAj! A\xE6\0F!@A A\0 k" A O\x1B!\r@  \bM@A\0A \b(\0\x1B!\x07\f\vA\x80\x94\xEB\xDC \rv!A\x7F \rtA\x7Fs!A\0! \b!\x07@ \x07 \x07(\0" \rv j6\0  q l! \x07Aj"\x07 I\r\0\vA\0A \b(\0\x1B!\x07 E\r\0  6\0 Aj!\v \v \v(, \rj" 6,  \x07 \bj"\b \x1B" Atj   kAu J\x1B! A\0H\r\0\v\vA\0! @  \bM\r\0  \bkAuA l! A
  6551. !\x07 \b(\0"A
  6552. I\r\0@ Aj!  \x07A
  6553. l"\x07O\r\0\v\v
  6554. A\0 A\xE6\0G\x1Bk A\xE7\0F
  6555. A\0Gqk"  kAuA lA kH@ \vA0jA\x84\`A\xA4b \fA\0H\x1Bj A\x80\xC8\0j"\fA m"Atj!\rA
  6556. !\x07 \f A lk"A\x07L@@ \x07A
  6557. l!\x07 Aj"A\bG\r\0\v\v@ \r(\0"\f \f \x07n" \x07lk"E \rAj" Fq\r\0@ AqE@D\0\0\0\0\0\0@C! \x07A\x80\x94\xEB\xDCG \b \rOr\r \rAk-\0\0AqE\r\vD\0\0\0\0\0@C!\vD\0\0\0\0\0\0\xE0?D\0\0\0\0\0\0\xF0?D\0\0\0\0\0\0\xF8?  F\x1BD\0\0\0\0\0\0\xF8?  \x07Av"F\x1B  K\x1B!@ \r\0 -\0\0A-G\r\0 \x9A! \x9A!\v \r \f k"6\0  \xA0 a\r\0 \r  \x07j"6\0 A\x80\x94\xEB\xDCO@@ \rA\x006\0 \b \rAk"\rK@ \bAk"\bA\x006\0\v \r \r(\0Aj"6\0 A\xFF\x93\xEB\xDCK\r\0\v\v  \bkAuA l! A
  6558. !\x07 \b(\0"A
  6559. I\r\0@ Aj!  \x07A
  6560. l"\x07O\r\0\v\v \rAj"   I\x1B!\v@ "\f \bM"\x07E@ Ak"(\0E\r\v\v@ A\xE7\0G@ A\bq!\f\v A\x7FsA\x7F
  6561. A
  6562. \x1B" J A{Jq"\x1B j!
  6563. A\x7FA~ \x1B j! A\bq"\r\0Aw!@ \x07\r\0 \fAk(\0"E\r\0A
  6564. !A\0! A
  6565. p\r\0@ "\x07Aj!  A
  6566. l"pE\r\0\v \x07A\x7Fs!\v \f kAuA l! A_qA\xC6\0F@A\0!
  6567.  jA k"A\0 A\0J\x1B" 
  6568. J\x1B!
  6569. \f\vA\0!
  6570.  j jA k"A\0 A\0J\x1B" 
  6571. J\x1B!
  6572. \vA\x7F!\r
  6573. A\xFD\xFF\xFF\xFF\x07A\xFE\xFF\xFF\xFF\x07
  6574. r"\x1BJ\r
  6575. A\0GjAj!@ A_q"\x07A\xC6\0F@ A\xFF\xFF\xFF\xFF\x07sJ\r A\0 A\0J\x1B!\f\v  Au"s k\xAD x"kAL@@ Ak"A0:\0\0  kAH\r\0\v\v Ak" :\0\0 AkA-A+ A\0H\x1B:\0\0  k" A\xFF\xFF\xFF\xFF\x07sJ\r\v  j" A\xFF\xFF\xFF\xFF\x07sJ\r \0A   j" 7 \0  3 \0A0  A\x80\x80s7@@@ \x07A\xC6\0F@ \vAjA r!  \b \b K\x1B"!\b@ \b5\0 x!@  \bG@  \vAjM\r@ Ak"A0:\0\0  \vAjK\r\0\v\f\v  G\r\0 Ak"A0:\0\0\v \0   k3 \bAj"\b M\r\0\v @ \0A\x9AA3\v
  6576. A\0L \b \fOr\r@ \b5\0 x" \vAjK@@ Ak"A0:\0\0  \vAjK\r\0\v\v \0 A
  6577. A N\x1B3
  6578. A k! \bAj"\b \fO\r
  6579. A J !
  6580. \r\0\v\f\v@
  6581. A\0H\r\0 \f \bAj \b \fI\x1B! \vAjA r!\f \b!\x07@ \f \x075\0 \fx"F@ Ak"A0:\0\0\v@ \x07 \bG@  \vAjM\r@ Ak"A0:\0\0  \vAjK\r\0\v\f\v \0 A3 Aj!
  6582. rE\r\0 \0A\x9AA3\v \0  \f k"
  6583. 
  6584. H\x1B3
  6585. k!
  6586. \x07Aj"\x07 O\r
  6587. A\0N\r\0\v\v \0A0
  6588. AjAA\07 \0   k3\f\v
  6589. !\v \0A0 A jA A\07\v \0A  A\x80\xC0\0s7   J\x1B!\r\f\v  AtAuA qj! @ A\vK\r\0A\f k!D\0\0\0\0\0\x000@!@ D\0\0\0\0\0\x000@\xA2! Ak"\r\0\v -\0\0A-F@  \x9A \xA1\xA0\x9A!\f\v  \xA0 \xA1!\v  \v(,"\x07 \x07Au"s k\xAD x"F@ Ak"A0:\0\0 \v(,!\x07\v Ar!
  6590. A q!\f Ak" Aj:\0\0 AkA-A+ \x07A\0H\x1B:\0\0 A\bqE A\0Lq!\b \vAj!\x07@ \x07" \xFC"A\x90\xF5\0j-\0\0 \fr:\0\0  \xB7\xA1D\0\0\0\0\0\x000@\xA2"D\0\0\0\0\0\0\0\0a \bq \x07Aj"\x07 \vAjkAGrE@ A.:\0 Aj!\x07\v D\0\0\0\0\0\0\0\0b\r\0\vA\x7F!\r A\xFD\xFF\xFF\xFF\x07
  6591.  k"\bj"kJ\r\0 \0A   Aj \x07 \vAj"k"\x07 \x07Ak H\x1B \x07 \x1B"j" 7 \0
  6592. 3 \0A0   A\x80\x80s7 \0  \x073 \0A0  \x07kA\0A\07 \0  \b3 \0A   A\x80\xC0\0s7    J\x1B!\r\v \vA\xB0j$\0 \r\v\0B\0\v\xD6\x07\x7F#\0A k"$\0  \0("6 \0(!  6  6   k"6  j! Aj!A!\x07\x7F@@@ \0(< A A\fj\v\x9E@ !\f\v@  (\f"F\r A\0H@ !\f\v A\bA\0  ("\bK" \x1Bj"  \bA\0 \x1Bk"\b (\0j6\0 A\fA \x1Bj" (\0 \bk6\0  k! \0(< " \x07 k"\x07 A\fj\v\x9EE\r\0\v\v A\x7FG\r\v \0 \0(,"6 \0 6 \0  \0(0j6 \f\v \0A\x006 \0B\x007 \0 \0(\0A r6\0A\0 \x07AF\r\0  (k\v A j$\0\v\x89\x7F#\0Ak"\0$\0@ \0A\fj \0A\bj\r\0A\xEC\xDB \0(\fAtAj/"6\0 E\r\0 \0(\b/"@A\xEC\xDB(\0" \0(\fAtjA\x006\0  E\r\vA\xEC\xDBA\x006\0\v \0Aj$\0A\x84\xCEA\x006\0A\x80\xCEA6\0\x95A\x84\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\x80\xCE6\0A\xA4\xCEA.6\0A\xA8\xCEA\x006\0\xCCA\xA8\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\xA4\xCE6\0A\xCC\xCFA\xD4\xCE6\0A\xA4\xCFA\x80\x806\0A\xA0\xCFA\xC0\xEC6\0A\x84\xCFA*6\0A\xA8\xCFA\xB0\xCB(\x006\0\v\v\xBF\xBE(\0A\x80\b\v\x940123456789abcdefghijklmnopqrstuvwxyz\0load_spz\0infinity\0February\0January\0July\0Thursday\0Tuesday\0Wednesday\0Saturday\0Sunday\0Monday\0Friday\0May\0%m/%d/%y\0-+ 0X0x\0-0X+0X 0X-0x+0x 0x\0Nov\0Thu\0August\0unsigned short\0unsigned int\0invalid literal/lengths set\0invalid code lengths set\0unknown header flags set\0invalid distances set\0get\0Oct\0float\0invalid bit length repeat\0Sat\0numPoints\0colors\0UnpackOptions\0positions\0rotations\0too many length or distance symbols\0invalid stored block lengths\0scales\0alphas\0[SPZ: ERROR] Check failed: %s:%d: %s\0vf32_ptr\0Apr\0vector\0money_get error\0[SPZ ERROR] deserializePackedGaussians: read error\0October\0November\0September\0December\0unsigned char\0Mar\0/emsdk/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp\0Sep\0%I:%M:%S %p\0Sun\0Jun\0Mon\0nan\0Jan\0coordinateSystem\0CoordinateSystem\0Jul\0bool\0April\0invalid code -- missing end-of-block\0incorrect header check\0incorrect length check\0incorrect data check\0push_back\0invalid distance too far back\0Fri\0sh\0header crc mismatch\0March\0Aug\0unsigned long long\0unsigned long\0std::wstring\0basic_string\0std::string\0std::u16string\0std::u32string\0inf\x000123456789abcdef\0%.0Lf\0%Lf\0resize\0invalid window size\0true\0Tue\0false\0invalid block type\0June\0double\0shDegree\0bad_array_new_length was thrown in -fno-exceptions mode\0invalid literal/length code\0invalid distance code\0RawGaussianCloud\0unknown compression method\0[SPZ ERROR] deserializePackedGaussians: header not found\0%0*lld\0%*lld\0+%lld\0%+.4ld\0void\0locale not supported\0antialiased\0Wed\0%Y-%m-%d\0[SPZ ERROR] deserializePackedGaussians: Too many points: %d\0[SPZ ERROR] deserializePackedGaussians: Unsupported SH degree: %d\0[SPZ ERROR] deserializePackedGaussians: version not supported: %d\0Dec\0./spz/src/cc/load-spz.cc\0Feb\0%a %b %d %H:%M:%S %Y\0POSIX\0VectorUInt8T\0%H:%M:%S\0NAN\0PM\0AM\0%H:%M\0LC_ALL\0ASCII\0LANG\0RUF\0LUF\0INF\0RDF\0LDF\0UNSPECIFIED\0C\0RUB\0LUB\0RDB\0LDB\0catching a class without an object?\0emscripten::memory_view<short>\0emscripten::memory_view<unsigned short>\0emscripten::memory_view<int>\0emscripten::memory_view<unsigned int>\0emscripten::memory_view<float>\0emscripten::memory_view<uint8_t>\0emscripten::memory_view<int8_t>\0emscripten::memory_view<uint16_t>\0emscripten::memory_view<int16_t>\0emscripten::memory_view<uint64_t>\0emscripten::memory_view<int64_t>\0emscripten::memory_view<uint32_t>\0emscripten::memory_view<int32_t>\0emscripten::memory_view<char>\0emscripten::memory_view<unsigned char>\0emscripten::memory_view<signed char>\0emscripten::memory_view<long>\0emscripten::memory_view<unsigned long>\0emscripten::memory_view<double>\x000123456789\0C.UTF-8\x0001234567\0VectorFloat32\x0001\x001.3.1\0.\0-\0(packed.alphas.size()) == (numPoints)\0(null)\0(packed.colors.size()) == (numPoints * 3)\0(packed.scales.size()) == (numPoints * 3)\0(packed.sh.size()) == (numPoints * shDim * 3)\0(packed.rotations.size()) == (numPoints * (packed.usesQuaternionSmallestThree ? 4 : 3))\0(packed.positions.size()) == (numPoints * 3 * (usesFloat16 ? 2 : 3))\0%\0length_error was thrown in -fno-exceptions mode with message "%s"\0[SPZ: ERROR] Unsupported SH degree: %d
  6593. \0 \0\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0A\xA0 \v\xB60\0\0\xF0c\0\0\xF0c\0\0P\0\0\xA4d\0\x008\0\0N3spz13GaussianCloudE\0\0\0\xA4d\0\0X\0\0N3spz13UnpackOptionsE\0ppiip\0\xF0c\0\0|\0\0\xA4d\0\0\x84\0\0NSt3__26vectorIfNS_9allocatorIfEEEE\0ipp\0(e\0\0\xD4\0\0\0\0\0\0\0\0\0\xEC\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIfEE\0\0\0\0\xCCd\0\0\xF8\0\0(\0\0NSt3__227__optional_move_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\x004\0\0d\0\0NSt3__227__optional_copy_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\0p\0\0\x98\0\0NSt3__220__optional_move_baseIfLb1EEE\0\0\0\xCCd\0\0\xA4\0\0\xCC\0\0NSt3__220__optional_copy_baseIfLb1EEE\0\0\0\xCCd\0\0\xD8\0\0\0\0NSt3__223__optional_storage_baseIfLb0EEE\0\0\0\0\xA4d\0\0\f\0\0NSt3__224__optional_destruct_baseIfLb1EEE\0\0\0\xA4d\0\0@\0\0NSt3__218__sfinae_ctor_baseILb1ELb1EEE\0\0\xA4d\0\0p\0\0NSt3__220__sfinae_assign_baseILb1ELb1EEE\0\0\0\0\x84e\0\0\xAC\0\0\0\0\0\0|\0\0PNSt3__26vectorIfNS_9allocatorIfEEEE\0\0\0\0\x84e\0\0\xE4\0\0\0\0\0|\0\0PKNSt3__26vectorIfNS_9allocatorIfEEEE\0pp\0v\0vp\0\0\0\x9C\0\0pp\0\0\x98c\0\0|\0\x008d\0\0vppf\0\0\0\0\x98c\0\0|\0\0\xFCc\0\x008d\0\0vppif\0\0\0\xFCc\0\0|\0\0ipp\0\\\0\x008d\0\0\xA4d\0\0d\0\0N10emscripten3valE\0\0\xAC\0\0|\0\0\xFCc\0\0pppi\0\0\0\0\0\0\0\0\xA8c\0\0|\0\0\xFCc\0\x008d\0\0ippif\0\0\0(e\0\0\xD0\0\0\0\0\0\0\0\0\0\xE8\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIhEE\0\0\0\0\xCCd\0\0\xF4\0\0$\0\0NSt3__227__optional_move_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\x000\0\0\`\0\0NSt3__227__optional_copy_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\0l\0\0\x94\0\0NSt3__220__optional_move_baseIhLb1EEE\0\0\0\xCCd\0\0\xA0\0\0\xC8\0\0NSt3__220__optional_copy_baseIhLb1EEE\0\0\0\xCCd\0\0\xD4\0\0\0\0\0NSt3__223__optional_storage_baseIhLb0EEE\0\0\0\0\xA4d\0\0\b\0\0NSt3__224__optional_destruct_baseIhLb1EEE\0\0\0\xA4d\0\0<\0\0NSt3__26vectorIhNS_9allocatorIhEEEE\0\x84e\0\0p\0\0\0\0\0\x004\0\0PNSt3__26vectorIhNS_9allocatorIhEEEE\0\0\0\0\x84e\0\0\xA8\0\0\0\0\x004\0\0PKNSt3__26vectorIhNS_9allocatorIhEEEE\0pp\0vp\0\`\0\0pp\0\0\x98c\0\x004\0\0\xC0c\0\0vppi\0\0\0\0\x98c\0\x004\0\0\xFCc\0\0\xC0c\0\0vppii\0\0\0\xFCc\0\x004\0\0ipp\0\\\0\0\xC0c\0\0\xA8\0\x004\0\0\xFCc\0\0pppi\0\0\0\0\xA8c\0\x004\0\0\xFCc\0\0\xC0c\0\0ippii\0p\0vp\0ipp\0vppi\0ipp\0vppi\0ppp\0vppp\0\0\0Xd\0\0p\0\0N3spz16CoordinateSystemE\0p\0vp\0ipp\0vppi\0\0\0\0\0\0\0\0\0\b\0\0\0\0\0\0\xA4d\0\0\xB0\0\0NSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\xA4d\0\0\xF8\0\0NSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE\0\0\xA4d\0\0@\0\0NSt3__212basic_stringIDsNS_11char_traitsIDsEENS_9allocatorIDsEEEE\0\0\0\xA4d\0\0\x8C\0\0NSt3__212basic_stringIDiNS_11char_traitsIDiEENS_9allocatorIDiEEEE\0\0\0\xA4d\0\0\xD8\0\0N10emscripten11memory_viewIcEE\0\0\xA4d\0\0\0\0\0N10emscripten11memory_viewIaEE\0\0\xA4d\0\0(\0\0N10emscripten11memory_viewIhEE\0\0\xA4d\0\0P\0\0N10emscripten11memory_viewIsEE\0\0\xA4d\0\0x\0\0N10emscripten11memory_viewItEE\0\0\xA4d\0\0\xA0\0\0N10emscripten11memory_viewIiEE\0\0\xA4d\0\0\xC8\0\0N10emscripten11memory_viewIjEE\0\0\xA4d\0\0\xF0\0\0N10emscripten11memory_viewIlEE\0\0\xA4d\0\0\0\0N10emscripten11memory_viewImEE\0\0\xA4d\0\0@\0\0N10emscripten11memory_viewIxEE\0\0\xA4d\0\0h\0\0N10emscripten11memory_viewIyEE\0\0\xA4d\0\0\x90\0\0N10emscripten11memory_viewIfEE\0\0\xA4d\0\0\xB8\0\0N10emscripten11memory_viewIdEE\0A\xE43\v\xA1(\x960\x07w,a\xEE\xBAQ \x99\xC4m\x07\x8F\xF4jp5\xA5c\xE9\xA3\x95d\x9E2\x88\xDB\xA4\xB8\xDCy\xE9\xD5\xE0\x88\xD9\xD2\x97+L\xB6 \xBD|\xB1~\x07-\xB8\xE7\x91\xBF\x90d\xB7\xF2 \xB0jHq\xB9\xF3\xDEA\xBE\x84}\xD4\xDA\xEB\xE4\xDDmQ\xB5\xD4\xF4\xC7\x85\xD3\x83V\x98l\xC0\xA8kdz\xF9b\xFD\xEC\xC9e\x8AO\\\xD9lcc=\xFA\xF5\r\b\x8D\xC8 n;^iL\xE4A\`\xD5rqg\xA2\xD1\xE4<G\xD4K\xFD\x85\r\xD2k\xB5
  6594. \xA5\xFA\xA8\xB55l\x98\xB2B\xD6\xC9\xBB\xDB@\xF9\xBC\xAC\xE3l\xD82u\\\xDFE\xCF\r\xD6\xDCY=\xD1\xAB\xAC0\xD9&:\0\xDEQ\x80Q\xD7\xC8a\xD0\xBF\xB5\xF4\xB4!#\xC4\xB3V\x99\x95\xBA\xCF\xA5\xBD\xB8\x9E\xB8(\b\x88_\xB2\xD9\f\xC6$\xE9\v\xB1\x87|o/LhX\xABa\xC1=-f\xB6\x90A\xDCvq\xDB\xBC \xD2\x98*\xD5\xEF\x89\x85\xB1q\xB5\xB6\xA5\xE4\xBF\x9F3\xD4\xB8\xE8\xA2\xC9\x07x4\xF9\0\x8E\xA8 \x96\x98\xE1\xBB\rj\x7F-=m\b\x97ld\x91\\c\xE6\xF4Qkkbal\xD80e\x85N\0b\xF2\xED\x95l{\xA5\x1B\xC1\xF4\b\x82W\xC4\xF5\xC6\xD9\xB0eP\xE9\xB7\xEA\xB8\xBE\x8B|\x88\xB9\xFC\xDF\xDDbI-\xDA\xF3|\xD3\x8CeL\xD4\xFBXa\xB2M\xCEQ\xB5:t\0\xBC\xA3\xE20\xBB\xD4A\xA5\xDFJ\xD7\x95\xD8=m\xC4\xD1\xA4\xFB\xF4\xD6\xD3j\xE9iC\xFC\xD9n4F\x88g\xAD\xD0\xB8\`\xDAs-D\xE53_L
  6595. \xAA\xC9|\r\xDD<qP\xAAA'\v\xBE\x86 \f\xC9%\xB5hW\xB3\x85o \xD4f\xB9\x9F\xE4a\xCE\xF9\xDE^\x98\xC9\xD9)"\x98\xD0\xB0\xB4\xA8\xD7\xC7=\xB3Y\x81\r\xB4.;\\\xBD\xB7\xADl\xBA\xC0 \x83\xB8\xED\xB6\xB3\xBF\x9A\f\xE2\xB6\x9A\xD2\xB1t9G\xD5\xEA\xAFw\xD2\x9D&\xDB\x83\xDCs\vc\xE3\x84;d\x94>jm\r\xA8Zjz\v\xCF\xE4\x9D\xFF \x93'\xAE\0
  6596. \xB1\x9E\x07}D\x93\xF0\xD2\xA3\b\x87h\xF2\xFE\xC2i]Wb\xF7\xCBge\x80q6l\xE7knv\x1B\xD4\xFE\xE0+\xD3\x89Zz\xDA\xCCJ\xDDgo\xDF\xB9\xF9\xF9\xEF\xBE\x8EC\xBE\xB7\xD5\x8E\xB0\`\xE8\xA3\xD6\xD6~\x93\xD1\xA1\xC4\xC2\xD88R\xF2\xDFO\xF1g\xBB\xD1gW\xBC\xA6\xDD\xB5?K6\xB2H\xDA+\r\xD8L\x1B
  6597. \xAF\xF6J6\`zA\xC3\xEF\`\xDFU\xDFg\xA8\xEF\x8En1y\xBEiF\x8C\xB3a\xCB\x83f\xBC\xA0\xD2o%6\xE2hR\x95w\f\xCCG\v\xBB\xB9"/&U\xBE;\xBA\xC5(\v\xBD\xB2\x92Z\xB4+j\xB3\\\xA7\xFF\xD7\xC21\xCF\xD0\xB5\x8B\x9E\xD9,\xAE\xDE[\xB0\xC2d\x9B&\xF2c\xEC\x9C\xA3ju
  6598. \x93m\xA9 \x9C?6\xEB\x85g\x07rW\0\x82J\xBF\x95z\xB8\xE2\xAE+\xB1{8\x1B\xB6\f\x9B\x8E\xD2\x92\r\xBE\xD5\xE5\xB7\xEF\xDC|!\xDF\xDB\v\xD4\xD2\xD3\x86B\xE2\xD4\xF1\xF8\xB3\xDDhn\x83\xDA\xCD\xBE\x81[&\xB9\xF6\xE1w\xB0owG\xB7\xE6Z\b\x88pj\xFF\xCA;f\\\v\xFF\x9Ee\x8Fi\xAEb\xF8\xD3\xFFkaE\xCFlx\xE2
  6599. \xA0\xEE\xD2\r\xD7T\x83N\xC2\xB39a&g\xA7\xF7\`\xD0MGiI\xDBwn>Jj\xD1\xAE\xDCZ\xD6\xD9f\v\xDF@\xF0;\xD87S\xAE\xBC\xA9\xC5\x9E\xBB\xDE\x7F\xCF\xB2G\xE9\xFF\xB50\xF2\xBD\xBD\x8A\xC2\xBA\xCA0\x93\xB3S\xA6\xA3\xB4$6\xD0\xBA\x93\xD7\xCD)W\xDET\xBFg\xD9#.zf\xB3\xB8Ja\xC4\x1Bh]\x94+o*7\xBE\v\xB4\xA1\x8E\f\xC3\x1B\xDFZ\x8D\xEF-\0\0\0\0F;ge\x8Cv\xCE\xCA\xCAM\xA9\xAFY\xEB\xEDN\xD0\x8A+\xD5\x9D#\x84\x93\xA6D\xE1\xB2\xD6\xDB\x9D\xF4\xED\xBC\xF8>\xA0Wx\x9Br2\xEB=6\xD3\xADQ\xB6gK\xF8!p\x9F|%\xAB\xC6\xE0c\x90\xA1\x85\xA9\xDD\b*\xEF\xE6oO|@+\xAE:{L\xCB\xF06\xE5d\xB6\r\x82\x97}}\xD1Fz\x1B\v\xD3\xB7]0\xB4\xD2\xCE\x96\xF03\x88\xAD\x97VB\xE0>\xF9\xDBY\x9C\vP\xFCMk\x9B\x7F\x87&2\xD0\xC1U\xB5R\xBBT\x80v1\xDE\xCD\xDF\x9E\x98\xF6\xB8\xFB\xB9\x86'\x87\xFF\xBD@\xE25\xF0\xE9Ms\xCB\x8E(\xE0m\xCA\xC9\xA6V\xAD\xACl\x1B* cf.\xFB:\xFAh\xC0]\x9F\xA2\x8D\xF40\xE4\xB6\x93Uw\xD7\xB41+\xB0\xD1\xFBf~\xBD]~\x1B\x9C-\xE1g\xDA\x86[/\xADV\`H\xC8\xC5\xC6\f)\x83\xFDkLI\xB0\xC2\xE3\x8B\xA5\x86\xA0\xF85P\x9B\x9FP\x9A\xD66\xFF\xDC\xEDQ\x9AOK{ pr\xC3=\xDB\xB1\x85\xBC\xD4\xA4v#\xA8\xE2MD\xCD(\0\xEDbn;\x8A\x07\xFD\x9D\xCE\xE6\xBB\xA6\xA9\x83q\xEB\0,7\xD0gI3\v>\xD5u0Y\xB0\xBF}\xF0\xF9F\x97zj\xE0\xD3\x9B,\xDB\xB4\xFE\xE6\x96Q\xA0\xADz4\x81\xDD\xE5H\xC7\xE6\x82-\r\xAB+\x82K\x90L\xE7\xD86\b\x9E\rocT@\xC6\xCC{\xA1\xA9\xF0/[\xCBcJ\x91\x86\xCA\xE5\xD7\xBD\xAD\x80D\x1B\xE9a \x8E\xC8m'\xAB\x8EV@\xCE\xAF&\xDF\xB2\xE9\xB8\xD7#Pxekv\xF6\xCD2\xFC\xB0\xF6U\x99z\xBB\xFC6<\x80\x9BS8[\xC2\xCF~\`\xA5\xAA\xB4-\f\xF2k\`a\xB0/\x81'\x8BH\xE4\xED\xC6\xE1K\xAB\xFD\x86.\x8A\x8DR\xCC\xB6~7\xFB\xD7\x98@\xC0\xB0\xFD\xD3f\xF4\x95]\x93y_:\xD6+]\xB3,@\xF1kj{\x96\xA06?\xA1\xE6\rX\xC4u\xAB%3\x90{@\xF9\xDD\xD2\xEF\xBF\xE6\xB5\x8A\x9E\x96*\xF6\xD8\xADM\x93\xE0\xE4<T\xDB\x83Y\xC7}\xC7\xB8\x81F\xA0\xDDK\v r\r0n \xEB7\x8BO\xD0P\xEE\x85\x9D\xF9A\xC3\xA6\x9E$P\0\xDA\xC5;\xBD\xA0\xDCv\x9AMsj\xBB=\xEC\xFD\x8Bs7K"\xDCqpE\xB9\xE2\xD6X\xA4\xEDf=n\xA0\xCF\x92(\x9B\xA8\xF7'\rqa+j\xABf\xC3\xBB\xED]\xA4\xDE~\xFB\xE0?8\xC0\x87Z\xF2\x8D.\xF5\xB4\xB6I\x90\x95\xC6\xD6\xEC\xD3\xFD\xB1\x89\xB0&_\x8B\x7FC\xCC-;\xA2\x8A\\\xC7@[\xF5h\`\x92\r\xBB\xCB\x91D\x80\xAC\xF4\x8E\xCD[\xC8\xF6b>[P&\xDFkA\xBA\xD7&\xE8\x91\x8Fp\xB0m\f\xF6Vwi<\x1B\xDE\xC6z \xB9\xA3\xE9\x86\xFDB\xAF\xBD\x9A'e\xF03\x88#\xCBT\xED:\xE0 ^|\xDBn;\xB6\x96\xC7\x94\xF0\xAD\xA0\xF1c\v\xE4%0\x83u\xEF}*\xDA\xA9FM\xBF\x886\xD2\xC3\xCE\r\xB5\xA6@ B{{l\xD1\xDD?\x8D\x97\xE6X\xE8]\xAB\xF1G\x1B\x90\x96"K\xCF\xBEYp\xA8\xDB\x93=t\xD5fF\xA0"\xF0\0\x9BE\x95\xCA\xD6\xEC:\x8C\xED\x8B_\xAD\x9D#\xEB\xA6sF!\xEB\xDA\xE9g\xD0\xBD\x8C\xF4v\xF9m\xB2M\x9E\bx\x007\xA7>;P\xC21\xB0\xF5Dw\x8B\x92!\xBD\xC6;\x8E\xFB\xFD\\\xEBh[
  6600. .\`\x7Fo\xE4-\xD6\xC0\xA2\xB1\xA5\x83f.\xD9\xC5]I\xBC\xE0I+\x87v\xDA\x8D\xC3\x97\x9C\xB6\xA4\xF2V\xFB\r]\xC0j8\x1B3\xA4R T\xC1\x98m\xFDn\xDEV\x9A\vM\xF0\xDE\xEA\v\xCB\xB9\x8F\xC1\x86 \x87\xBDwE\xA6\xCD\xE89\xE0\xF6\x8F\\*\xBB&\xF3l\x80A\x96\xFF&w\xB9bsP\xCB\xBD5k\xAC\xD8\0\0\0\0X\x80\xE2\xD7\xF1\xB4t\xA9\x86V\xA3\xE2\rh\xE9\xBA\x8D\x8A>\v\xDC\x9DK\x8B>J\x85\xA1 \xDD\x9DC\xDEt\x1B},\x9B\xF7\xAAg\xC9\xE0?\x90+7\x96}\x94\xCE\x96\x9FC
  6601. ;BR\xBB\xA0\xC4\xFB=\xF6g\xA3\xBD\xB0\xE86*\xFA\xB0\xB6\xC8-0\x9E\x8EA\xB0|Y\x8F&\xE3\xD7\xA6\xCD~ Wn&\xA0\xB5\xB9m+\x8B\xF35\xABi$\x9C-?\x87\xC4\xAD\xDDPv\x84&L\xF6f\xF1\xE5p0R\xBD\xF0\xD2\x85\xF6{\xEC\xCF\xAE\xFB\x07}X\xBB_\xFD\xBAl\x91k%/\xC9\xEB\xC7\xF8\`m\x91[8\xEDs\x8CsfM\xC6+\xE6\xAF\x82\`\xF9\xB2\xDA\xE0\x1BeM\xC65F\xCD$\xE2\xEFKrA\xB7\xCB\x90\x96\xFC@\xAE\xDC\xA4\xC0L\v\rF\xA8U\xC6\xF8\x7F\x9BPg<\xC3\xD0\x85\xEBjV\xD3H2\xD61\x9Fy]\xD5!\xDD\xED\x88[\xBB\xA1\xD0\xDBYv(\xEC\bMpl\xEA\x9A\xD9\xEA\xBC9\x81j^\xEE\xCA\xE1\`\xA4\x92a\x82s;\xE7\xD4\xD0cg6\x07\xAD\xF1\xA9D\xF5qK\x93\\\xF70w\xFF\xE7O\xFC\xC1\xAD|#z\xBE\xFAu\xD9\xE6z\x97"\xD7J^zW\xA8\x89\xD3\xD1\xFE*\x8BQ\xFD\xC0\xDA"\xB7\x98Z\xC0\`1\xDC\x96\xC3i\\t\xA7\xCA\xEBW\xFFJ \x80V\xCC_#L\xBD\xF4E\xC7\x83\xBEGai\xB4\xC17\xCA\xECA\xD5<\x9A\x8Ckdn\xBC\xCD\x9C8\x95\xDA\xC8\xDE\x97\xE4\x82\x86U/\x91P\xF6w\xB2!\xB9\x87-b\xE1\x07\xCF\xB5H\x81\x99{\xC1[\x8AE\x8B
  6602. \xA7\\\xAA\x8C\xF1\xFF\xF2\f(6\xA1\xCExn!,\xAF\xC7\xA7z\f\x9F'\x98\xDB\xD4\xAC\xA6\x91\x8C,DF%\xAA\xE5}*\xF02\xB3\xBCoq\xEB<\x8D\xA6B\xBA\xDB:9\xD2Q\xB1\x07\x98 1\xE5O\xA0\xB7\xB3\xEC\xF87Q;P\xD8\x9A\bX\xF3M\xA1\xDE\xA5\xEE\xF9^G9\xB2\xD5ys\xEAU\x9B\xA4C\xD3\xCD\x07\x1BS/\xD0\xD5\xC5\xB0\x93\x8DERD$\xC3\xE7|C\xE607\xC8\xD8zoH:\xAD\xC6\xCEl\x9EN\x8E\xD9Z\xE3S\x89c\xB1^\xAB\xE5\xE7\xFD\xF3e*\xB8\xEE;\`\xE0n\xD9\xB7I\xE8\x8Fhm\xC3\xDF\xFE\xF2\x80\x87~W.\xF8F\xF4vx\xA4#=\xF3\x9Aiesx\xBE\xCC\xF5.\x94u\xCC\xCAD\xAE\x95\xBC.wk\xB5\xA8!\xC8\xED(\xC3\xA6\xA3\xFDU\xFE#\x82W\xA5I!%\xAB\xF6\xC1\xB34\xB5\x993\xD6b0\xB5\x80\xC1h5b#\xBE\\\\{>\xBE\x8B\xD2\xB8\xE8(\x8A8
  6603. \xFFN\x95\xD7\xAF5x\xBF\x93c\xDB\xE7\x81\f\xAC\x98\xBFF\xF4]\x91]\x9E\v2\xE9\xE5\xCB\x88v\xA6\x93\b\x94q:\x8E\xC2\xD2b )\x85Oq\xFC\x98\xD8\x83\xAA;\x80H\xECx4\xD7 \xB4\xFB\0\x892\xAD\xA3\xD1\xB2Ot\x9A9q>\xC2\xB9\x93\xE9k?\xC5J3\xBF'\x9D\xFD)\xB8\xDE\xA5\xA9Z \f/\f\xAAT\xAF\xEE}$\xD07G\xA42\xE0\xEE"dC\xB6\xA2\x86\x94r[\xC4*\x8F\xB9\x83 \xEF\xB0\xDB\x89\rg\x903-\xC8\x82\xD1\xFAa\x87Y9\x84e\x8E\xF7\xFA\xCD\xAF\x92N\xB9^\x94\xACn\x92$M\x9Fp\xF3\xE4&P\xBC\x99\xC4\x87lB\x9D\xF14\xC2\x7F&\x9DD)\x85\xC5\xC4\xCBR\x8EO\xF5\xD6\xCF\xCF\x7FIAl'\xC9\xA3\xBB\xE9_<\xF8\xB1\xDF\xDE/Y\x88\x8C@\xD9j[\vRTS\xD2\xB6\xC6\xFAT\xE0e\xA2\xD4\xB2fy\xDF\xE2>\xF9=5\x97\x7Fk\x96\xCF\xFF\x89A\x84t\xB7\v\xDC\xF4U\xDCur\x7F-\xF2\xE1\xA8\xE3d~\xEB\xBB\xE4\x9C<b\xCA\x9FJ\xE2(HiY\xE9\xF4\xD5\xF0o\xA2v\xA8\xEF@\xA1\0\0\0\0\xE1\xB6R\xEF\x83k\xD4b\xDD\x86\xEA\xD7\xA8\v\xE7a\xFA\xE4\x85\xBC|d
  6604. .\xE1\f\xAEQ\xED\xF8\x8F\xC5\x85ns\xD7\xFD
  6605. y\xF9\xEB\xCF\xAB\xF3\x89-h\xA4\x7F\xF6\\\xA3.\xF9\xEA\xF1\xC1\x9B7w+z\x81%\xC4\x8B\v%\xFF=Y\xCA\x9D\xE0\xDF |V\x8D\xCF\xF2\xF29\xF5D\xA0\xD6\x97\x99&<v/t\xD3%Z2\xF3\x93\b\xDD\x91N\x8E7p\xF8\xDC\xD80\xB8F]\xD1\xB2\xB3\xD3\x92XRe\xC0\xB76o\xEEV\xD7\xD9\xBC\xB9\xB5:ST\xB2h\xBC<J\xDD\xA0E\xA5\xBF}\xC3O^\xCB\x91\xA0:\xC1\xBFA\xDBw\xED\xAE\xB9\xAAkDX9\xAB(\xE4\xE5s\xC9R\xB7\x9C\xAB\x8F1vJ9c\x99.3Mx\xCF\x85\x97\xADX\x99}L\xEE\xCB\x92$J\xB4d\xC5\xFC\xE6\x8B\xA7!\`aF\x972\x8E"\x9Do\xC3+N\x80\xA1\xF6\xC8j@@\x9A\x85\`p\x8D\xBA\x81\xC6\xDFU\xE3\x1BY\xBF\xAD\vPf\xA7%\xB1\x87w^\xE5\xCC\xF1\xB4z\xA3[l\xDE\xDC\xAD\x8Dh\x8EB\xEF\xB5\b\xA8ZGj t\xA6\x8B\xBF&I\xE9b\xA0\xA3\b\xD4\xF2Lx,.\x94\x99\x9A|{\xFBG\xFA\x91\xF1\xA8~~\xFB\x86\x9F\x9FM\xD4p\xFD\x90R\x9A&\0ut\x82\x7F\x83\x954-l\xF7\xE9\xAB\x86_\xF9irU\xD7\x88\x93\xE3\x85g\xF1>\x8D\x88QbP\xC8\xCB\xE7\xB1~\x99\b\xD3\xA3\xE22M\rVc\xEC\xB7\xA91\xD5t\xB7\xE94\xC2\xE5\\f\x9A\xF0\xBD\xD0\xC8\xDF\rN\xF5>\xBBZ\xB12\xFB\xBB\x07\`\xD9\xDA\xE6\xFE8l\xB4H\x94h\xC9\xA9":&\xCB\xFF\xBC\xCC*I\xEE#NC\xC0\xC2\xAF\xF5\x92-\xCD(\xC7,\x9EF(D:9\xDE\xA5\x8Ck1\xC7Q\xED\xDB&\xE7\xBF4B\xED\x91\xD5\xA3[\xC3:\xC1\x86E\xD0 0?\x81\xE6k\xAE\`P9A\x8D\xBF\xAB\xE3;\xEDD\x871\xC3\xA5f\x87\x91JZ\xA0\xE5\xECEO\x8DH:\xB9l\xFEhV#\xEE\xBC\xEF\x95\xBCS\x8B\x9F\x92\xB2j)\xC0]\b\xF4F\xB7\xE9BX\x99\xBA\xC8\x80x\f\x9Ao\xD1\x85\xFBgNj\x9Fm\`\x8B~\xDB2d\xB4\x8E\xFD\xB0\xE6a\x95\x99\x97t\xA2\xCBx\x7FM\x92\xF7\xC9}\x93\xC31\x9Crucs\xA8\xE5\x99\xF1\xB7v\xB1^-\xF3P\xE8\x7F25\xF9\xF6\xD3\x83\xAB\xB7\x89\x85\xF8V?\xD74\xE2Q\xFD\xD5T\xBD\xF0|\xE4\\F.\v>\x9B\xA8\xE1\xDF-\xFA\xBB'\xD4\xEFZ\x91\x86\x008L\0\xEA\xD9\xFAR\xA9\x8E\xDDH\xB4\xDC2*iZ\xD8\xCB\xDF\b7\xAF\xD5&\xD6Nct9,\xBE\xF2\xD3\xCD\b\xA0<\xA5\xAC\xDF\xCAD\x8D%&\xC7\v\xCF\xC7qY \xA3{w\xC1B\xCD%. \xA3\xC4\xC1\xA6\xF1+\xE1\x96\xE6\0 \xB4\xFBb\xFD2\x83K\`\xFE\xE7AN\xF7\xF0d*\x9A\x85\x9C\xC8\xF5\xED8\xB7\f\x8E\xE5\xECnSc\x8F\xE51\xE9\xEB\xEF\b
  6606. YM\xE7h\x84\xCB\r\x892\x99\xE2\xF9\xCAE:|\xD5z\xA1\x91?\x9B\xC3\xD0\xFF\xED1\xAB\xBF\xDE|v94\x9D\xC0k\xDB\xF5d-\xD2F\xC2v\xC0(\x97\xB9\x92\xC7\xF3\xB3\xBC&\xEE\xC9p\xD8h#\x91n:\xCC\xD1.\xA0I0\x98\xF2\xA6REtL\xB3\xF3&\xA3\xD7\xF9\bB6OZ\xADT\x92\xDCG\xB5$\x8E\xA8\xDD\x80\xF1^<6\xA3\xB1^\xEB%[\xBF]w\xB4\xDBWYU:\xE1\v\xBAX<\x8DP\xB9\x8A\xDF\xBF\xC9rg(\xC4Q\x88J\xD7b\xAB\xAF\x85\x8D\xCF\xA5\xABl.\xF9\x83L\xCE\x7Fi\xADx-\x86\xC5\xDCRp$j\0\x9FF\xB7\x86u\xA7\xD4\x9A\xC3\v\xFA{"\xBD\xA8\x94@\`.~\xA1\xD6|\x91\0\0\0\0C\xCB\xA6\x87\xC7\x90<\xD4\x84[\x9AS\xCF'\bs\x8C\xEC\xAE\xF4\b\xB74\xA7K|\x92 \x9EO\xE6\xDD\x84\xB6aY\xDF,2\x8A\xB5Qh\x95\xA3\xBE\x96\xF8$A\xD53\x82\xC6}\x99Q>R\xF7\x90\xBA m\xC3\xF9\xC2\xCBD\xB2\xBEYd\xF1u\xFF\xE3u.e\xB06\xE5\xC37\xE3\xD6A\xF1\xA0\xE7v$F}%g\x8D\xDB\xA2,\xF1I\x82o:\xEF\xEBauV\xA8\xAA\xD3\xD1\xFA2\xA3.\xB9\xF9\xA9=\xA2\x9F\xFA~i9}5\xAB]v\xDE\r\xDA\xF2\x85\x97\x89\xB1N1d}\xB3\xC8'\xB6O\xA3\xED\x8F\xE0&)\x9B\xABZ\xBB\xBB\xE8\x91<l\xCA\x87o/!\xE8\x87\xAB\xF29\xC4\`T\xBE@;\xCE\xED\xF0hjH\x8C\xFAJ\vG\\\xCD\x8F\xC6\x9E\xCC\xD7\`\xE4\xE2\xDFZ/DX\xDEt\xDE\v\x9D\xBFx\x8C\xD6\xC3\xEA\xAC\x95\bL+S\xD6xR\x98p\xFF\xF4eF]\xB7\xAE\xE0\xDA3\xF5z\x89p>\xDC;BN.x\x89\xE8\xA9\xFC\xD2r\xFA\xBF\xD4}j*V\xBB)\xE1\xF0<\xAD\xBAjo\xEEq\xCC\xE8\xA5\r^\xC8\xE6\xC6\xF8Ob\x9Db!V\xC4\x9B\x89\xFCJ\xCA7\xB1\xCDNl+\x9E\r\xA7\x8DF\xDB9\xB9\xBE\x81K#\xED\xC2\x80\x85j\xB3\x07\xACTx\xA1+\xD0#;x\x93\xE8\x9D\xFF\xD8\x94\xDF\x9B_\xA9X3\v\\\xCF\x95\x8CW\xE5sM\x9CC\xF4\xC9\xC7\xD9\xA7\x8A\f\x7F \xC1p\xED\0\x82\xBBK\x87\xE0\xD1\xD4E+wS\x90\xF5\x95\xD3\xD3SW\x88\xC9ACo\xC6_?\xFD\xE6\xF4[a\x98\xAF\xC12\xDBdg\xB5s\xCE\xB4d0\xE3\xB4^\x88\xB0\xF7\x95.7\xBC\xE9\xBC\xFF"\x90{y\x80\xC38\xB2&D\xED\x81\xA4\x82\xAEJ*\x98Vi\xDA>\xD1"\xA6\xAC\xF1am
  6607. v\xE56\x90%\xA6\xFD6\xA2\xE8\xCB\x8C\xBA\xAB\0*=/[\xB0nl\x90\xE9'\xEC\x84\xC9d'"N\xE0|\xB8\xA3\xB7\x9Av\x84\x9C\\5O:\xDB\xB1\xA0\x88\xF2\xDF\xB9\xA3\x94/\xFAh2\xA8~3\xA8\xFB=\xF8|\x95R\xDD\xAD\xD6\x99{*R\xC2\xE1y G\xFEZu\xD5\xDE\xBEsY\x9D\xE5\xE9
  6608. \xDE.O\x8D\v\xCDKH\xD6k\xCC\xCC\x8D\xF1\x9F\x8FFW\xC4:\xC58\x87\xF1c\xBF\xAA\xF9\xEC@a_k\xF9/\x94Q2\x89\xD5i@\x96\xA2\xB5\xC7\xDD\xDE'\xE7\x9E\x81\`N\x1B3Y\x85\xBD\xB4\x8C\xB6?r\xCF}\x99\xF5K&\xA6\b\xED\xA5!C\x917\0Z\x91\x86\x84\v\xD5\xC7\xCA\xADRo\`~\x83,\xAB\xD8\xA8\xF0BW\xEB;\xE4\xD0\xA0Gv\xF0\xE3\x8C\xD0wg\xD7J$$\xEC\xA3\xF1/ne\xB2\xE4\xC8\xE26\xBFR\xB1ut\xF46>\bf}\xC3\xC0\x91\xF9\x98Z\xC2\xBAS\xFCE\xAE\xCA\xE7_el\`\xDB>\xF63\x98\xF5P\xB4\xD3\x89\xC2\x94\x90Bd\xFE@W\xD2X\xC7\x82\xE1\xDA\xC1*|\x86Eq\xE6\xD5\xBA@RM\xC6\xD2r\rt\xF5\x8AV\xEE\xA6\xC9\x9DH!a7\x9B\xF0"\xFC=w\xA6\xA7\xA7$\xE5l\xA3\xAE\x93\x83\xED\xDB5i\x80\xAFW*K \xD0\xFFx\x8B\xBC\xB3-\x918\xE8\xB7\xC2{#E0_\x83es\x94%\xE2\xF7\xCF\xBF\xB1\xB46\xE6\x9Ci\xC9\xA5W\xCFN!\fUb\xC7\xF3\x9A)\xBBa\xBAjp\xC7=\xEE+]n\xAD\xE0\xFB\xE9x\xD3y/;\xDF\xA8\xBFCE\xFB\xFC\x88\xE3|\xB7\xF4q\\\xF4?\xD7\xDBpdM\x883\xAF\xEB\x9B8\xDE\xD8\xCE\x9EY\\\x95
  6609. ^\xA2\x8DT"0\xAD\xE9\x96*\x93\xB2\fy\xD0y\xAA\xFEJ(8F\x81\x8E\xBF\xC2\xDA\xEC\x81\xB2k\xCAm K\x89\xA6\x86\xCC\r\xFD\x9FN6\xBA\0\0\0\0\0\b\0\x07\0 \0\0
  6610. \0\0\v\0\0\f\0\0\r\0\0\0\0\0A\x90\xDC\0\v\xA2\`\x07\0\0\0\bP\0\0\b\0\bs\0\x07\0\0\bp\0\0\b0\0\0 \xC0\0\x07
  6611. \0\0\b\`\0\0\b \0\0 \xA0\0\0\b\0\0\0\b\x80\0\0\b@\0\0 \xE0\0\x07\0\0\bX\0\0\b\0\0 \x90\0\x07;\0\0\bx\0\0\b8\0\0 \xD0\0\x07\0\0\bh\0\0\b(\0\0 \xB0\0\0\b\b\0\0\b\x88\0\0\bH\0\0 \xF0\0\x07\0\0\bT\0\0\b\0\b\xE3\0\x07+\0\0\bt\0\0\b4\0\0 \xC8\0\x07\r\0\0\bd\0\0\b$\0\0 \xA8\0\0\b\0\0\b\x84\0\0\bD\0\0 \xE8\0\x07\b\0\0\b\\\0\0\b\0\0 \x98\0\x07S\0\0\b|\0\0\b<\0\0 \xD8\0\x07\0\0\bl\0\0\b,\0\0 \xB8\0\0\b\f\0\0\b\x8C\0\0\bL\0\0 \xF8\0\x07\0\0\bR\0\0\b\0\b\xA3\0\x07#\0\0\br\0\0\b2\0\0 \xC4\0\x07\v\0\0\bb\0\0\b"\0\0 \xA4\0\0\b\0\0\b\x82\0\0\bB\0\0 \xE4\0\x07\x07\0\0\bZ\0\0\b\0\0 \x94\0\x07C\0\0\bz\0\0\b:\0\0 \xD4\0\x07\0\0\bj\0\0\b*\0\0 \xB4\0\0\b
  6612. \0\0\b\x8A\0\0\bJ\0\0 \xF4\0\x07\0\0\bV\0\0\b\0@\b\0\0\x073\0\0\bv\0\0\b6\0\0 \xCC\0\x07\0\0\bf\0\0\b&\0\0 \xAC\0\0\b\0\0\b\x86\0\0\bF\0\0 \xEC\0\x07 \0\0\b^\0\0\b\0\0 \x9C\0\x07c\0\0\b~\0\0\b>\0\0 \xDC\0\x07\x1B\0\0\bn\0\0\b.\0\0 \xBC\0\0\b\0\0\b\x8E\0\0\bN\0\0 \xFC\0\`\x07\0\0\0\bQ\0\0\b\0\b\x83\0\x07\0\0\bq\0\0\b1\0\0 \xC2\0\x07
  6613. \0\0\ba\0\0\b!\0\0 \xA2\0\0\b\0\0\b\x81\0\0\bA\0\0 \xE2\0\x07\0\0\bY\0\0\b\0\0 \x92\0\x07;\0\0\by\0\0\b9\0\0 \xD2\0\x07\0\0\bi\0\0\b)\0\0 \xB2\0\0\b \0\0\b\x89\0\0\bI\0\0 \xF2\0\x07\0\0\bU\0\0\b\0\b\x07+\0\0\bu\0\0\b5\0\0 \xCA\0\x07\r\0\0\be\0\0\b%\0\0 \xAA\0\0\b\0\0\b\x85\0\0\bE\0\0 \xEA\0\x07\b\0\0\b]\0\0\b\0\0 \x9A\0\x07S\0\0\b}\0\0\b=\0\0 \xDA\0\x07\0\0\bm\0\0\b-\0\0 \xBA\0\0\b\r\0\0\b\x8D\0\0\bM\0\0 \xFA\0\x07\0\0\bS\0\0\b\0\b\xC3\0\x07#\0\0\bs\0\0\b3\0\0 \xC6\0\x07\v\0\0\bc\0\0\b#\0\0 \xA6\0\0\b\0\0\b\x83\0\0\bC\0\0 \xE6\0\x07\x07\0\0\b[\0\0\b\x1B\0\0 \x96\0\x07C\0\0\b{\0\0\b;\0\0 \xD6\0\x07\0\0\bk\0\0\b+\0\0 \xB6\0\0\b\v\0\0\b\x8B\0\0\bK\0\0 \xF6\0\x07\0\0\bW\0\0\b\0@\b\0\0\x073\0\0\bw\0\0\b7\0\0 \xCE\0\x07\0\0\bg\0\0\b'\0\0 \xAE\0\0\b\x07\0\0\b\x87\0\0\bG\0\0 \xEE\0\x07 \0\0\b_\0\0\b\0\0 \x9E\0\x07c\0\0\b\x7F\0\0\b?\0\0 \xDE\0\x07\x1B\0\0\bo\0\0\b/\0\0 \xBE\0\0\b\0\0\b\x8F\0\0\bO\0\0 \xFE\0\`\x07\0\0\0\bP\0\0\b\0\bs\0\x07\0\0\bp\0\0\b0\0\0 \xC1\0\x07
  6614. \0\0\b\`\0\0\b \0\0 \xA1\0\0\b\0\0\0\b\x80\0\0\b@\0\0 \xE1\0\x07\0\0\bX\0\0\b\0\0 \x91\0\x07;\0\0\bx\0\0\b8\0\0 \xD1\0\x07\0\0\bh\0\0\b(\0\0 \xB1\0\0\b\b\0\0\b\x88\0\0\bH\0\0 \xF1\0\x07\0\0\bT\0\0\b\0\b\xE3\0\x07+\0\0\bt\0\0\b4\0\0 \xC9\0\x07\r\0\0\bd\0\0\b$\0\0 \xA9\0\0\b\0\0\b\x84\0\0\bD\0\0 \xE9\0\x07\b\0\0\b\\\0\0\b\0\0 \x99\0\x07S\0\0\b|\0\0\b<\0\0 \xD9\0\x07\0\0\bl\0\0\b,\0\0 \xB9\0\0\b\f\0\0\b\x8C\0\0\bL\0\0 \xF9\0\x07\0\0\bR\0\0\b\0\b\xA3\0\x07#\0\0\br\0\0\b2\0\0 \xC5\0\x07\v\0\0\bb\0\0\b"\0\0 \xA5\0\0\b\0\0\b\x82\0\0\bB\0\0 \xE5\0\x07\x07\0\0\bZ\0\0\b\0\0 \x95\0\x07C\0\0\bz\0\0\b:\0\0 \xD5\0\x07\0\0\bj\0\0\b*\0\0 \xB5\0\0\b
  6615. \0\0\b\x8A\0\0\bJ\0\0 \xF5\0\x07\0\0\bV\0\0\b\0@\b\0\0\x073\0\0\bv\0\0\b6\0\0 \xCD\0\x07\0\0\bf\0\0\b&\0\0 \xAD\0\0\b\0\0\b\x86\0\0\bF\0\0 \xED\0\x07 \0\0\b^\0\0\b\0\0 \x9D\0\x07c\0\0\b~\0\0\b>\0\0 \xDD\0\x07\x1B\0\0\bn\0\0\b.\0\0 \xBD\0\0\b\0\0\b\x8E\0\0\bN\0\0 \xFD\0\`\x07\0\0\0\bQ\0\0\b\0\b\x83\0\x07\0\0\bq\0\0\b1\0\0 \xC3\0\x07
  6616. \0\0\ba\0\0\b!\0\0 \xA3\0\0\b\0\0\b\x81\0\0\bA\0\0 \xE3\0\x07\0\0\bY\0\0\b\0\0 \x93\0\x07;\0\0\by\0\0\b9\0\0 \xD3\0\x07\0\0\bi\0\0\b)\0\0 \xB3\0\0\b \0\0\b\x89\0\0\bI\0\0 \xF3\0\x07\0\0\bU\0\0\b\0\b\x07+\0\0\bu\0\0\b5\0\0 \xCB\0\x07\r\0\0\be\0\0\b%\0\0 \xAB\0\0\b\0\0\b\x85\0\0\bE\0\0 \xEB\0\x07\b\0\0\b]\0\0\b\0\0 \x9B\0\x07S\0\0\b}\0\0\b=\0\0 \xDB\0\x07\0\0\bm\0\0\b-\0\0 \xBB\0\0\b\r\0\0\b\x8D\0\0\bM\0\0 \xFB\0\x07\0\0\bS\0\0\b\0\b\xC3\0\x07#\0\0\bs\0\0\b3\0\0 \xC7\0\x07\v\0\0\bc\0\0\b#\0\0 \xA7\0\0\b\0\0\b\x83\0\0\bC\0\0 \xE7\0\x07\x07\0\0\b[\0\0\b\x1B\0\0 \x97\0\x07C\0\0\b{\0\0\b;\0\0 \xD7\0\x07\0\0\bk\0\0\b+\0\0 \xB7\0\0\b\v\0\0\b\x8B\0\0\bK\0\0 \xF7\0\x07\0\0\bW\0\0\b\0@\b\0\0\x073\0\0\bw\0\0\b7\0\0 \xCF\0\x07\0\0\bg\0\0\b'\0\0 \xAF\0\0\b\x07\0\0\b\x87\0\0\bG\0\0 \xEF\0\x07 \0\0\b_\0\0\b\0\0 \x9F\0\x07c\0\0\b\x7F\0\0\b?\0\0 \xDF\0\x07\x1B\0\0\bo\0\0\b/\0\0 \xBF\0\0\b\0\0\b\x8F\0\0\bO\0\0 \xFF\0\0\0\x1B\0A\0@\0!\0  \0\b\x81\0@\0\0\0\x81\0\x1B\x07\0a\0\`\01\00\r\0\f\xC1\0@\0\0\0\0\0\0\x07\0\b\0 \0
  6617. \0\v\0\r\0\0\0\0\0\x1B\0\0#\0+\x003\0;\0C\0S\0c\0s\0\x83\0\xA3\0\xC3\0\xE3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xCB\0M\0\0\0\0\0\0\0\0\x07\0 \0\r\0\0\0!\x001\0A\0a\0\x81\0\xC1\0\x81\b\f 0@\`\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1B\0\x1B\0\0\0\0\0@\0@\0\xBE\xF3\xF8y\xECa\xF6?\xDE\xAA\x8C\x80\xF7{\xD5\xBF=\x88\xAFJ\xEDq\xF5?\xDBm\xC0\xA7\xF0\xBE\xD2\xBF\xB0\xF0\xF09\x95\xF4?g:Q\x7F\xAE\xD0\xBF\x85\xB8\xB0\x95\xC9\xF3?\xE9$\x82\xA6\xD81\xCB\xBF\xA5d\x88\f\r\xF3?Xw\xC0
  6618. OW\xC6\xBF\xA0\x8E\v{"^\xF2?\0\x81\x9C\xC7+\xAA\xC1\xBF?4JJ\xBB\xF1?^\x8C\xCEvN\xBA\xBF\xBA\xE5\x8A\xF0X#\xF1?\xCCaZ<\x97\xB1\xBF\xA7\0\x99A?\x95\xF0?\f\xE18\xF4R\xA2\xBF\0\0\0\0\0\0\xF0?\0\0\0\0\0\0\0\0\xACG\x9A\xFD\x8C\`\xEE?\x84Y\xF2]\xAA\xA5\xAA?\xA0j\xB3\xA4\xEC?\xB4.6\xAAS^\xBC?\xE6\xFCjW6 \xEB?\b\xDB w\xE5&\xC5?-\xAA\xA1c\xD1\xC2\xE9?pG"\r\x86\xC2\xCB?\xEDAx\xE6\x86\xE8?\xE1~\xA0\xC8\x8B\xD1?bHS\xF5\xDCg\xE7? \xEE\xB6W0\xD4?\xEF9\xFA\xFEB.\xE6?4\x83\xB8H\xA3\xD0\xBFj\v\xE0\v[W\xD5?#A
  6619. \xF2\xFE\xFF\xDF\xBF\xB8e\0A\xC0\xF1\0\vA\0\v\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\v\0\0\0\0\0\0\0\0\0
  6620. 
  6621. \x07\0\0 \v\0\0 \v\0\0\v\0\0\0\0\0A\x91\xF2\0\v!\0\0\0\0\0\0\0\0\0\v\r\0\r\0\0\0 \0\0\0 \0\0\0\0A\xCB\xF2\0\v\f\0A\xD7\xF2\0\v\0\0\0\0\0\0\0\0 \f\0\0\0\0\0\f\0\0\f\0A\x85\xF3\0\v\0A\x91\xF3\0\v\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0A\xBF\xF3\0\v\0A\xCB\xF3\0\v\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0A\x82\xF4\0\v\0\0\0\0\0\0\0\0\0 \0A\xB3\xF4\0\v\0A\xBF\xF4\0\v\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0A\xED\xF4\0\v\0A\xF9\xF4\0\v\xB8\x07\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\x000123456789ABCDEF\0\0\0\0X;\0\x006\0\0\x007\0\0\x008\0\0\x009\0\0\0:\0\0\0;\0\0\0<\0\0\0=\0\0\0>\0\0\0?\0\0\0@\0\0\0A\0\0\0B\0\0\0C\0\0\0\0\0\0\0t<\0\0D\0\0\0E\0\0\x008\0\0\x009\0\0\0F\0\0\0G\0\0\0<\0\0\0=\0\0\0>\0\0\0H\0\0\0@\0\0\0I\0\0\0B\0\0\0J\0\0\0\xCCd\0\0,;\0\0>\0\0NSt3__29basic_iosIcNS_11char_traitsIcEEEE\0\0\0\xA4d\0\0\`;\0\0NSt3__215basic_streambufIcNS_11char_traitsIcEEEE\0\0\0\0(e\0\0\xAC;\0\0\0\0\0\0\0\0\0 ;\0\0\xF4\xFF\xFFNSt3__213basic_istreamIcNS_11char_traitsIcEEEE\0\0(e\0\0\xF4;\0\0\0\0\0\0\0\0\0 ;\0\0\xF4\xFF\xFFNSt3__213basic_ostreamIcNS_11char_traitsIcEEEE\0\0(e\0\0D<\0\0\0\0\0\0\0\0\x94;\0\0\0\0\0\xDC;\0\0\b\0\0NSt3__214basic_iostreamIcNS_11char_traitsIcEEEE\0\xCCd\0\0\x80<\0\0X;\0\0NSt3__215basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\0@\0\0\0\0\0\0\0\xB4=\0\0K\0\0\0L\0\0\x008\0\0\0\xF8\xFF\xFF\xFF\xB4=\0\0M\0\0\0N\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF\xB4=\0\0O\0\0\0P\0\0\0\xD0<\0\x004=\0\0p=\0\0\x84=\0\0\x98=\0\0\xAC=\0\0\\=\0\0H=\0\0\xF8<\0\0\xE4<\0\0@\0\0\0\0\0\0\0$<\0\0Q\0\0\0R\0\0\x008\0\0\0\xF8\xFF\xFF\xFF$<\0\0S\0\0\0T\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF$<\0\0U\0\0\0V\0\0\0@\0\0\0\0\0\0\0\x94;\0\0W\0\0\0X\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF\x94;\0\0Y\0\0\0Z\0\0\x008\0\0\0\0\0\0\0\xDC;\0\0[\0\0\0\\\0\0\0\xC8\xFF\xFF\xFF\xC8\xFF\xFF\xFF\xDC;\0\0]\0\0\0^\0\0\0\xCCd\0\0\xC0=\0\0$<\0\0NSt3__218basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\0\0\0\0\0\0>\0\0_\0\0\0\`\0\0\0\xA4d\0\0 >\0\0NSt3__28ios_baseE\0A\xC0\xFC\0\v#\xDE\x95\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF@>\0\0\0\0\0C.UTF-8\0A\x90\xFD\0\vT>\0A\xB0\xFD\0\vGLC_CTYPE\0\0\0\0LC_NUMERIC\0\0LC_TIME\0\0\0\0\0LC_COLLATE\0\0LC_MONETARY\0LC_MESSAGES\0A\x84\xFE\0\v-\x80\xDE(\0\x80\xC8M\0\0\xA7v\0\x004\x9E\0\x80\xC7\0\x80\x9F\xEE\0\0~\x80\\@\x80\xE9g\0\xC8\x90\0U\xB8.\0A\xC0\xFE\0\v\xD2Sun\0Mon\0Tue\0Wed\0Thu\0Fri\0Sat\0Sunday\0Monday\0Tuesday\0Wednesday\0Thursday\0Friday\0Saturday\0Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec\0January\0February\0March\0April\0May\0June\0July\0August\0September\0October\0November\0December\0AM\0PM\0%a %b %e %T %Y\0%m/%d/%y\0%H:%M:%S\0%I:%M:%S %p\0\0\0%m/%d/%y\x000123456789\0%a %b %e %T %Y\0%H:%M:%S\0\0\0\0\0^[yY]\0^[nN]\0yes\0no\0A\xA0\x81\v\xE1\xD1t\x9E\0W\x9D\xBD*\x80pR\xFF\xFF>'
  6622. \0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\0\x005\0\0\0q\0\0\0k\xFF\xFF\xFF\xCE\xFB\xFF\xFF\x92\xBF\xFF\xFF\0\0\0\0\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x07\b \xFF\xFF\xFF\xFF\xFF\xFF\xFF
  6623. \v\f\r\x1B !"#\xFF\xFF\xFF\xFF\xFF\xFF
  6624. \v\f\r\x1B !"#\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x07\0\0\0\0\0\0\0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\x07\0\0\xC0\b\0\0\xC0 \0\0\xC0
  6625. \0\0\xC0\v\0\0\xC0\f\0\0\xC0\r\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\x1B\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\xC0\0\0\0\xB3\0\0\xC3\0\0\xC3\0\0\xC3\0\0\xC3\0\0\xC3\0\0\xC3\x07\0\0\xC3\b\0\0\xC3 \0\0\xC3
  6626. \0\0\xC3\v\0\0\xC3\f\0\0\xC3\r\0\0\xD3\0\0\xC3\0\0\xC3\0\0\f\xBB\0\f\xC3\0\f\xC3\0\f\xC3\0\f\xDB\0\0\0\x000123456789abcdefABCDEFxX+-pPiInN\0%I:%M:%S %p%H:%M\0A\x90\x86\v\x81%\0\0\0m\0\0\0/\0\0\0%\0\0\0d\0\0\0/\0\0\0%\0\0\0y\0\0\0%\0\0\0Y\0\0\0-\0\0\0%\0\0\0m\0\0\0-\0\0\0%\0\0\0d\0\0\0%\0\0\0I\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0 \0\0\0%\0\0\0p\0\0\0\0\0\0\0%\0\0\0H\0\0\0:\0\0\0%\0\0\0M\0A\xA0\x87\ve%\0\0\0H\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0\0\0\0\0\0M\0\0t\0\0\0u\0\0\0v\0\0\0\0\0\0\0dM\0\0w\0\0\0x\0\0\0v\0\0\0y\0\0\0z\0\0\0{\0\0\0|\0\0\0}\0\0\0~\0\0\0\x7F\0\0\0\x80\0A\x90\x88\v\xFD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0B\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0*\0\0*\0\0*\0\0*\0\0*\0\0*\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0*\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\x002\0\x002\0\x002\0\x002\0\x002\0\x002\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\x002\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\x82\0\0\0\0A\x94\x90\v\xED\xBCL\0\0\x81\0\0\0\x82\0\0\0v\0\0\0\x83\0\0\0\x84\0\0\0\x85\0\0\0\x86\0\0\0\x87\0\0\0\x88\0\0\0\x89\0\0\0\0\0\0\0\x98M\0\0\x8A\0\0\0\x8B\0\0\0v\0\0\0\x8C\0\0\0\x8D\0\0\0\x8E\0\0\0\x8F\0\0\0\x90\0\0\0\0\0\0\0\xBCM\0\0\x91\0\0\0\x92\0\0\0v\0\0\0\x93\0\0\0\x94\0\0\0\x95\0\0\0\x96\0\0\0\x97\0\0\0t\0\0\0r\0\0\0u\0\0\0e\0\0\0\0\0\0\0f\0\0\0a\0\0\0l\0\0\0s\0\0\0e\0\0\0\0\0\0\0%\0\0\0m\0\0\0/\0\0\0%\0\0\0d\0\0\0/\0\0\0%\0\0\0y\0\0\0\0\0\0\0%\0\0\0H\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0\0\0\0\0%\0\0\0a\0\0\0 \0\0\0%\0\0\0b\0\0\0 \0\0\0%\0\0\0d\0\0\0 \0\0\0%\0\0\0H\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0 \0\0\0%\0\0\0Y\0\0\0\0\0\0\0%\0\0\0I\0\0\0:\0\0\0%\0\0\0M\0\0\0:\0\0\0%\0\0\0S\0\0\0 \0\0\0%\0\0\0p\0A\x8C\x93\v\xFD'\x9CI\0\0\x98\0\0\0\x99\0\0\0v\0\0\0\xCCd\0\0\xA8I\0\0\xF0a\0\0NSt3__26locale5facetE\0\0\0\0\0\0\0J\0\0\x98\0\0\0\x9A\0\0\0v\0\0\0\x9B\0\0\0\x9C\0\0\0\x9D\0\0\0\x9E\0\0\0\x9F\0\0\0\xA0\0\0\0\xA1\0\0\0\xA2\0\0\0\xA3\0\0\0\xA4\0\0\0\xA5\0\0\0\xA6\0\0\0(e\0\0$J\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x008J\0\0\0\0\0NSt3__25ctypeIwEE\0\0\0\xA4d\0\0@J\0\0NSt3__210ctype_baseE\0\0\0\0\0\0\0\0\x88J\0\0\x98\0\0\0\xA7\0\0\0v\0\0\0\xA8\0\0\0\xA9\0\0\0\xAA\0\0\0\xAB\0\0\0\xAC\0\0\0\xAD\0\0\0\xAE\0\0\0(e\0\0\xA8J\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIcc11__mbstate_tEE\0\0\0\xA4d\0\0\xD4J\0\0NSt3__212codecvt_baseE\0\0\0\0\0\0K\0\0\x98\0\0\0\xAF\0\0\0v\0\0\0\xB0\0\0\0\xB1\0\0\0\xB2\0\0\0\xB3\0\0\0\xB4\0\0\0\xB5\0\0\0\xB6\0\0\0(e\0\0<K\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIDsc11__mbstate_tEE\0\0\0\0\0\0\x90K\0\0\x98\0\0\0\xB7\0\0\0v\0\0\0\xB8\0\0\0\xB9\0\0\0\xBA\0\0\0\xBB\0\0\0\xBC\0\0\0\xBD\0\0\0\xBE\0\0\0(e\0\0\xB0K\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIDsDu11__mbstate_tEE\0\0\0\0\0L\0\0\x98\0\0\0\xBF\0\0\0v\0\0\0\xC0\0\0\0\xC1\0\0\0\xC2\0\0\0\xC3\0\0\0\xC4\0\0\0\xC5\0\0\0\xC6\0\0\0(e\0\0$L\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIDic11__mbstate_tEE\0\0\0\0\0\0xL\0\0\x98\0\0\0\xC7\0\0\0v\0\0\0\xC8\0\0\0\xC9\0\0\0\xCA\0\0\0\xCB\0\0\0\xCC\0\0\0\xCD\0\0\0\xCE\0\0\0(e\0\0\x98L\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIDiDu11__mbstate_tEE\0(e\0\0\xDCL\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xCCJ\0\0\0\0\0NSt3__27codecvtIwc11__mbstate_tEE\0\0\0\xCCd\0\0\fM\0\0\x9CI\0\0NSt3__26locale5__impE\0\0\0\xCCd\0\x000M\0\0\x9CI\0\0NSt3__27collateIcEE\0\xCCd\0\0PM\0\0\x9CI\0\0NSt3__27collateIwEE\0(e\0\0\x84M\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x008J\0\0\0\0\0NSt3__25ctypeIcEE\0\0\0\xCCd\0\0\xA4M\0\0\x9CI\0\0NSt3__28numpunctIcEE\0\0\0\0\xCCd\0\0\xC8M\0\0\x9CI\0\0NSt3__28numpunctIwEE\0\0\0\0\0\0\0\0$M\0\0\xCF\0\0\0\xD0\0\0\0v\0\0\0\xD1\0\0\0\xD2\0\0\0\xD3\0\0\0\0\0\0\0DM\0\0\xD4\0\0\0\xD5\0\0\0v\0\0\0\xD6\0\0\0\xD7\0\0\0\xD8\0\0\0\0\0\0\0\`N\0\0\x98\0\0\0\xD9\0\0\0v\0\0\0\xDA\0\0\0\xDB\0\0\0\xDC\0\0\0\xDD\0\0\0\xDE\0\0\0\xDF\0\0\0\xE0\0\0\0\xE1\0\0\0\xE2\0\0\0\xE3\0\0\0\xE4\0\0\0(e\0\0\x80N\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xC4N\0\0\0\0\0\0NSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0(e\0\0\xDCN\0\0\0\0\0\0\0\0\0\xF4N\0\0\0\0\0\0NSt3__29__num_getIcEE\0\0\0\xA4d\0\0\xFCN\0\0NSt3__214__num_get_baseE\0\0\0\0\0\0\0\0XO\0\0\x98\0\0\0\xE5\0\0\0v\0\0\0\xE6\0\0\0\xE7\0\0\0\xE8\0\0\0\xE9\0\0\0\xEA\0\0\0\xEB\0\0\0\xEC\0\0\0\xED\0\0\0\xEE\0\0\0\xEF\0\0\0\xF0\0\0\0(e\0\0xO\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xBCO\0\0\0\0\0\0NSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0(e\0\0\xD4O\0\0\0\0\0\0\0\0\0\xF4N\0\0\0\0\0\0NSt3__29__num_getIwEE\0\0\0\0\0\0\0 P\0\0\x98\0\0\0\xF1\0\0\0v\0\0\0\xF2\0\0\0\xF3\0\0\0\xF4\0\0\0\xF5\0\0\0\xF6\0\0\0\xF7\0\0\0\xF8\0\0\0\xF9\0\0\0(e\0\0@P\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\x84P\0\0\0\0\0\0NSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0(e\0\0\x9CP\0\0\0\0\0\0\0\0\0\xB4P\0\0\0\0\0\0NSt3__29__num_putIcEE\0\0\0\xA4d\0\0\xBCP\0\0NSt3__214__num_put_baseE\0\0\0\0\0\0\0\0\fQ\0\0\x98\0\0\0\xFA\0\0\0v\0\0\0\xFB\0\0\0\xFC\0\0\0\xFD\0\0\0\xFE\0\0\0\xFF\0\0\0\0\0\0\0\0\0\0(e\0\0,Q\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0pQ\0\0\0\0\0\0NSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0(e\0\0\x88Q\0\0\0\0\0\0\0\0\0\xB4P\0\0\0\0\0\0NSt3__29__num_putIwEE\0\0\0\0\0\0\0\xF4Q\0\0\0\0\0\0v\0\0\0\0\0\0\0\x07\0\0\b\0\0 \0\0
  6627. \0\0\v\0\0\xF8\xFF\xFF\xFF\xF4Q\0\0\f\0\0\r\0\0\0\0\0\0\0\0\0\0\0\0(e\0\0R\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0dR\0\0\0\0\0\x80R\0\0\0\b\0\0NSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\0\xA4d\0\0lR\0\0NSt3__29time_baseE\0\0\xA4d\0\0\x88R\0\0NSt3__220__time_get_c_storageIcEE\0\0\0\0\0\0\0\0S\0\0\0\0\0\0v\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1B\0\0\xF8\xFF\xFF\xFF\0S\0\0\0\0\0\0\0\0\0\0 \0\0!\0\0"\0\0(e\0\0(S\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0dR\0\0\0\0\0pS\0\0\0\b\0\0NSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\0\xA4d\0\0xS\0\0NSt3__220__time_get_c_storageIwEE\0\0\0\0\0\0\0\xB4S\0\0#\0\0$\0\0v\0\0\0%\0\0(e\0\0\xD4S\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0T\0\0\0\b\0\0NSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\0\xA4d\0\0$T\0\0NSt3__210__time_putE\0\0\0\0\0\0\0\0TT\0\0&\0\0'\0\0v\0\0\0(\0\0(e\0\0tT\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0T\0\0\0\b\0\0NSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\0\0\0\0\0\xF4T\0\0\x98\0\0\0)\0\0v\0\0\0*\0\0+\0\0,\0\0-\0\0.\0\0/\0\x000\0\x001\0\x002\0\0(e\0\0U\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIcLb0EEE\0\xA4d\0\x008U\0\0NSt3__210money_baseE\0\0\0\0\0\0\0\0\x88U\0\0\x98\0\0\x003\0\0v\0\0\x004\0\x005\0\x006\0\x007\0\x008\0\x009\0\0:\0\0;\0\0<\0\0(e\0\0\xA8U\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIcLb1EEE\0\0\0\0\0\xFCU\0\0\x98\0\0\0=\0\0v\0\0\0>\0\0?\0\0@\0\0A\0\0B\0\0C\0\0D\0\0E\0\0F\0\0(e\0\0V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb0EEE\0\0\0\0\0pV\0\0\x98\0\0\0G\0\0v\0\0\0H\0\0I\0\0J\0\0K\0\0L\0\0M\0\0N\0\0O\0\0P\0\0(e\0\0\x90V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb1EEE\0\0\0\0\0\xC8V\0\0\x98\0\0\0Q\0\0v\0\0\0R\0\0S\0\0(e\0\0\xE8V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000W\0\0\0\0\0\0NSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\xA4d\0\x008W\0\0NSt3__211__money_getIcEE\0\0\0\0\0\0\0\0pW\0\0\x98\0\0\0T\0\0v\0\0\0U\0\0V\0\0(e\0\0\x90W\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xD8W\0\0\0\0\0\0NSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\xA4d\0\0\xE0W\0\0NSt3__211__money_getIwEE\0\0\0\0\0\0\0\0X\0\0\x98\0\0\0W\0\0v\0\0\0X\0\0Y\0\0(e\0\x008X\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\x80X\0\0\0\0\0\0NSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\xA4d\0\0\x88X\0\0NSt3__211__money_putIcEE\0\0\0\0\0\0\0\0\xC0X\0\0\x98\0\0\0Z\0\0v\0\0\0[\0\0\\\0\0(e\0\0\xE0X\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0(Y\0\0\0\0\0\0NSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\xA4d\0\x000Y\0\0NSt3__211__money_putIwEE\0\0\0\0\0\0\0\0lY\0\0\x98\0\0\0]\0\0v\0\0\0^\0\0_\0\0\`\0\0(e\0\0\x8CY\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xA4Y\0\0\0\0\0NSt3__28messagesIcEE\0\0\0\0\xA4d\0\0\xACY\0\0NSt3__213messages_baseE\0\0\0\0\0\xE4Y\0\0\x98\0\0\0a\0\0v\0\0\0b\0\0c\0\0d\0\0(e\0\0Z\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xA4Y\0\0\0\0\0NSt3__28messagesIwEE\0\0\0\0S\0\0\0u\0\0\0n\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0M\0\0\0o\0\0\0n\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0T\0\0\0u\0\0\0e\0\0\0s\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0W\0\0\0e\0\0\0d\0\0\0n\0\0\0e\0\0\0s\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0T\0\0\0h\0\0\0u\0\0\0r\0\0\0s\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0F\0\0\0r\0\0\0i\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0S\0\0\0a\0\0\0t\0\0\0u\0\0\0r\0\0\0d\0\0\0a\0\0\0y\0\0\0\0\0\0\0S\0\0\0u\0\0\0n\0\0\0\0\0\0\0M\0\0\0o\0\0\0n\0\0\0\0\0\0\0T\0\0\0u\0\0\0e\0\0\0\0\0\0\0W\0\0\0e\0\0\0d\0\0\0\0\0\0\0T\0\0\0h\0\0\0u\0\0\0\0\0\0\0F\0\0\0r\0\0\0i\0\0\0\0\0\0\0S\0\0\0a\0\0\0t\0\0\0\0\0\0\0J\0\0\0a\0\0\0n\0\0\0u\0\0\0a\0\0\0r\0\0\0y\0\0\0\0\0\0\0F\0\0\0e\0\0\0b\0\0\0r\0\0\0u\0\0\0a\0\0\0r\0\0\0y\0\0\0\0\0\0\0M\0\0\0a\0\0\0r\0\0\0c\0\0\0h\0\0\0\0\0\0\0A\0\0\0p\0\0\0r\0\0\0i\0\0\0l\0\0\0\0\0\0\0M\0\0\0a\0\0\0y\0\0\0\0\0\0\0J\0\0\0u\0\0\0n\0\0\0e\0\0\0\0\0\0\0J\0\0\0u\0\0\0l\0\0\0y\0\0\0\0\0\0\0A\0\0\0u\0\0\0g\0\0\0u\0\0\0s\0\0\0t\0\0\0\0\0\0\0S\0\0\0e\0\0\0p\0\0\0t\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0O\0\0\0c\0\0\0t\0\0\0o\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0N\0\0\0o\0\0\0v\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0D\0\0\0e\0\0\0c\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0J\0\0\0a\0\0\0n\0\0\0\0\0\0\0F\0\0\0e\0\0\0b\0\0\0\0\0\0\0M\0\0\0a\0\0\0r\0\0\0\0\0\0\0A\0\0\0p\0\0\0r\0\0\0\0\0\0\0J\0\0\0u\0\0\0n\0\0\0\0\0\0\0J\0\0\0u\0\0\0l\0\0\0\0\0\0\0A\0\0\0u\0\0\0g\0\0\0\0\0\0\0S\0\0\0e\0\0\0p\0\0\0\0\0\0\0O\0\0\0c\0\0\0t\0\0\0\0\0\0\0N\0\0\0o\0\0\0v\0\0\0\0\0\0\0D\0\0\0e\0\0\0c\0\0\0\0\0\0\0A\0\0\0M\0\0\0\0\0\0\0P\0\0\0M\0A\x94\xBB\v\x98
  6628. \0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\xCA\x9A;\0\0\0\0\0\0\0\x0000010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\0\0\0\0\0\0\0\x00000000010010001101000101011001111000100110101011110011011110111100010203040506071011121314151617202122232425262730313233343536374041424344454647505152535455565760616263646566677071727374757677000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\0\0\0\0\0\0\0\0
  6629. \0\0\0\0\0\0\0d\0\0\0\0\0\0\0\xE8\0\0\0\0\0\0'\0\0\0\0\0\0\xA0\x86\0\0\0\0\0@B\0\0\0\0\0\x80\x96\x98\0\0\0\0\0\0\xE1\xF5\0\0\0\0\0\xCA\x9A;\0\0\0\0\0\xE4\vT\0\0\0\0\xE8vH\0\0\0\0\xA5\xD4\xE8\0\0\0\0\xA0rN \0\0\0@z\xF3Z\0\0\0\x80\xC6\xA4~\x8D\0\0\0\xC1o\xF2\x86#\0\0\0\x8A]xEc\0\0d\xA7\xB3\xB6\xE0\r\0\0\xE8\x89#\xC7\x8A\xA4d\0\0\xF8a\0\0NSt3__214__shared_countE\0\0\0\0hf\0\0\xCCd\0\0$b\0\0\x98e\0\0N10__cxxabiv116__shim_type_infoE\0\0\0\0\xCCd\0\0Tb\0\0b\0\0N10__cxxabiv117__class_type_infoE\0\0\0\xCCd\0\0\x84b\0\0b\0\0N10__cxxabiv117__pbase_type_infoE\0\0\0\xCCd\0\0\xB4b\0\0xb\0\0N10__cxxabiv119__pointer_type_infoE\0\xCCd\0\0\xE4b\0\0b\0\0N10__cxxabiv120__function_type_infoE\0\0\0\0\xCCd\0\0c\0\0xb\0\0N10__cxxabiv129__pointer_to_member_type_infoE\0\0\0\0\0\0\0dc\0\0g\0\0h\0\0i\0\0j\0\0k\0\0\xCCd\0\0pc\0\0b\0\0N10__cxxabiv123__fundamental_type_infoE\0Pc\0\0\xA0c\0\0v\0Dn\0\0\0\0Pc\0\0\xB0c\0\0b\0\0\0Pc\0\0\xBCc\0\0c\0\0\0Pc\0\0\xC8c\0\0h\0\0\0Pc\0\0\xD4c\0\0a\0\0\0Pc\0\0\xE0c\0\0s\0\0\0Pc\0\0\xECc\0\0t\0\0\0Pc\0\0\xF8c\0\0i\0\0\0Pc\0\0d\0\0j\0\0\0Pc\0\0d\0\0l\0\0\0Pc\0\0d\0\0m\0\0\0Pc\0\0(d\0\0x\0\0\0Pc\0\x004d\0\0y\0\0\0Pc\0\0@d\0\0f\0\0\0Pc\0\0Ld\0\0d\0\0\0\0\0\0\0ld\0\0g\0\0l\0\0i\0\0j\0\0m\0\0\xCCd\0\0xd\0\0b\0\0N10__cxxabiv116__enum_type_infoE\0\0\0\0\0\0\0\0Hb\0\0g\0\0n\0\0i\0\0j\0\0o\0\0p\0\0q\0\0r\0\0\0\0\0\0\xECd\0\0g\0\0s\0\0i\0\0j\0\0o\0\0t\0\0u\0\0v\0\0\xCCd\0\0\xF8d\0\0Hb\0\0N10__cxxabiv120__si_class_type_infoE\0\0\0\0\0\0\0\0He\0\0g\0\0w\0\0i\0\0j\0\0o\0\0x\0\0y\0\0z\0\0\xCCd\0\0Te\0\0Hb\0\0N10__cxxabiv121__vmi_class_type_infoE\0\0\0\0\0\0\0\xA8b\0\0g\0\0{\0\0i\0\0j\0\0|\0\0\xA4d\0\0\xA0e\0\0St9type_info\0A\xB1\xCB\v\b \0\0\0\0\0\0\0A\xC4\xCB\v1\0A\xDC\xCB\v2\0\0\x003\0\0\0\xF8g\0\0\0\0A\xF4\xCB\v\0A\x84\xCC\v\xFF\xFF\xFF\xFF
  6630. \0A\xC8\xCC\v!\xB8e\0\0@v\0%m/%d/%y\0\0\0\b%H:%M:%S\0\0\0\b\0A\xF4\xCC\ve\0A\x8C\xCD\v
  6631. 2\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),ue((await k(ne)).instance))})(),(function(){function ue(){var ne;if(r.calledRun=!0,!m){if(C=!0,vy.H(),y?.(r),(ne=r.onRuntimeInitialized)==null||ne.call(r),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var xe=r.postRun.shift();F.push(xe)}V(F)}}if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)q();V(W),r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),ue()},1)):ue()})(),C?o=r:o=new Promise((ue,ne)=>{y=ue,x=ne}),o}var WC=(e,t,n)=>{let i=e.vf32_ptr(t),o=t.size(),r=i>>2,a=e.HEAPF32.slice(r,r+o);if(n!==void 0)for(let s=0;s<o;s++)a[s]=n(a[s]);return a},r5e=e=>1/(1+Math.exp(-e)),a5e=e=>t=>t*e+.5,s5e=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:WC(e,t.positions),scales:WC(e,t.scales,Math.exp),rotations:WC(e,t.rotations),alphas:WC(e,t.alphas,r5e),colors:WC(e,t.colors,a5e(i)),sh:WC(e,t.sh)}},c5e=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},kue=async(e,t)=>{var n;let i=await o5e(),o=e instanceof Uint8Array?e:new Uint8Array(e),r=null;try{if(r=i._malloc(Uint8Array.BYTES_PER_ELEMENT*o.length),r===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(o,r/Uint8Array.BYTES_PER_ELEMENT);let a=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],s=i.load_spz(r,o.length,{coordinateSystem:a}),c=s5e(i,s,t);return c5e(i,s),c}catch(a){throw a}finally{r!==null&&i._free(r)}};var l5e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var u5e=[0,9,24,45],f5e=14,d5e=1.6*1024*1024*1024;function h5e(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let o=e?.accessors?.[i];if(!l(o)||o.count<=0)return;let r=0;for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a)){let s=/SH_DEGREE_(\d+)_COEF_/.exec(a);s&&(r=Math.max(r,parseInt(s[1],10)))}return{numPoints:o.count,shDegree:r}}function m5e(e,t){let n=f5e+(u5e[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var UY=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.spz,a=t.gltfResource,s=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=a,this._baseResource=s,this._gltf=i,this._primitive=o,this._spz=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=gt.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=p5e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(l(this._spzError)&&VY(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=h5e(this._gltf,this._primitive);if(l(n)){let o=m5e(n.numPoints,n.shDegree);if(o>d5e){let r=Math.round(o/1048576);return VY(this,new re(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${r} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=kue(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=g5e(this,i)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function p5e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:0,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;VY(e,n)}}function VY(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load SPZ",t)}async function g5e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var p2=UY;function tD(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=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=qe(e.extras,!0),this._extensions=qe(e.extensions,!0)}tD.fromJson=function(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=v0.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new tD({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(tD.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}}});tD.BATCH_TABLE_CLASS_NAME="_batchTable";var Hm=tD;function g2(e){e=e??G.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=qe(e.extras,!0),this._extensions=qe(e.extensions,!0)}g2.fromJson=function(e){return new g2({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(g2.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 _2=g2;function A2(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let s=0;s<r;++s){let c=n[s];i[c.value]=c.name,o[c.name]=c.value}let a=e.valueType??Rt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=a,this._id=t,this._name=e.name,this._description=e.description,this._extras=qe(e.extras,!0),this._extensions=qe(e.extensions,!0)}A2.fromJson=function(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(o){return _2.fromJson(o)});return new A2({id:t,values:i,valueType:Rt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(A2.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 y2=A2;function x2(e){e=e??G.EMPTY_OBJECT;let t=e.classes??{},n=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=qe(e.extras,!0),this._extensions=qe(e.extensions,!0)}x2.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=y2.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]=Hm.fromJson({id:i,class:e.classes[i],enums:t}));return new x2({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(x2.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 du=x2;var jY=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.schema,i=t.resource,o=t.cacheKey;this._schema=l(n)?du.fromJson(n):void 0,this._resource=i,this._cacheKey=o,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=_5e(this),this._promise)}unload(){this._schema=void 0}};async function _5e(e){let t=e._resource;e._state=gt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=du.fromJson(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var lx=jY;var ed={};function qC(e){return Jd(e.url)}function nD(e){let{byteOffset:t,byteLength:n}=e;if(vi(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function A5e(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function zue(e,t){return`${qC(e)}-buffer-id-${t}`}function YC(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return qC(o)}return zue(n,t)}function GY(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],a=r.buffer,s=e.buffers[a],c=YC(s,a,n,i),u=nD(r);return`${c}-range-${u}`}function Uue(e,t,n,i){let r=e.bufferViews[0],a=r.buffer,s=e.buffers[a],c=YC(s,a,n,i),u=nD(r);return`${c}-range-${u}`}function Vue(e,t,n,i){let o=e.images[t],r=o.bufferView,a=o.uri;if(l(a)){let p=i.getDerivedResource({url:a});return qC(p)}let s=e.bufferViews[r],c=s.buffer,u=e.buffers[c],f=YC(u,c,n,i),d=nD(s);return`${f}-range-${d}`}function y5e(e,t){let n=Zu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}ed.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${qC(n)}`};ed.getExternalBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${qC(t)}`};ed.getEmbeddedBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${zue(t,n)}`};ed.getGltfCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${qC(t)}`};ed.getBufferViewCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],a=r.buffer,s=t.buffers[a];vi(r,"EXT_meshopt_compression")&&(a=r.extensions.EXT_meshopt_compression.buffer);let c=YC(s,a,i,o),u=nD(r);return`buffer-view:${c}-range-${u}`};ed.getDracoCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${GY(t,n,i,o)}`};ed.getSpzCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,primitive:n,gltfResource:i,baseResource:o}=e;return`spz:${Uue(t,n,i,o)}`};ed.getVertexBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,spz:s,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:d=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${o.context.id}`),d&&(p+="-typed-array"),l(a))return`vertex-buffer:${GY(t,a,n,i)}-draco-${c}${p}`;if(s)return`vertex-buffer:${Uue(t,s,n,i)}-spz-${c}${p}`;let g=t.bufferViews[r],m=g.buffer,A=t.buffers[m],y=YC(A,m,n,i),x=nD(g);return`vertex-buffer:${y}-range-${x}${p}`};ed.getIndexBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:s=!1,loadTypedArray:c=!1}=e,u="";if(s&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(a))return`index-buffer:${GY(t,a,i,o)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],A=YC(m,g,i,o),y=A5e(f,p);return`index-buffer:${A}-accessor-${y}${u}`};ed.getImageCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${Vue(t,n,i,o)}`};ed.getTextureCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a}=e,s=n.index,c=Zu.getImageIdFromTexture({gltf:t,textureId:s,supportedImageFormats:r}),u=Vue(t,c,i,o),f=y5e(t,n);return`texture:${u}-sampler-${f}-context-${a.context.id}`};var hu=ed;function iD(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}iD.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};iD.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};iD.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};iD.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 b2=iD;function Rn(){}Rn.cacheEntries={};Rn.statistics=new b2;function x5e(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Rn.get=function(e){let t=Rn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Rn.add=function(e){let t=e.cacheKey;return Rn.cacheEntries[t]=new x5e(e),e};Rn.unload=function(e){let t=e.cacheKey,n=Rn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Rn.statistics.removeLoader(e),e.destroy(),delete Rn.cacheEntries[t])};Rn.getSchemaLoader=function(e){e=e??G.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=hu.getSchemaCacheKey({schema:t,resource:n}),o=Rn.get(i);return l(o)?o:(o=new lx({schema:t,resource:n,cacheKey:i}),Rn.add(o))};Rn.getEmbeddedBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,o=hu.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Rn.get(o);return l(r)?r:(r=new FC({typedArray:i,cacheKey:o}),Rn.add(r))};Rn.getExternalBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{resource:t}=e,n=hu.getExternalBufferCacheKey({resource:t}),i=Rn.get(n);return l(i)?i:(i=new FC({resource:t,cacheKey:n}),Rn.add(i))};Rn.getGltfJsonLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=hu.getGltfCacheKey({gltfResource:t}),a=Rn.get(r);return l(a)?a:(a=new JI({resourceCache:Rn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Rn.add(a))};Rn.getBufferViewLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=hu.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),a=Rn.get(r);return l(a)?a:(a=new qI({resourceCache:Rn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Rn.add(a))};Rn.getDracoLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e,a=hu.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),s=Rn.get(a);return l(s)?s:(s=new YI({resourceCache:Rn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:a}),Rn.add(s))};Rn.getSpzLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:o,baseResource:r}=e,a=hu.getSpzCacheKey({gltf:t,primitive:n,gltfResource:o,baseResource:r}),s=Rn.get(a);return l(s)?s:(s=new p2({resourceCache:Rn,gltf:t,primitive:n,spz:i,gltfResource:o,baseResource:r,cacheKey:a}),Rn.add(s))};Rn.getVertexBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:a,draco:s,spz:c,attributeSemantic:u,accessorId:f,asynchronous:d=!0,dequantize:p=!1,loadBuffer:g=!1,loadTypedArray:m=!1}=e,A=hu.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:g,loadTypedArray:m}),y=Rn.get(A);return l(y)?y:(y=new eD({resourceCache:Rn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:a,draco:s,spz:c,attributeSemantic:u,accessorId:f,cacheKey:A,asynchronous:d,dequantize:p,loadBuffer:g,loadTypedArray:m}),Rn.add(y))};Rn.getIndexBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:a,draco:s,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=hu.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:u,loadTypedArray:f}),p=Rn.get(d);return l(p)?p:(p=new QI({resourceCache:Rn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:a,draco:s,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Rn.add(p))};Rn.getImageLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=hu.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),a=Rn.get(r);return l(a)?a:(a=new KI({resourceCache:Rn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Rn.add(a))};Rn.getTextureLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a,asynchronous:s=!0}=e,c=hu.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a}),u=Rn.get(c);return l(u)?u:(u=new ZI({resourceCache:Rn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:s}),Rn.add(u))};Rn.clearForSpecs=function(){let e=[eD,QI,YI,ZI,KI,qI,FC,lx,JI],t,n=Rn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,a){let s=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(a.resourceLoader.constructor);return s-c});let o=i.length;for(let r=0;r<o;++r){let a=i[r];t=a.resourceLoader.cacheKey,l(n[t])&&(a.resourceLoader.destroy(),delete n[t])}Rn.statistics.clear()};var Pi=Rn;function qs(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(qs.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}}});qs.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};qs.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};qs.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};qs.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};qs.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};qs.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};qs.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};qs.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Va.OCTREE&&(t=3),e>>t};qs.fromSubtreeJson=async function(e,t,n,i,o){let r=new qs(e,i,o),a;l(t)?a={json:t,binary:void 0}:a=b5e(n);let s=a.json;r._subtreeJson=s;let c;if(vi(s,"3DTILES_metadata"))c=s.extensions["3DTILES_metadata"];else if(l(s.tileMetadata)){let b=s.tileMetadata;c=s.propertyTables[b]}let u=[];if(l(s.contentMetadata)){let b=s.contentMetadata.length;for(let T=0;T<b;T++){let E=s.contentMetadata[T];u.push(s.propertyTables[E])}}let f,d=i.metadataSchema,p=s.subtreeMetadata;if(l(p)){let b=p.class,T=d.classes[b];f=new WF({subtreeMetadata:p,class:T})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let g={constant:0};s.contentAvailabilityHeaders=[],vi(s,"3DTILES_multiple_contents")?s.contentAvailabilityHeaders=s.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(s.contentAvailability)?s.contentAvailabilityHeaders=s.contentAvailability:s.contentAvailabilityHeaders.push(s.contentAvailability??g);let m=T5e(s.buffers),A=C5e(s.bufferViews,m);E5e(s,A),l(c)&&jue(c,A);for(let b=0;b<u.length;b++){let T=u[b];jue(T,A)}let y=await v5e(r,m,a.binary),x=w5e(A,y);return I5e(r,s,i,x),l(c)&&(D5e(r,i,x),R5e(r)),P5e(r,i,x),O5e(r),r._ready=!0,r};function b5e(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 a=Sr(e,i,o);i+=o;let s=e.subarray(i,i+r);return{json:a,binary:s}}function T5e(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 C5e(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 E5e(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 a=0;a<o.length;a++)n=void 0,l(o[a].bitstream)?n=t[o[a].bitstream]:l(o[a].bufferView)&&(n=t[o[a].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 jue(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],a=r.values??r.bufferView;i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0;let s=r.stringOffsets??r.stringOffsetBufferView;l(s)&&(i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0);let c=r.arrayOffsets??r.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function v5e(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 a=S5e(e,r);i.push(a)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let a=0;a<o.length;a++){let s=o[a];l(s)&&(r[a]=s)}return r})}async function S5e(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Pi.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function w5e(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,a=r+o.byteLength,c=t[o.buffer].subarray(r,a);n[i]=c}return n}function I5e(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,a=(Math.pow(o,r)-1)/(o-1),s=Math.pow(o,r),c=vi(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=HY(t.tileAvailability,i,a,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=HY(t.contentAvailabilityHeaders[p],i,a,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=HY(t.childSubtreeAvailability,i,s)}function HY(e,t,n,i){if(l(e.constant))return new jI({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 jI({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function D5e(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,a=i.class,s=r.classes[a];e._tileMetadataTable=new mh({class:s,count:o,properties:i.properties,bufferViews:n})}function P5e(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,a=e._contentMetadataTables;for(let s=0;s<i.length;s++){let c=i[s],f=o[s].availableCount,d=c.class,p=r.classes[d],g=new mh({class:p,count:f,properties:c.properties,bufferViews:n});a.push(g)}}function Gue(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 R5e(e){let t=Gue(e._tileAvailability);e._tileJumpBuffer=t}function O5e(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Gue(o);t.push(r)}}qs.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new re("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};qs.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new re("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function M5e(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function B5e(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],a=e.getTileIndex(t);if(r.getBit(a))return e._contentJumpBuffers[n][a]}qs.prototype.getTileMetadataView=function(e){let t=M5e(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new GI({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};qs.prototype.getContentMetadataView=function(e,t){let n=B5e(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new GI({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};qs.prototype.isDestroyed=function(){return!1};qs.prototype.destroy=function(){return l(this._bufferLoader)&&Pi.unload(this._bufferLoader),fe(this)};var O_=qs;var Hue={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"};Object.freeze(Hue);var gh=Hue;var M_={};M_.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:M_.parseBoundingVolumeSemantic(e,t),minimumHeight:M_._parseMinimumHeight(e,t),maximumHeight:M_._parseMaximumHeight(e,t)}};M_.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 a=`${e}_BOUNDING_SPHERE`,s=t.getPropertyBySemantic(a);if(l(s))return{sphere:s}};M_._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};M_._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var ux=M_;var XC=class e{constructor(t,n,i){let o=n.implicitTileset,r=n.implicitCoordinates;this._implicitTileset=o,this._implicitCoordinates=r,this._implicitSubtree=void 0,this._tileset=t,this._tile=n,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let a=r.getTemplateValues(),s=o.subtreeUriTemplate.getDerivedResource({templateValues:a});this._url=s.getUrlComponent(!0),this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._url}get metadata(){}set metadata(t){}get batchTable(){}get group(){return this._group}set group(t){this._group=t}static async fromSubtreeJson(t,n,i,o,r,a){a=a??0;let s;l(r)&&(s=new Uint8Array(r,a));let c=n.implicitTileset,u=n.implicitCoordinates,f=await O_.fromSubtreeJson(i,o,s,c,u),d=new e(t,n,i);return d._implicitSubtree=f,L5e(d,f),d._ready=!0,d}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),fe(this)}};function L5e(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=F5e(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let a=N5e(e,t,o.bottomRow);for(let s=0;s<a.length;s++){let c=a[s],u=c.tile,f=q5e(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function N5e(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let a=n[r];if(l(a))for(let s=0;s<o;s++){let c=r*o+s;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:a,childIndex:s})}}return i}function F5e(e,t,n,i){let a=Wue(e,t,n,i,0,!0),s=e._tileset.statistics,c=[a],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let A=p+m;if(!t.tileIsAvailableAtIndex(A)){u.push(void 0);continue}let y=t.getParentMortonIndex(m),x=c[y],b=m%f.branchingFactor,T=Wue(e,t,x,b,A);x.children.push(T),s.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:a,bottomRow:c}}function que(e,t,n){let i=gh.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Wue(e,t,n,i,o,r){let a=e._implicitTileset,s;r??!1?s=n.implicitCoordinates:s=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(s),u=ux.parseAllBoundingVolumeSemantics("TILE",c));let d=t.contentPropertyTableJsons.length,p=!1;for(let S=0;S<d;S++)if(t.contentIsAvailableAtCoordinates(s,S)){p=!0;break}let g=U5e(a,s,i,r,n,u),m=[];for(let S=0;S<a.contentCount;S++){if(!t.contentIsAvailableAtIndex(o,S))continue;let O={uri:a.contentUriTemplates[S].getDerivedResource({templateValues:s.getTemplateValues()}).url},B;if(t.contentPropertyTableJsons.length>0){let _=t.getContentMetadataView(s,S);B=ux.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=V5e(g,B);l(L)&&(O.boundingVolume=L),m.push(It(O,a.contentHeaders[S]))}let A=que(c,a,s),y={boundingVolume:g,geometricError:A,refine:a.refine,contents:m},x=!0,b=qe(a.tileHeader,x);delete b.boundingVolume,delete b.transform,delete b.metadata;let T=It(y,b,x),E=$ue(e,a.baseResource,T,n);return E.implicitCoordinates=s,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function T2(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(vi(e,"3DTILES_bounding_volume_S2")||l(e.region))}function qY(e,t){l(t)&&(vi(e,"3DTILES_bounding_volume_S2")?z5e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&k5e(e.region,t.minimumHeight,t.maximumHeight))}function k5e(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function z5e(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function U5e(e,t,n,i,o,r){let a;return!l(r)||!l(r.boundingVolume)||!T2(r.boundingVolume,r)&&T2(e.boundingVolume,r)?a=Yue(e,t,n,i??!1,o):a=r.boundingVolume,qY(a,r),a}function V5e(e,t){let n;return l(t)&&(n=t.boundingVolume),T2(n,t)?qY(n,t):T2(e,t)&&(n=qe(e,!0),qY(n,t)),n}function Yue(e,t,n,i,o){let r=e.boundingVolume;return vi(r,"3DTILES_bounding_volume_S2")?Xue(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:Que(r.region,t.level,t.x,t.y,t.z)}:{box:Kue(r.box,t.level,t.x,t.y,t.z)}}function Xue(e,t,n,i,o,r,a){let s=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:v_.getTokenFromId(s.s2Cell._cellId),minimumHeight:s.minimumHeight,maximumHeight:s.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?VI.encode2D(i,o,r):VI.encode2D(i,r,o),f=v_.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(a)){let g=(s.maximumHeight+s.minimumHeight)/2;d=n<4?s.minimumHeight:g,p=n<4?g:s.maximumHeight}else d=s.minimumHeight,p=s.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:v_.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var j5e=new h,G5e=new h,WY=new h,H5e=new $;function Kue(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,G5e),a=$.unpack(e,3,H5e),s=Math.pow(2,-t),c=-1+(2*n+1)*s,u=-1+(2*i+1)*s,f=0,d=h.fromElements(s,s,1,j5e);l(o)&&(f=-1+(2*o+1)*s,d.z=s);let p=h.fromElements(c,u,f,WY);p=$.multiplyByVector(a,p,WY),p=h.add(p,r,WY);let g=$.clone(a);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var W5e=new oe;function Que(e,t,n,i,o){if(t===0)return e.slice();let r=oe.unpack(e,0,W5e),a=e[4],s=e[5],c=Math.pow(2,-t),u=c*r.width,f=D.negativePiToPi(r.west+n*u),d=D.negativePiToPi(f+u),p=c*r.height,g=D.negativePiToPi(r.south+i*p),m=D.negativePiToPi(g+p),A=a,y=s;if(l(o)){let x=c*(s-a);A+=o*x,y=A+x}return[f,g,d,m,A,y]}function q5e(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Yue(i,o,n,!1,t),a=que(void 0,i,o),s=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:a,refine:i.refine,contents:[{uri:s}]},u=$ue(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function $ue(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}XC._deriveBoundingBox=Kue;XC._deriveBoundingRegion=Que;XC._deriveBoundingVolumeS2=Xue;var oD=XC;var Jue={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(Jue);var ef=Jue;function KC(e,t){this._distance=t,this._normal=new Zue(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(KC.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)}}});KC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new KC(e.normal,e.distance),t};KC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new KC(e.normal,e.distance)};function Zue(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Zue.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 ss=KC;function Kc(e){e=e??G.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this.edgeColor=U.clone(e.edgeColor??U.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new ye,this.planeRemoved=new ye,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?ofe:rfe,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 ofe(e){return e===qt.OUTSIDE}function rfe(e){return e===qt.INSIDE}Object.defineProperties(Kc.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?ofe:rfe)}},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 efe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Kc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){efe(n,i)},e.index=t,efe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Kc.prototype.get=function(e){return this._planes[e]};function afe(e,t){let n=e.length;for(let i=0;i<n;++i)if(tn.equals(e[i],t))return i;return-1}Kc.prototype.contains=function(e){return afe(this._planes,e)!==-1};Kc.prototype.remove=function(e){let t=this._planes,n=afe(t,e);if(n===-1)return!1;e instanceof ss&&(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 ss&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Kc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof ss&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var Y5e=new se,X5e=new se;function tfe(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let a=t;a<n;++a){let s=o[a],c=on.octEncodeToCartesian4(s.normal,X5e);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=se.packFloat(s.distance,Y5e);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function nfe(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let a=t;a<n;++a){let s=o[a],c=s.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=s.distance,r+=4}}function sfe(e,t){let n=Mt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var K5e=new z;Kc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Kc.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let a=t.width*t.height;(a<o||o<.25*a)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let a=sfe(o,K5e);a.y*=2,i?(t=new Dt({context:n,width:a.x,height:a.y,pixelFormat:Xe.RGBA,pixelDatatype:je.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4)):(t=new Dt({context:n,width:a.x,height:a.y,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:jt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(a.x*a.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(nfe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(tfe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let a=0,s=0;i?(s=Math.floor(r/t.width),a=Math.floor(r-s*t.width),nfe(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:a,yOffset:s})):(s=Math.floor(r*2/t.width),a=Math.floor(r*2-s*t.width),tfe(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:a,yOffset:s}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var Q5e=new R,ife=new tn(h.UNIT_X,0);Kc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=R.multiply(t,o,Q5e));let r=qt.INSIDE;!this.unionClippingRegions&&i>0&&(r=qt.OUTSIDE);for(let a=0;a<i;++a){let s=n[a];tn.transform(s,o,ife);let c=e.intersectPlane(ife);if(c===qt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Kc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Kc.useFloatTexture=function(e){return e.floatingPointTexture};Kc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Kc.useFloatTexture(t)?e.length:e.length*2,r=sfe(o,n);return r.y*=2,r};Kc.prototype.isDestroyed=function(){return!1};Kc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),fe(this)};var ba=Kc;function KY(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=lfe(e,0,o,n,!0),a=[];if(!r||r.next===r.prev)return a;let s,c,u;if(i&&(r=t9e(e,t,r,n)),e.length>80*n){s=e[0],c=e[1];let f=s,d=c;for(let p=n;p<o;p+=n){let g=e[p],m=e[p+1];g<s&&(s=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-s,d-c),u=u!==0?32767/u:0}return aD(r,a,n,s,c,u,0),a}function lfe(e,t,n,i,o){let r;if(o===d9e(e,t,n,i)>0)for(let a=t;a<n;a+=i)r=cfe(a/i|0,e[a],e[a+1],r);else for(let a=n-i;a>=t;a-=i)r=cfe(a/i|0,e[a],e[a+1],r);return r&&QC(r,r.next)&&(cD(r),r=r.next),r}function fx(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(QC(n,n.next)||aa(n.prev,n,n.next)===0)){if(cD(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function aD(e,t,n,i,o,r,a){if(!e)return;!a&&r&&a9e(e,i,o,r);let s=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?J5e(e,i,o,r):$5e(e)){t.push(c.i,e.i,u.i),cD(e),e=u.next,s=u.next;continue}if(e=u,e===s){a?a===1?(e=Z5e(fx(e),t),aD(e,t,n,i,o,r,2)):a===2&&e9e(e,t,n,i,o,r):aD(fx(e),t,n,i,o,r,1);break}}}function $5e(e){let t=e.prev,n=e,i=e.next;if(aa(t,n,i)>=0)return!1;let o=t.x,r=n.x,a=i.x,s=t.y,c=n.y,u=i.y,f=Math.min(o,r,a),d=Math.min(s,c,u),p=Math.max(o,r,a),g=Math.max(s,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&rD(o,s,r,c,a,u,m.x,m.y)&&aa(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function J5e(e,t,n,i){let o=e.prev,r=e,a=e.next;if(aa(o,r,a)>=0)return!1;let s=o.x,c=r.x,u=a.x,f=o.y,d=r.y,p=a.y,g=Math.min(s,c,u),m=Math.min(f,d,p),A=Math.max(s,c,u),y=Math.max(f,d,p),x=YY(g,m,t,n,i),b=YY(A,y,t,n,i),T=e.prevZ,E=e.nextZ;for(;T&&T.z>=x&&E&&E.z<=b;){if(T.x>=g&&T.x<=A&&T.y>=m&&T.y<=y&&T!==o&&T!==a&&rD(s,f,c,d,u,p,T.x,T.y)&&aa(T.prev,T,T.next)>=0||(T=T.prevZ,E.x>=g&&E.x<=A&&E.y>=m&&E.y<=y&&E!==o&&E!==a&&rD(s,f,c,d,u,p,E.x,E.y)&&aa(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;T&&T.z>=x;){if(T.x>=g&&T.x<=A&&T.y>=m&&T.y<=y&&T!==o&&T!==a&&rD(s,f,c,d,u,p,T.x,T.y)&&aa(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=b;){if(E.x>=g&&E.x<=A&&E.y>=m&&E.y<=y&&E!==o&&E!==a&&rD(s,f,c,d,u,p,E.x,E.y)&&aa(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function Z5e(e,t){let n=e;do{let i=n.prev,o=n.next.next;!QC(i,o)&&ffe(i,n,n.next,o)&&sD(i,o)&&sD(o,i)&&(t.push(i.i,n.i,o.i),cD(n),cD(n.next),n=e=o),n=n.next}while(n!==e);return fx(n)}function e9e(e,t,n,i,o,r){let a=e;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&l9e(a,s)){let c=dfe(a,s);a=fx(a,a.next),c=fx(c,c.next),aD(a,t,n,i,o,r,0),aD(c,t,n,i,o,r,0);return}s=s.next}a=a.next}while(a!==e)}function t9e(e,t,n,i){let o=[];for(let r=0,a=t.length;r<a;r++){let s=t[r]*i,c=r<a-1?t[r+1]*i:e.length,u=lfe(e,s,c,i,!1);u===u.next&&(u.steiner=!0),o.push(c9e(u))}o.sort(n9e);for(let r=0;r<o.length;r++)n=i9e(o[r],n);return n}function n9e(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),o=(t.next.y-t.y)/(t.next.x-t.x);n=i-o}return n}function i9e(e,t){let n=o9e(e,t);if(!n)return t;let i=dfe(n,e);return fx(i,i.next),fx(n,n.next)}function o9e(e,t){let n=t,i=e.x,o=e.y,r=-1/0,a;if(QC(e,n))return n;do{if(QC(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let d=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>r&&(r=d,a=n.x<n.next.x?n:n.next,d===i))return a}n=n.next}while(n!==t);if(!a)return null;let s=a,c=a.x,u=a.y,f=1/0;n=a;do{if(i>=n.x&&n.x>=c&&i!==n.x&&ufe(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let d=Math.abs(o-n.y)/(i-n.x);sD(n,e)&&(d<f||d===f&&(n.x>a.x||n.x===a.x&&r9e(a,n)))&&(a=n,f=d)}n=n.next}while(n!==s);return a}function r9e(e,t){return aa(e.prev,e,t.prev)<0&&aa(t.next,e,e.next)<0}function a9e(e,t,n,i){let o=e;do o.z===0&&(o.z=YY(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,s9e(o)}function s9e(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let a=i,s=0;for(let u=0;u<n&&(s++,a=a.nextZ,!!a);u++);let c=n;for(;s>0||c>0&&a;)s!==0&&(c===0||!a||i.z<=a.z)?(o=i,i=i.nextZ,s--):(o=a,a=a.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=a}r.nextZ=null,n*=2}while(t>1);return e}function YY(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 c9e(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 ufe(e,t,n,i,o,r,a,s){return(o-a)*(t-s)>=(e-a)*(r-s)&&(e-a)*(i-s)>=(n-a)*(t-s)&&(n-a)*(r-s)>=(o-a)*(i-s)}function rD(e,t,n,i,o,r,a,s){return!(e===a&&t===s)&&ufe(e,t,n,i,o,r,a,s)}function l9e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!u9e(e,t)&&(sD(e,t)&&sD(t,e)&&f9e(e,t)&&(aa(e.prev,e,t.prev)||aa(e,t.prev,t))||QC(e,t)&&aa(e.prev,e,e.next)>0&&aa(t.prev,t,t.next)>0)}function aa(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function QC(e,t){return e.x===t.x&&e.y===t.y}function ffe(e,t,n,i){let o=E2(aa(e,t,n)),r=E2(aa(e,t,i)),a=E2(aa(n,i,e)),s=E2(aa(n,i,t));return!!(o!==r&&a!==s||o===0&&C2(e,n,t)||r===0&&C2(e,i,t)||a===0&&C2(n,e,i)||s===0&&C2(n,t,i))}function C2(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 E2(e){return e>0?1:e<0?-1:0}function u9e(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&&ffe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function sD(e,t){return aa(e.prev,e,e.next)<0?aa(e,t,e.next)>=0&&aa(e,e.prev,t)>=0:aa(e,t,e.prev)<0||aa(e,e.next,t)<0}function f9e(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 dfe(e,t){let n=XY(e.i,e.x,e.y),i=XY(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 cfe(e,t,n,i){let o=XY(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 cD(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 XY(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function d9e(e,t,n,i){let o=0;for(let r=t,a=n-i;r<n;r+=i)o+=(e[a]-e[r])*(e[r+1]+e[a+1]),a=r;return o}var h9e=new h,m9e=new h,B_={};B_.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],a=e[o];n+=r.x*a.y-a.x*r.y}return n*.5};B_.computeWindingOrder2D=function(e){return B_.computeArea2D(e)>0?ns.COUNTER_CLOCKWISE:ns.CLOCKWISE};B_.triangulate=function(e,t){let n=z.packArray(e);return KY(n,t,2)};var gfe=new h,_fe=new h,Afe=new h,hfe=new h,mfe=new h,pfe=new h,w0=new h,yfe=new z,xfe=new z,bfe=new z,$C=new z;B_.computeSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),a=n.slice(0),s,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(s=0;s<c;s++){let T=t[s];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,r){let E=i[s];f[p++]=E.x,f[p++]=E.y}}let g=[],m={},A=e.maximumRadius,y=D.chordLength(o,A),x=y*y;for(;a.length>0;){let T=a.pop(),E=a.pop(),S=a.pop(),w=h.fromArray(u,S*3,gfe),P=h.fromArray(u,E*3,_fe),O=h.fromArray(u,T*3,Afe),B,L,_;r&&(B=z.fromArray(f,S*2,yfe),L=z.fromArray(f,E*2,xfe),_=z.fromArray(f,T*2,bfe));let C=h.multiplyByScalar(h.normalize(w,hfe),A,hfe),v=h.multiplyByScalar(h.normalize(P,mfe),A,mfe),I=h.multiplyByScalar(h.normalize(O,pfe),A,pfe),M=h.magnitudeSquared(h.subtract(C,v,w0)),N=h.magnitudeSquared(h.subtract(v,I,w0)),j=h.magnitudeSquared(h.subtract(I,C,w0)),k=Math.max(M,N,j),V,F,W;k>x?M===k?(V=`${Math.min(S,E)} ${Math.max(S,E)}`,s=m[V],l(s)||(F=h.add(w,P,w0),h.multiplyByScalar(F,.5,F),u.push(F.x,F.y,F.z),s=u.length/3-1,m[V]=s,r&&(W=z.add(B,L,$C),z.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),a.push(S,s,T),a.push(s,E,T)):N===k?(V=`${Math.min(E,T)} ${Math.max(E,T)}`,s=m[V],l(s)||(F=h.add(P,O,w0),h.multiplyByScalar(F,.5,F),u.push(F.x,F.y,F.z),s=u.length/3-1,m[V]=s,r&&(W=z.add(L,_,$C),z.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),a.push(E,s,S),a.push(s,T,S)):j===k&&(V=`${Math.min(T,S)} ${Math.max(T,S)}`,s=m[V],l(s)||(F=h.add(O,w,w0),h.multiplyByScalar(F,.5,F),u.push(F.x,F.y,F.z),s=u.length/3-1,m[V]=s,r&&(W=z.add(_,B,$C),z.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),a.push(T,s,E),a.push(s,S,E)):(g.push(S),g.push(E),g.push(T))}let b={attributes:{position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Re.TRIANGLES};return r&&(b.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new At(b)};var p9e=new de,g9e=new de,_9e=new de,QY=new de;B_.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),a=n.slice(0),s,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(s=0;s<c;s++){let S=t[s];if(u[d++]=S.x,u[d++]=S.y,u[d++]=S.z,r){let w=i[s];f[p++]=w.x,f[p++]=w.y}}let g=[],m={},A=e.maximumRadius,y=D.chordLength(o,A),x=new jc(void 0,void 0,e),b=new jc(void 0,void 0,e),T=new jc(void 0,void 0,e);for(;a.length>0;){let S=a.pop(),w=a.pop(),P=a.pop(),O=h.fromArray(u,P*3,gfe),B=h.fromArray(u,w*3,_fe),L=h.fromArray(u,S*3,Afe),_,C,v;r&&(_=z.fromArray(f,P*2,yfe),C=z.fromArray(f,w*2,xfe),v=z.fromArray(f,S*2,bfe));let I=e.cartesianToCartographic(O,p9e),M=e.cartesianToCartographic(B,g9e),N=e.cartesianToCartographic(L,_9e);x.setEndPoints(I,M);let j=x.surfaceDistance;b.setEndPoints(M,N);let k=b.surfaceDistance;T.setEndPoints(N,I);let V=T.surfaceDistance,F=Math.max(j,k,V),W,q,J,H,Z;F>y?j===F?(W=`${Math.min(P,w)} ${Math.max(P,w)}`,s=m[W],l(s)||(q=x.interpolateUsingFraction(.5,QY),J=(I.height+M.height)*.5,H=h.fromRadians(q.longitude,q.latitude,J,e,w0),u.push(H.x,H.y,H.z),s=u.length/3-1,m[W]=s,r&&(Z=z.add(_,C,$C),z.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),a.push(P,s,S),a.push(s,w,S)):k===F?(W=`${Math.min(w,S)} ${Math.max(w,S)}`,s=m[W],l(s)||(q=b.interpolateUsingFraction(.5,QY),J=(M.height+N.height)*.5,H=h.fromRadians(q.longitude,q.latitude,J,e,w0),u.push(H.x,H.y,H.z),s=u.length/3-1,m[W]=s,r&&(Z=z.add(C,v,$C),z.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),a.push(w,s,P),a.push(s,S,P)):V===F&&(W=`${Math.min(S,P)} ${Math.max(S,P)}`,s=m[W],l(s)||(q=T.interpolateUsingFraction(.5,QY),J=(N.height+I.height)*.5,H=h.fromRadians(q.longitude,q.latitude,J,e,w0),u.push(H.x,H.y,H.z),s=u.length/3-1,m[W]=s,r&&(Z=z.add(v,_,$C),z.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),a.push(S,s,w),a.push(s,P,w)):(g.push(P),g.push(w),g.push(S))}let E={attributes:{position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Re.TRIANGLES};return r&&(E.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new At(E)};B_.scaleToGeodeticHeight=function(e,t,n,i){n=n??te.default;let o=h9e,r=m9e;if(t=t??0,i=i??!0,l(e)){let a=e.length;for(let s=0;s<a;s+=3)h.fromArray(e,s,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[s]=r.x,e[s+1]=r.y,e[s+2]=r.z}return e};var ni=B_;function L_(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(L_.prototype,{length:{get:function(){return this._length}}});L_.prototype.enqueue=function(e){this._array.push(e),this._length++};L_.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};L_.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};L_.prototype.contains=function(e){return this._array.indexOf(e)!==-1};L_.prototype.clear=function(){this._array.length=this._offset=this._length=0};L_.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var dx=L_;var mr={};mr.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,a=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(a)){let s=a.length;for(let c=0;c<s;++c)i.push(a[c])}}return n};mr.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let a=r.positions,s=r.holes;if(t[n++]=l(a)?a.length:0,t[n++]=l(s)?s.length:0,l(a)){let c=a.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(a[u],t,n)}if(l(s)){let c=s.length;for(let u=0;u<c;++u)o.push(s[u])}}return n};mr.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),a=o>0?new Array(o):void 0;for(let s=0;s<i;++s,t+=n.packedLength)r[s]=n.unpack(e,t);for(let s=0;s<o;++s)a[s]=mr.unpackPolygonHierarchy(e,t,n),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:r,holes:a,startingIndex:t}};var hx=new z;function Efe(e,t,n,i){return z.subtract(t,e,hx),z.multiplyByScalar(hx,n/i,hx),z.add(e,hx,hx),[hx.x,hx.y]}var N_=new h;function A9e(e,t,n,i){return h.subtract(t,e,N_),h.multiplyByScalar(N_,n/i,N_),h.add(e,N_,N_),[N_.x,N_.y,N_.z]}mr.subdivideLineCount=function(e,t,n){let o=h.distance(e,t)/n,r=Math.max(0,Math.ceil(D.log2(o)));return Math.pow(2,r)};var S2=new de,w2=new de,y9e=new de,x9e=new h,v2=new jc;mr.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,S2),r=e.cartesianToCartographic(n,w2),s=new jc(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(s)));return Math.pow(2,c)};mr.subdivideTexcoordLine=function(e,t,n,i,o,r){let a=mr.subdivideLineCount(n,i,o),s=z.distance(e,t),c=s/a,u=r;u.length=a*2;let f=0;for(let d=0;d<a;d++){let p=Efe(e,t,d*c,s);u[f++]=p[0],u[f++]=p[1]}return u};mr.subdivideLine=function(e,t,n,i){let o=mr.subdivideLineCount(e,t,n),r=h.distance(e,t),a=r/o;l(i)||(i=[]);let s=i;s.length=o*3;let c=0;for(let u=0;u<o;u++){let f=A9e(e,t,u*a,r);s[c++]=f[0],s[c++]=f[1],s[c++]=f[2]}return s};mr.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,a){let s=n.cartesianToCartographic(i,S2),c=n.cartesianToCartographic(o,w2);v2.setEndPoints(s,c);let u=v2.surfaceDistance/r,f=Math.max(0,Math.ceil(D.log2(u))),d=Math.pow(2,f),p=z.distance(e,t),g=p/d,m=a;m.length=d*2;let A=0;for(let y=0;y<d;y++){let x=Efe(e,t,y*g,p);m[A++]=x[0],m[A++]=x[1]}return m};mr.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,S2),a=e.cartesianToCartographic(n,w2),s=new jc(r,a,e);if(l(o)||(o=[]),s.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let c=s.surfaceDistance/i,u=Math.max(0,Math.ceil(D.log2(c))),f=Math.pow(2,u),d=s.surfaceDistance/f,p=o;p.length=f*3;let g=0;for(let m=0;m<f;m++){let A=s.interpolateUsingSurfaceDistance(m*d,y9e),y=e.cartographicToCartesian(A,x9e);p[g++]=y.x,p[g++]=y.y,p[g++]=y.z}return p};var b9e=new h,T9e=new h,C9e=new h,E9e=new h;mr.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??te.default;let r=b9e,a=T9e,s=C9e,c=E9e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,s),i.geodeticSurfaceNormal(s,r),c=i.scaleToGeodeticSurface(s,c),a=h.multiplyByScalar(r,n,a),a=h.add(c,a,a),u[d+f]=a.x,u[d+1+f]=a.y,u[d+2+f]=a.z,o&&(c=h.clone(s,c)),a=h.multiplyByScalar(r,t,a),a=h.add(c,a,a),u[d]=a.x,u[d+1]=a.y,u[d+2]=a.z}return e};mr.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new dx;o.enqueue(e);let r,a,s;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(s=u.length,r=0;r<s;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=Fo(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let d=c.holes[r],p=d.positions;if(t)for(s=p.length,a=0;a<s;++a)n.scaleToGeodeticSurface(p[a],p[a]);if(p=Fo(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),a=0;a<g;a++)o.enqueue(d.holes[a])}i.push(u)}return i};var v9e=new de;function S9e(e,t,n){let i=n.cartesianToCartographic(e,S2),o=n.cartesianToCartographic(t,w2);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;v2.setEndPoints(i,o);let r=v2.findIntersectionWithLatitude(0,v9e);if(!l(r))return;let a=Math.min(i.longitude,o.longitude),s=Math.max(i.longitude,o.longitude);if(Math.abs(s-a)>D.PI){let c=a;a=s,s=c}if(!(r.longitude<a||r.longitude>s))return n.cartographicToCartesian(r)}function w9e(e,t,n,i){if(i===rn.RHUMB)return S9e(e,t,n);let o=ui.lineSegmentPlane(e,t,tn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var I9e=new de;function D9e(e,t,n){let i=[],o,r,a,s,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],a=D.sign(o.z),s=D.sign(r.z);let f=d=>t.cartesianToCartographic(d,I9e).longitude;if(a===0)i.push({position:u,type:a,visited:!1,next:s,theta:f(o)});else if(s!==0){if(c=w9e(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:a,visited:!1,next:s,theta:f(c)})}++u}return i}function vfe(e,t,n,i,o,r,a){let s=[],c=r,u=d=>p=>p.position===d,f=[];do{let d=n[c];s.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:A,next:y}=g;if(g.visited=!0,A===0){if(y===0){let E=i[p-(a?1:-1)];if(E?.position===c+1)E.visited=!0;else{++c;continue}}if(!m&&a&&y>0||r===c&&!a&&y<0){++c;continue}}if(!(a?A>=0:A<=0)){++c;continue}m||f.push(c);let b=p+(a?1:-1),T=i[b];if(!l(T)){++c;continue}c=T.position}while(c<n.length&&c>=0&&c!==r&&s.length<n.length);e.splice(t,o,s);for(let d of f)t=vfe(e,++t,n,i,0,d,!a);return t}mr.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],a=r.slice();if(r.length<3){i[o]=a,++o;continue}let s=D9e(a,t,n);if(a.length===r.length||s.length<=1){i[o]=a,++o;continue}s.sort((u,f)=>u.theta-f.theta);let c=a[0].z>=0;o=vfe(i,o,a,s,1,0,c)}return i};mr.polygonsFromHierarchy=function(e,t,n,i,o,r){let a=[],s=[],c=new dx;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)o.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Fo(d,h.equalsEpsilon,!0)),d.length<3)continue;let A=n(d);if(!l(A))continue;let y=[],x=ni.computeWindingOrder2D(A);if(x===ns.CLOCKWISE&&(A.reverse(),d=d.slice().reverse()),u){u=!1;let w=[d];if(w=r(w,w),w.length>1){for(let P of w)c.enqueue(new Gc(P,p));continue}}let b=d.slice(),T=l(p)?p.length:0,E=[],S;for(g=0;g<T;g++){let w=p[g],P=w.positions;if(i)for(m=P.length,S=0;S<m;++S)o.scaleToGeodeticSurface(P[S],P[S]);if(t||(P=Fo(P,h.equalsEpsilon,!0)),P.length<3)continue;let O=n(P);if(!l(O))continue;x=ni.computeWindingOrder2D(O),x===ns.CLOCKWISE&&(O.reverse(),P=P.slice().reverse()),E.push(P),y.push(b.length),b=b.concat(P),A=A.concat(O);let B=0;for(l(w.holes)&&(B=w.holes.length),S=0;S<B;S++)c.enqueue(w.holes[S])}a.push({outerRing:d,holes:E}),s.push({positions:b,positions2D:A,holes:y})}return{hierarchy:a,polygons:s}};var P9e=new z,R9e=new h,O9e=new Le,M9e=new $;mr.computeBoundingRectangle=function(e,t,n,i,o){let r=Le.fromAxisAngle(e,i,O9e),a=$.fromQuaternion(r,M9e),s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],R9e);$.multiplyByVector(a,g,g);let m=t(g,P9e);l(m)&&(s=Math.min(s,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=s,o.y=u,o.width=c-s,o.height=f-u,o};mr.createGeometryFromPositions=function(e,t,n,i,o,r,a){let s=ni.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let d=c.length,p=new Array(d*3),g=0;for(let y=0;y<d;y++){let x=c[y];p[g++]=x.x,p[g++]=x.y,p[g++]=x.z}let m={attributes:{position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:Re.TRIANGLES};u&&(m.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:z.packArray(f)}));let A=new At(m);return r.normal?kn.computeNormal(A):A}if(a===rn.GEODESIC)return ni.computeSubdivision(e,c,s,f,i);if(a===rn.RHUMB)return ni.computeRhumbLineSubdivision(e,c,s,f,i)};var Tfe=[],Cfe=[],B9e=new h,L9e=new h;mr.computeWallGeometry=function(e,t,n,i,o,r){let a,s,c,u,f,d,p,g,m,A=e.length,y=0,x=0,b=l(t),T=b?t.positions:void 0;if(o)for(s=A*3*2,a=new Array(s*2),b&&(m=A*2*2,g=new Array(m*2)),c=0;c<A;c++)u=e[c],f=e[(c+1)%A],a[y]=a[y+s]=u.x,++y,a[y]=a[y+s]=u.y,++y,a[y]=a[y+s]=u.z,++y,a[y]=a[y+s]=f.x,++y,a[y]=a[y+s]=f.y,++y,a[y]=a[y+s]=f.z,++y,b&&(d=T[c],p=T[(c+1)%A],g[x]=g[x+m]=d.x,++x,g[x]=g[x+m]=d.y,++x,g[x]=g[x+m]=p.x,++x,g[x]=g[x+m]=p.y,++x);else{let O=D.chordLength(i,n.maximumRadius),B=0;if(r===rn.GEODESIC)for(c=0;c<A;c++)B+=mr.subdivideLineCount(e[c],e[(c+1)%A],O);else if(r===rn.RHUMB)for(c=0;c<A;c++)B+=mr.subdivideRhumbLineCount(n,e[c],e[(c+1)%A],O);for(s=(B+A)*3,a=new Array(s*2),b&&(m=(B+A)*2,g=new Array(m*2)),c=0;c<A;c++){u=e[c],f=e[(c+1)%A];let L,_;b&&(d=T[c],p=T[(c+1)%A]),r===rn.GEODESIC?(L=mr.subdivideLine(u,f,O,Cfe),b&&(_=mr.subdivideTexcoordLine(d,p,u,f,O,Tfe))):r===rn.RHUMB&&(L=mr.subdivideRhumbLine(n,u,f,O,Cfe),b&&(_=mr.subdivideTexcoordRhumbLine(d,p,n,u,f,O,Tfe)));let C=L.length;for(let v=0;v<C;++v,++y)a[y]=L[v],a[y+s]=L[v];if(a[y]=f.x,a[y+s]=f.x,++y,a[y]=f.y,a[y+s]=f.y,++y,a[y]=f.z,a[y+s]=f.z,++y,b){let v=_.length;for(let I=0;I<v;++I,++x)g[x]=_[I],g[x+m]=_[I];g[x]=p.x,g[x+m]=p.x,++x,g[x]=p.y,g[x+m]=p.y,++x}}}A=a.length;let E=Ue.createTypedArray(A/3,A-e.length*6),S=0;for(A/=6,c=0;c<A;c++){let O=c,B=O+1,L=O+A,_=L+1;u=h.fromArray(a,O*3,B9e),f=h.fromArray(a,B*3,L9e),!h.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(E[S++]=O,E[S++]=L,E[S++]=B,E[S++]=B,E[S++]=L,E[S++]=_)}let w={attributes:new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a})}),indices:E,primitiveType:Re.TRIANGLES};return b&&(w.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),new At(w)};var Kn=mr;function sa(e,t){this.position=e,l(this.position)||(this.position=new z),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=sa.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(sa.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=z.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(D.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=D.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=D.TWO_PI),e}}});var JC=new de,N9e=new h;sa.prototype.getLatitude=function(e){l(e)||(e=te.default),JC.latitude=this.conformalLatitude,JC.longitude=this.longitude,JC.height=0;let t=this.ellipsoid.cartographicToCartesian(JC,N9e);return e.cartesianToCartographic(t,JC),JC.latitude};var F9e=new An,k9e=new h,z9e=new h;sa.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=sa.NORTH_POLE_TANGENT_PLANE,o=sa.SOUTH_POLE;n<0&&(i=sa.SOUTH_POLE_TANGENT_PLANE,o=sa.NORTH_POLE);let r=F9e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,k9e),h.normalize(r.direction,r.direction);let a=ui.rayPlane(r,i.plane,z9e),s=h.subtract(a,o,a),c=h.dot(i.xAxis,s),u=n*h.dot(i.yAxis,s);return l(t)?(t.position=new z(c,u),t.tangentPlane=i,t):new sa(new z(c,u),i)};sa.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]=sa.fromCartesian(e[i],t[i]);return t};sa.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new sa(e.position,e.tangentPlane)};sa.HALF_UNIT_SPHERE=Object.freeze(new te(.5,.5,.5));sa.NORTH_POLE=Object.freeze(new h(0,0,.5));sa.SOUTH_POLE=Object.freeze(new h(0,0,-.5));sa.NORTH_POLE_TANGENT_PLANE=Object.freeze(new za(sa.NORTH_POLE,sa.HALF_UNIT_SPHERE));sa.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new za(sa.SOUTH_POLE,sa.HALF_UNIT_SPHERE));var Dl=sa;var U9e=new de,Sfe=new de;function V9e(e,t,n,i){let r=i.cartesianToCartographic(e,U9e).height,a=i.cartesianToCartographic(t,Sfe);a.height=r,i.cartographicToCartesian(a,t);let s=i.cartesianToCartographic(n,Sfe);s.height=r-100,i.cartographicToCartesian(s,n)}var wfe=new Je,j9e=new h,G9e=new h,H9e=new h,W9e=new h,q9e=new h,Y9e=new h,I2=new h,Wm=new h,ZC=new h,X9e=new z,K9e=new z,Q9e=new h,Ife=new Le,$9e=new $,J9e=new $;function $Y(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,a=o.length,s=e.wall,c=e.top||s,u=e.bottom||s;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,A=e.perPositionHeight,y=X9e;y.x=f.x,y.y=f.y;let x=t.st?new Float32Array(2*(a/3)):void 0,b;t.normal&&(A&&c&&!s?b=n.attributes.normal.values:b=new Float32Array(a));let T=t.tangent?new Float32Array(a):void 0,E=t.bitangent?new Float32Array(a):void 0,S=i?new Float32Array(a):void 0,w=0,P=0,O=G9e,B=H9e,L=W9e,_=!0,C=$9e,v=J9e;if(m!==0){let N=Le.fromAxisAngle(d,m,Ife);C=$.fromQuaternion(N,C),N=Le.fromAxisAngle(d,-m,Ife),v=$.fromQuaternion(N,v)}else C=$.clone($.IDENTITY,C),v=$.clone($.IDENTITY,v);let I=0,M=0;c&&u&&(I=a/2,M=a/3,a/=2);for(let N=0;N<a;N+=3){let j=h.fromArray(o,N,Q9e);if(t.st&&!l(r)){let k=$.multiplyByVector(C,j,j9e);k=g.scaleToGeodeticSurface(k,k);let V=p([k],K9e)[0];z.subtract(V,y,V);let F=D.clamp(V.x/f.width,0,1),W=D.clamp(V.y/f.height,0,1);u&&(x[w+M]=F,x[w+1+M]=W),c&&(x[w]=F,x[w+1]=W),w+=2}if(t.normal||t.tangent||t.bitangent||i){let k=P+1,V=P+2;if(s){if(N+3<a){let F=h.fromArray(o,N+3,q9e);if(_){let W=h.fromArray(o,N+a,Y9e);A&&V9e(j,F,W,g),h.subtract(F,j,F),h.subtract(W,j,W),O=h.normalize(h.cross(W,F,O),O),_=!1}h.equalsEpsilon(F,j,D.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(L=g.geodeticSurfaceNormal(j,L),t.tangent&&(B=h.normalize(h.cross(L,O,B),B)))}else O=g.geodeticSurfaceNormal(j,O),(t.tangent||t.bitangent)&&(A&&(I2=h.fromArray(b,P,I2),Wm=h.cross(h.UNIT_Z,I2,Wm),Wm=h.normalize($.multiplyByVector(v,Wm,Wm),Wm),t.bitangent&&(ZC=h.normalize(h.cross(I2,Wm,ZC),ZC))),B=h.cross(h.UNIT_Z,O,B),B=h.normalize($.multiplyByVector(v,B,B),B),t.bitangent&&(L=h.normalize(h.cross(O,B,L),L)));t.normal&&(e.wall?(b[P+I]=O.x,b[k+I]=O.y,b[V+I]=O.z):u&&(b[P+I]=-O.x,b[k+I]=-O.y,b[V+I]=-O.z),(c&&!A||s)&&(b[P]=O.x,b[k]=O.y,b[V]=O.z)),i&&(s&&(O=g.geodeticSurfaceNormal(j,O)),S[P+I]=-O.x,S[k+I]=-O.y,S[V+I]=-O.z),t.tangent&&(e.wall?(T[P+I]=B.x,T[k+I]=B.y,T[V+I]=B.z):u&&(T[P+I]=-B.x,T[k+I]=-B.y,T[V+I]=-B.z),c&&(A?(T[P]=Wm.x,T[k]=Wm.y,T[V]=Wm.z):(T[P]=B.x,T[k]=B.y,T[V]=B.z))),t.bitangent&&(u&&(E[P+I]=L.x,E[k+I]=L.y,E[V+I]=L.z),c&&(A?(E[P]=ZC.x,E[k]=ZC.y,E[V]=ZC.z):(E[P]=L.x,E[k]=L.y,E[V]=L.z))),P+=3}}t.st&&!l(r)&&(n.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:x})),t.normal&&(n.attributes.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(n.attributes.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,d=new Uint8Array(f);if(e.offsetAttribute===ln.TOP)c&&u||s?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===ln.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var Dfe=[];function Z9e(e,t,n,i,o,r,a,s,c,u){let f={walls:[]},d;if(a||s){let b=Kn.createGeometryFromPositions(e,t,n,i,r,c,u),T=b.attributes.position.values,E=b.indices,S,w;if(a&&s){let P=T.concat(T);S=P.length/3,w=Ue.createTypedArray(S,E.length*2),w.set(E);let O=E.length,B=S/2;for(d=0;d<O;d+=3){let L=w[d]+B,_=w[d+1]+B,C=w[d+2]+B;w[d+O]=C,w[d+1+O]=_,w[d+2+O]=L}if(b.attributes.position.values=P,r&&c.normal){let L=b.attributes.normal.values;b.attributes.normal.values=new Float32Array(P.length),b.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=b.attributes.st.values;b.attributes.st.values=new Float32Array(S*2),b.attributes.st.values=L.concat(L)}b.indices=w}else if(s){for(S=T.length/3,w=Ue.createTypedArray(S,E.length),d=0;d<E.length;d+=3)w[d]=E[d+2],w[d+1]=E[d+1],w[d+2]=E[d];b.indices=w}f.topAndBottom=new Bt({geometry:b})}let p=o.outerRing,g=za.fromPoints(p,e),m=g.projectPointsOntoPlane(p,Dfe),A=ni.computeWindingOrder2D(m);A===ns.CLOCKWISE&&(p=p.slice().reverse());let y=Kn.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new Bt({geometry:y}));let x=o.holes;for(d=0;d<x.length;d++){let b=x[d];m=g.projectPointsOntoPlane(b,Dfe),A=ni.computeWindingOrder2D(m),A===ns.COUNTER_CLOCKWISE&&(b=b.slice().reverse()),y=Kn.computeWallGeometry(b,n,e,i,r,u),f.walls.push(new Bt({geometry:y}))}return f}function nd(e){let t=e.polygonHierarchy,n=e.vertexFormat??Ne.DEFAULT,i=e.ellipsoid??te.default,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.stRotation??0,a=e.textureCoordinates,s=e.perPositionHeight??!1,c=s&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Ne.clone(n),this._ellipsoid=te.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=s,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??rn.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=a,this.packedLength=Kn.computeHierarchyPackedLength(t,h)+te.packedLength+Ne.packedLength+(a?Kn.computeHierarchyPackedLength(a,z):1)+12}nd.fromPositions=function(e){e=e??G.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 nd(t)};nd.pack=function(e,t,n){return n=n??0,n=Kn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,Ne.pack(e._vertexFormat,t,n),n+=Ne.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++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=Kn.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var e7e=te.clone(te.UNIT_SPHERE),t7e=new Ne,n7e={polygonHierarchy:{}};nd.unpack=function(e,t,n){t=t??0;let i=Kn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,e7e);t+=te.packedLength;let r=Ne.unpack(e,t,t7e);t+=Ne.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,A=e[t++],y=e[t++],x=e[t]===-1?void 0:Kn.unpackPolygonHierarchy(e,t,z);l(x)?(t=x.startingIndex,delete x.startingIndex):t++;let b=e[t++];return l(n)||(n=new nd(n7e)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=Ne.clone(r,n._vertexFormat),n._height=a,n._extrudedHeight=s,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=A===-1?void 0:A,n._arcType=y,n._textureCoordinates=x,n.packedLength=b,n};var i7e=new z,o7e=new z,r7e=new Dl;function Pfe(e,t,n,i,o,r){let a=e.longitude,s=a>=0?a:a+D.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,s),o.eastOverIdl=Math.max(o.eastOverIdl,s),r.west=Math.min(r.west,a),r.east=Math.max(r.east,a);let c=e.getLatitude(n),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==rn.RHUMB){let p=z.subtract(t.position,e.position,i7e),g=z.dot(t.position,p)/z.dot(p,p);if(g>0&&g<1){let m=z.add(t.position,z.multiplyByScalar(p,-g,p),o7e),A=Dl.clone(t,r7e);A.position=m;let y=A.getLatitude(n);r.south=Math.min(r.south,y),r.north=Math.max(r.north,y),Math.abs(c)>Math.abs(y)&&(u=y)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=z.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=d),u<=0&&(o.southAngle+=d)}var Rfe=new Dl,a7e=new Dl,td={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};nd.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new oe),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,td.northAngle=0,td.southAngle=0,td.westOverIdl=Number.POSITIVE_INFINITY,td.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Dl.fromCartesian(e[0],a7e);for(let a=1;a<o;a++){let s=Dl.fromCartesian(e[a],Rfe);Pfe(s,r,t,n,td,i),r=Dl.clone(s,r)}return Pfe(Dl.fromCartesian(e[0],Rfe),r,t,n,td,i),i.east-i.west>td.eastOverIdl-td.westOverIdl&&(i.west=td.westOverIdl,i.east=td.eastOverIdl,i.east>D.PI&&(i.east=i.east-D.TWO_PI),i.west>D.PI&&(i.west=i.west-D.TWO_PI)),D.equalsEpsilon(Math.abs(td.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(td.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var s7e=new Dl;function c7e(e,t,n){return e.height>=D.PI||e.width>=D.PI?Dl.fromCartesian(t[0],s7e).tangentPlane:za.fromPoints(t,n)}var Ofe=new de;function l7e(e,t,n){return(i,o)=>{if(e.height>=D.PI||e.width>=D.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let a=0;a<i.length;++a){let s=n.cartesianToCartographic(i[a],Ofe);o[a]=new z(s.longitude/D.PI,s.latitude/D.PI_OVER_TWO)}return o.length=i.length,o}return Dl.fromCartesianArray(i,o)}return za.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function u7e(e,t,n){if(e.height>=D.PI||e.width>=D.PI)return(o,r)=>{if(e.south<0&&e.north>0){let a=n.cartesianToCartographic(o,Ofe);return l(r)||(r=new z),r.x=a.longitude/D.PI,r.y=a.latitude/D.PI_OVER_TWO,r}return Dl.fromCartesian(o,r)};let i=za.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function f7e(e,t,n,i){return(o,r)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?Kn.splitPolygonsOnEquator(o,t,n,r):o}function d7e(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return Je.fromRectangle(t,void 0,wfe);let o=e,r=za.fromPoints(o,n);return Kn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,wfe)}nd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,a=e._perPositionHeight,s=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=r.positions;if(p.length<3)return;let g=e.rectangle,m=Kn.polygonsFromHierarchy(r,d,l7e(g,p,n),!a,n,f7e(g,n,u,a)),A=m.hierarchy,y=m.polygons,x=function(I){return I},b=d?Kn.polygonsFromHierarchy(f,!0,x,!1,n).polygons:void 0;if(A.length===0)return;let T=A[0].outerRing,E=d7e(T,g,n,o),S=[],w=e._height,P=e._extrudedHeight,O=e._perPositionHeightExtrude||!D.equalsEpsilon(w,P,0,D.EPSILON2),B={perPositionHeight:a,vertexFormat:t,geometry:void 0,rotationAxis:c7e(g,T,n).plane.normal,projectTo2d:u7e(g,T,n),boundingRectangle:E,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(O)for(B.extrude=!0,B.top=s,B.bottom=c,B.shadowVolume=e._shadowVolume,B.offsetAttribute=e._offsetAttribute,L=0;L<y.length;L++){let I=Z9e(n,y[L],d?b[L]:void 0,i,A[L],a,s,c,t,u),M;s&&c?(M=I.topAndBottom,B.geometry=Kn.scaleToGeodeticHeightExtruded(M.geometry,w,P,n,a)):s?(M=I.topAndBottom,M.geometry.attributes.position.values=ni.scaleToGeodeticHeight(M.geometry.attributes.position.values,w,n,!a),B.geometry=M.geometry):c&&(M=I.topAndBottom,M.geometry.attributes.position.values=ni.scaleToGeodeticHeight(M.geometry.attributes.position.values,P,n,!0),B.geometry=M.geometry),(s||c)&&(B.wall=!1,M.geometry=$Y(B),S.push(M));let N=I.walls;B.wall=!0;for(let j=0;j<N.length;j++){let k=N[j];B.geometry=Kn.scaleToGeodeticHeightExtruded(k.geometry,w,P,n,a),k.geometry=$Y(B),S.push(k)}}else for(L=0;L<y.length;L++){let I=new Bt({geometry:Kn.createGeometryFromPositions(n,y[L],d?b[L]:void 0,i,a,t,u)});if(I.geometry.attributes.position.values=ni.scaleToGeodeticHeight(I.geometry.attributes.position.values,w,n,!a),B.geometry=I.geometry,I.geometry=$Y(B),l(e._offsetAttribute)){let M=I.geometry.attributes.position.values.length,N=e._offsetAttribute===ln.NONE?0:1,j=new Uint8Array(M/3).fill(N);I.geometry.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:j})}S.push(I)}let _=kn.combineInstances(S)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=Ue.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,v=ce.fromVertices(C.position.values);return t.position||delete C.position,new At({attributes:C,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:v,offsetAttribute:e._offsetAttribute})};nd.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new nd({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:a,vertexFormat:Ne.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function h7e(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 At._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(nd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=nd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=h7e(this)),this._textureCoordinateRotationPoints}}});var F_=nd;function mx(e){this._ellipsoid=e.ellipsoid??te.default,this._positions=Bfe(e.positions),this._cachedPositions=void 0,this._cachedRectangle=void 0}function Bfe(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=h.clone(e[i]);return n}function m7e(e,t){if(!l(e)&&!l(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++){let o=e[i],r=t[i];if(!h.equals(o,r))return!1}return!0}Object.defineProperties(mx.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});mx.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new mx({positions:e.positions,ellipsoid:e.ellipsoid})};mx.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};mx.prototype.computeRectangle=function(e){if(m7e(this._positions,this._cachedPositions))return oe.clone(this._cachedRectangle,e);let t=F_.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e);return this._cachedPositions=Bfe(this._positions),this._cachedRectangle=oe.clone(t),t};var p7e=new oe,Mfe=new h;mx.prototype.computeSphericalExtents=function(e){l(e)||(e=new oe);let t=this.computeRectangle(p7e),n=de.toCartesian(oe.southwest(t),this.ellipsoid,Mfe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=de.toCartesian(oe.northeast(t),this.ellipsoid,Mfe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var lD=mx;var D2=`in vec2 v_textureCoordinates;
  6632. uniform int u_polygonsLength;
  6633. uniform int u_extentsLength;
  6634. uniform highp sampler2D u_polygonTexture;
  6635. uniform highp sampler2D u_extentsTexture;
  6636. int getPolygonIndex(float dimension, vec2 coord) {
  6637. vec2 uv = coord.xy * dimension;
  6638. return int(floor(uv.y) * dimension + floor(uv.x));
  6639. }
  6640. vec2 getLookupUv(ivec2 dimensions, int i) {
  6641. int pixY = i / dimensions.x;
  6642. int pixX = i - (pixY * dimensions.x);
  6643. float pixelWidth = 1.0 / float(dimensions.x);
  6644. float pixelHeight = 1.0 / float(dimensions.y);
  6645. float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
  6646. float v = (float(pixY) + 0.5) * pixelHeight;
  6647. return vec2(u, v);
  6648. }
  6649. vec4 getExtents(int i) {
  6650. return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));
  6651. }
  6652. ivec2 getPositionsLengthAndExtentsIndex(int i) {
  6653. vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
  6654. vec4 value = texture(u_polygonTexture, uv);
  6655. return ivec2(int(value.x), int(value.y));
  6656. }
  6657. vec2 getPolygonPosition(int i) {
  6658. vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
  6659. return texture(u_polygonTexture, uv).xy;
  6660. }
  6661. vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {
  6662. float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);
  6663. float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);
  6664. return vec2(latitude, longitude);
  6665. }
  6666. void main() {
  6667. int lastPolygonIndex = 0;
  6668. out_FragColor = vec4(1.0);
  6669. // Get the relevant region of the texture
  6670. float dimension = float(u_extentsLength);
  6671. if (u_extentsLength > 2) {
  6672. dimension = ceil(log2(float(u_extentsLength)));
  6673. }
  6674. int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);
  6675. if (regionIndex >= u_extentsLength) {
  6676. return; // done (no polygons in this region)
  6677. }
  6678. for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
  6679. ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
  6680. int positionsLength = positionsLengthAndExtents.x;
  6681. int polygonExtentsIndex = positionsLengthAndExtents.y;
  6682. lastPolygonIndex += 1;
  6683. // Read the individual polygon extent (2 pixels: south/west, latRange/lonRange)
  6684. vec2 extentsSouthWest = getPolygonPosition(lastPolygonIndex);
  6685. vec2 extentsRange = getPolygonPosition(lastPolygonIndex + 1);
  6686. vec4 polygonExtent = vec4(extentsSouthWest, extentsRange);
  6687. lastPolygonIndex += 2;
  6688. if (polygonExtentsIndex < regionIndex) {
  6689. lastPolygonIndex += positionsLength;
  6690. continue; // skip to next (TODO: could optimize further if we knew how many polygons to skip)
  6691. } else if (polygonExtentsIndex > regionIndex) {
  6692. break; // done (we know polygons are sorted by regionIndex)
  6693. }
  6694. // Only compute signed distance for the relevant part of the atlas
  6695. float clipAmount = czm_infinity;
  6696. vec4 extents = getExtents(polygonExtentsIndex);
  6697. vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension;
  6698. vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents); // current pixel position
  6699. // Only consider polygons whos boundingbox includes current pixel (with a slight padding)
  6700. float padding = 0.05; // 5% of polygon extents
  6701. float polygonNorth = polygonExtent.x + polygonExtent.z;
  6702. float polygonEast = polygonExtent.y + polygonExtent.w;
  6703. float latPadding = padding * polygonExtent.z; // padding as fraction of latitude range
  6704. float lonPadding = padding * polygonExtent.w; // padding as fraction of longitude range
  6705. if (p.x < polygonExtent.x - latPadding || p.x > polygonNorth + latPadding ||
  6706. p.y < polygonExtent.y - lonPadding || p.y > polygonEast + lonPadding) {
  6707. lastPolygonIndex += positionsLength;
  6708. continue; // skip to next
  6709. }
  6710. float s = 1.0;
  6711. // Check each edge for absolute distance.
  6712. // Cache the previous vertex to halve the texture reads per iteration.
  6713. vec2 prev = getPolygonPosition(lastPolygonIndex + positionsLength - 1);
  6714. for (int i = 0; i < positionsLength; i++) {
  6715. vec2 a = getPolygonPosition(lastPolygonIndex + i);
  6716. vec2 b = prev;
  6717. prev = a;
  6718. vec2 ab = b - a;
  6719. vec2 pa = p - a;
  6720. float t = dot(pa, ab) / dot(ab, ab);
  6721. t = clamp(t, 0.0, 1.0);
  6722. vec2 pq = pa - t * ab;
  6723. float d = length(pq);
  6724. // Inside / outside computation to determine sign
  6725. bvec3 cond = bvec3(p.y >= a.y,
  6726. p.y < b.y,
  6727. ab.x * pa.y > ab.y * pa.x);
  6728. if (all(cond) || all(not(cond))) s = -s;
  6729. if (abs(d) < abs(clipAmount)) {
  6730. clipAmount = d;
  6731. }
  6732. }
  6733. // Normalize the range to [0,1]
  6734. vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
  6735. // In the case where we've iterated through multiple polygons, take the minimum
  6736. out_FragColor = min(out_FragColor, result);
  6737. lastPolygonIndex += positionsLength;
  6738. }
  6739. }`;function Ta(e){e=e??G.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.quality=e.quality??1,this.polygonAdded=new ye,this.polygonRemoved=new ye,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(Ta.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+3*this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});Ta.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};Ta.prototype.get=function(e){return this._polygons[e]};Ta.prototype.contains=function(e){return this._polygons.some(t=>lD.equals(t,e))};Ta.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>lD.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};function g7e(e,t,n){let i=Math.max(e.height*t,0),o=Math.max(e.width*t,0),r=oe.clone(e,n);return r.south-=i,r.west-=o,r.north+=i,r.east+=o,r.south=Math.max(r.south,-Math.PI),r.west=Math.max(r.west,-Math.PI),r.north=Math.min(r.north,Math.PI),r.east=Math.min(r.east,Math.PI),r}function _7e(e,t){let i=[],o=e.length;for(let s=0;s<o;++s){let c=g7e(t[s],2.5),u=-1;for(let f=0;f<i.length;++f)if(l(oe.simpleIntersection(i[f].extent,c))){u=f;break}if(u===-1)i.push({extent:c,polygonIndices:[s]});else{let f=i[u];f.polygonIndices.push(s),oe.union(f.extent,c,f.extent);for(let d=0;d<i.length;++d)d!==u&&l(oe.simpleIntersection(i[d].extent,f.extent))&&(f.polygonIndices.push(...i[d].polygonIndices),oe.union(f.extent,i[d].extent,f.extent),i.splice(d,1),d<u&&u--,d=-1)}}let r=i.map(s=>s.extent),a=new Map;return i.forEach((s,c)=>s.polygonIndices.forEach(u=>a.set(u,c))),{extentsList:r,extentsIndexByPolygon:a}}Ta.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 A7e(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,o=i.map(f=>f.computeSphericalExtents()),{extentsList:r,extentsIndexByPolygon:a}=_7e(i,o),s=Array.from(i.keys()).sort((f,d)=>a.get(f)-a.get(d)),c=0;for(let f of s){let d=i[f],p=d.length;t[c++]=p,t[c++]=a.get(f);let g=o[f];t[c++]=g.south,t[c++]=g.west,t[c++]=g.north-g.south,t[c++]=g.east-g.west;for(let m=0;m<p;++m){let A=d.positions[m],y=Math.hypot(A.x,A.y),x=D.fastApproximateAtan2(y,A.z),b=D.fastApproximateAtan2(A.x,A.y);t[c++]=x,t[c++]=b}}let u=0;for(let f of r){let d=1/(f.east-f.west),p=1/(f.north-f.south);n[u++]=f.south,n[u++]=f.west,n[u++]=p,n[u++]=d}e._extentsCount=r.length}var JY=new z;Ta.prototype.update=function(e){let t=e.context;if(!Ta.isSupported(e))throw new re("ClippingPolygonCollections are only supported for WebGL 2.");this.debugShowDistanceTexture&&l(this._signedDistanceTexture)&&(l(this.debugCommand)||(this.debugCommand=y7e(this._signedDistanceTexture,e.context)),e.commandList.push(this.debugCommand));let n=this._polygons.reduce((a,s)=>a+s.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 a=i.width*i.height;(a<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*a)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let a=Ta.getTextureResolution(i,this.pixelsNeededForPolygonPositions,JY);i=new Dt({context:t,width:a.x,height:a.y,pixelFormat:Xe.RG,pixelDatatype:je.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*2),this._polygonsTexture=i}if(l(o)){let a=o.width*o.height;(a<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*a)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let a=Ta.getTextureResolution(o,this.pixelsNeededForExtents,JY);o=new Dt({context:t,width:a.x,height:a.y,pixelFormat:Xe.RGBA,pixelDatatype:je.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(a.x*a.y*4),this._extentsTexture=o}if(A7e(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 a=Ta.getClippingDistanceTextureResolution(this,JY);r=new Dt({context:t,width:a.x,height:a.y,pixelFormat:t.webgl2?Xe.RED:Xe.LUMINANCE,pixelDatatype:je.FLOAT,sampler:new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.LINEAR,magnificationFilter:ti.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=x7e(this)};function y7e(e,t){let i=t.createViewportQuadCommand(`uniform highp sampler2D billboard_texture;
  6740. in vec2 v_textureCoordinates;
  6741. float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
  6742. float signedDistance = texture(clippingDistance, uv).r;
  6743. return (signedDistance - 0.5) * 2.0;
  6744. }
  6745. void main()
  6746. {
  6747. float dist = texture(billboard_texture, v_textureCoordinates).r;
  6748. if (dist > 0.5) {
  6749. out_FragColor = vec4(dist, 0.0, 0.0, 1.0);
  6750. } else {
  6751. out_FragColor = vec4(0.0, dist, 0.0, 1.0);
  6752. }
  6753. }
  6754. `,{uniformMap:{billboard_texture:function(){return e}}});return i.pass=Ie.OVERLAY,i}Ta.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function x7e(e){let t=e._polygonsTexture,n=e._extentsTexture;return new Kl({fragmentShaderSource:D2,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 Lfe=new oe,b7e=new oe,T7e=new oe;Ta.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=qt.OUTSIDE;this.inverse&&(o=qt.INSIDE);let r=e.rectangle;if(!l(r)&&l(e.boundingVolume?.computeCorners)){let a=e.boundingVolume.computeCorners();r=oe.fromCartesianArray(a,t,Lfe)}l(r)||(r=oe.fromBoundingSphere(e.boundingSphere,t,Lfe));for(let a=0;a<i;++a){let c=n[a].computeRectangle(T7e),u=oe.simpleIntersection(r,c,b7e);if(l(u))return qt.INTERSECTING}return o};Ta.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ta.isSupported=function(e){return e?.context.webgl2};Ta.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Mt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};Ta.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;if(l(n))return t.x=n.width,t.y=n.height,t;let i=e.quality,o=Math.max(128,Math.ceil(4096*i));return t.x=Math.min(Mt.maximumTextureSize,o),t.y=Math.min(Mt.maximumTextureSize,o),t};Ta.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):Ta.getTextureResolution(n,e.pixelsNeededForExtents,t)};Ta.prototype.isDestroyed=function(){return!1};Ta.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(),fe(this)};var qm=Ta;var eE={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};eE.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?eE.SUNLIGHT:eE.SCENE_LIGHT:eE.NONE};Object.freeze(eE);var k_=eE;function Nfe(){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=k_.NONE}Nfe.requiresColorCorrect=function(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))};var tE=Nfe;var Ym=`uniform vec3 u_radiiAndDynamicAtmosphereColor;
  6755. uniform float u_atmosphereLightIntensity;
  6756. uniform float u_atmosphereRayleighScaleHeight;
  6757. uniform float u_atmosphereMieScaleHeight;
  6758. uniform float u_atmosphereMieAnisotropy;
  6759. uniform vec3 u_atmosphereRayleighCoefficient;
  6760. uniform vec3 u_atmosphereMieCoefficient;
  6761. const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
  6762. const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
  6763. 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.
  6764. /**
  6765. * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
  6766. * the transmittance value for the ray.
  6767. *
  6768. * @param {czm_ray} primaryRay The ray from the camera to the position.
  6769. * @param {float} primaryRayLength The length of the primary ray.
  6770. * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
  6771. * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
  6772. * @param {vec3} mieColor The variable the Mie scattering will be written to.
  6773. * @param {float} opacity The variable the transmittance will be written to.
  6774. * @glslFunction
  6775. */
  6776. void computeScattering(
  6777. czm_ray primaryRay,
  6778. float primaryRayLength,
  6779. vec3 lightDirection,
  6780. float atmosphereInnerRadius,
  6781. out vec3 rayleighColor,
  6782. out vec3 mieColor,
  6783. out float opacity
  6784. ) {
  6785. // Initialize the default scattering amounts to 0.
  6786. rayleighColor = vec3(0.0);
  6787. mieColor = vec3(0.0);
  6788. opacity = 0.0;
  6789. float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
  6790. vec3 origin = vec3(0.0);
  6791. // Calculate intersection from the camera to the outer ring of the atmosphere.
  6792. czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
  6793. // Return empty colors if no intersection with the atmosphere geometry.
  6794. if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
  6795. return;
  6796. }
  6797. // To deal with smaller values of PRIMARY_STEPS (e.g. 4)
  6798. // we implement a split strategy: sky or horizon.
  6799. // For performance reasons, instead of a if/else branch
  6800. // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
  6801. float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
  6802. // Value close to 0.0: close to the horizon
  6803. // Value close to 1.0: above in the sky
  6804. float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
  6805. // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
  6806. float start_0 = primaryRayAtmosphereIntersect.start;
  6807. primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
  6808. // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
  6809. primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
  6810. // For the number of ray steps, distinguish inside or outside atmosphere (outer space)
  6811. // (1) from outer space we have to use more ray steps to get a realistic rendering
  6812. // (2) within atmosphere we need fewer steps for faster rendering
  6813. 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
  6814. float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
  6815. 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.
  6816. 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.
  6817. // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
  6818. float rayPositionLength = primaryRayAtmosphereIntersect.start;
  6819. // (1) Outside the atmosphere: constant rayStepLength
  6820. // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
  6821. float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
  6822. float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
  6823. float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
  6824. vec3 rayleighAccumulation = vec3(0.0);
  6825. vec3 mieAccumulation = vec3(0.0);
  6826. vec2 opticalDepth = vec2(0.0);
  6827. vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);
  6828. // Sample positions on the primary ray.
  6829. for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
  6830. // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
  6831. // loop with non-constant condition, so it has to break early instead
  6832. if (i >= PRIMARY_STEPS) {
  6833. break;
  6834. }
  6835. // Calculate sample position along viewpoint ray.
  6836. vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
  6837. // Calculate height of sample position above ellipsoid.
  6838. float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
  6839. // Calculate and accumulate density of particles at the sample position.
  6840. vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
  6841. opticalDepth += sampleDensity;
  6842. // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
  6843. czm_ray lightRay = czm_ray(samplePosition, lightDirection);
  6844. czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
  6845. float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
  6846. float lightPositionLength = 0.0;
  6847. vec2 lightOpticalDepth = vec2(0.0);
  6848. // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
  6849. for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
  6850. // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
  6851. // loop with non-constant condition, so it has to break early instead
  6852. if (j >= LIGHT_STEPS) {
  6853. break;
  6854. }
  6855. // Calculate sample position along light ray.
  6856. vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
  6857. // Calculate height of the light sample position above ellipsoid.
  6858. float lightHeight = length(lightPosition) - atmosphereInnerRadius;
  6859. // Calculate density of photons at the light sample position.
  6860. lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
  6861. // Increment distance on light ray.
  6862. lightPositionLength += lightStepLength;
  6863. }
  6864. // Compute attenuation via the primary ray and the light ray.
  6865. vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
  6866. // Accumulate the scattering.
  6867. rayleighAccumulation += sampleDensity.x * attenuation;
  6868. mieAccumulation += sampleDensity.y * attenuation;
  6869. // Increment distance on primary ray.
  6870. rayPositionLength += (rayStepLength += rayStepLengthIncrease);
  6871. }
  6872. // Compute the scattering amount.
  6873. rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
  6874. mieColor = u_atmosphereMieCoefficient * mieAccumulation;
  6875. // Compute the transmittance i.e. how much light is passing through the atmosphere.
  6876. opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
  6877. }
  6878. vec4 computeAtmosphereColor(
  6879. vec3 positionWC,
  6880. vec3 lightDirection,
  6881. vec3 rayleighColor,
  6882. vec3 mieColor,
  6883. float opacity
  6884. ) {
  6885. // Setup the primary ray: from the camera position to the vertex position.
  6886. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  6887. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  6888. float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
  6889. float cosAngleSq = cosAngle * cosAngle;
  6890. float G = u_atmosphereMieAnisotropy;
  6891. float GSq = G * G;
  6892. // The Rayleigh phase function.
  6893. float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
  6894. // The Mie phase function.
  6895. 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));
  6896. // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
  6897. vec3 rayleigh = rayleighPhase * rayleighColor;
  6898. vec3 mie = miePhase * mieColor;
  6899. vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;
  6900. return vec4(color, opacity);
  6901. }
  6902. `;var P2=`uniform samplerCube u_radianceMap;
  6903. in vec2 v_textureCoordinates;
  6904. const float twoSqrtPi = 2.0 * sqrt(czm_pi);
  6905. // Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf
  6906. float computeShBasis(int index, vec3 s) {
  6907. if (index == 0) { // l = 0, m = 0
  6908. return 1.0 / twoSqrtPi;
  6909. }
  6910. if (index == 1) { // l = 1, m = -1
  6911. return -sqrt(3.0) * s.y / twoSqrtPi;
  6912. }
  6913. if (index == 2) { // l = 1, m = 0
  6914. return sqrt(3.0) * s.z / twoSqrtPi;
  6915. }
  6916. if (index == 3) { // l = 1, m = 1
  6917. return -sqrt(3.0) * s.x / twoSqrtPi;
  6918. }
  6919. if (index == 4) { // l = 2, m = -2
  6920. return sqrt(15.0) * s.y * s.x / twoSqrtPi;
  6921. }
  6922. if (index == 5) { // l = 2, m = -1
  6923. return -sqrt(15.0) * s.y * s.z / twoSqrtPi;
  6924. }
  6925. if (index == 6) { // l = 2, m = 0
  6926. return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi;
  6927. }
  6928. if (index == 7) { // l = 2, m = 1
  6929. return -sqrt(15.0) * s.x * s.z / twoSqrtPi;
  6930. }
  6931. if (index == 8) { // l = 2, m = 2
  6932. return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi;
  6933. }
  6934. return 0.0;
  6935. }
  6936. float vdcRadicalInverse(int i)
  6937. {
  6938. float r;
  6939. float base = 2.0;
  6940. float value = 0.0;
  6941. float invBase = 1.0 / base;
  6942. float invBi = invBase;
  6943. for (int x = 0; x < 100; x++)
  6944. {
  6945. if (i <= 0)
  6946. {
  6947. break;
  6948. }
  6949. r = mod(float(i), base);
  6950. value += r * invBi;
  6951. invBi *= invBase;
  6952. i = int(float(i) * invBase);
  6953. }
  6954. return value;
  6955. }
  6956. vec2 hammersley2D(int i, int N)
  6957. {
  6958. return vec2(float(i) / float(N), vdcRadicalInverse(i));
  6959. }
  6960. // Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics
  6961. const int samples = 256;
  6962. const float solidAngle = 1.0 / float(samples);
  6963. void main() {
  6964. // Get the current coefficient based on the uv
  6965. vec2 uv = v_textureCoordinates.xy * 3.0;
  6966. int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x));
  6967. for (int i = 0; i < samples; ++i) {
  6968. vec2 xi = hammersley2D(i, samples);
  6969. float phi = czm_twoPi * xi.x;
  6970. float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y);
  6971. float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
  6972. vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi)));
  6973. // Generate the spherical harmonics basis from the direction
  6974. float Ylm = computeShBasis(coefficientIndex, direction);
  6975. vec3 lookupDirection = -direction.xyz;
  6976. lookupDirection.z = -lookupDirection.z;
  6977. vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0);
  6978. // Use the relevant function for this coefficient
  6979. out_FragColor += Ylm * color * solidAngle * sinTheta;
  6980. }
  6981. }
  6982. `;var R2=`precision highp float;
  6983. in vec2 v_textureCoordinates;
  6984. uniform vec3 u_faceDirection; // Current cubemap face
  6985. uniform vec3 u_positionWC;
  6986. uniform mat4 u_enuToFixedFrame;
  6987. uniform vec4 u_brightnessSaturationGammaIntensity;
  6988. uniform vec4 u_groundColor; // alpha component represent albedo
  6989. vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) {
  6990. vec2 scaledUV = uv * 2.0 - 1.0;
  6991. if (faceDir.x != 0.0) {
  6992. return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0);
  6993. } else if (faceDir.y != 0.0) {
  6994. return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0);
  6995. } else {
  6996. return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0);
  6997. }
  6998. }
  6999. void main() {
  7000. float height = length(u_positionWC);
  7001. float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y;
  7002. float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0);
  7003. // Scale the position to ensure the sky color is present, even when underground.
  7004. vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius);
  7005. float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x;
  7006. float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius;
  7007. vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz;
  7008. vec3 normalizedDirection = normalize(direction);
  7009. czm_ray ray = czm_ray(positionWC, normalizedDirection);
  7010. czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius);
  7011. if (!czm_isEmpty(intersection)) {
  7012. intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii);
  7013. }
  7014. bool onEllipsoid = intersection.start >= 0.0;
  7015. float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius);
  7016. // Compute sky color for each position on a sphere at radius centered around the provided position's origin
  7017. vec3 skyPositionWC = positionWC + normalizedDirection * rayLength;
  7018. float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
  7019. vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum));
  7020. vec3 mieColor;
  7021. vec3 rayleighColor;
  7022. float opacity;
  7023. czm_computeScattering(
  7024. ray,
  7025. rayLength,
  7026. lightDirectionWC,
  7027. atmosphereInnerRadius,
  7028. rayleighColor,
  7029. mieColor,
  7030. opacity
  7031. );
  7032. vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity);
  7033. #ifdef ATMOSPHERE_COLOR_CORRECT
  7034. const bool ignoreBlackPixels = true;
  7035. atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels);
  7036. #endif
  7037. vec3 lookupDirection = -normalizedDirection;
  7038. // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
  7039. lookupDirection.x = -lookupDirection.x;
  7040. lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection);
  7041. lookupDirection.x = -lookupDirection.x;
  7042. // Values outside the atmopshere are rendered as black, when they should be treated as transparent
  7043. float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0);
  7044. skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent
  7045. // Blend starmap with atmopshere scattering
  7046. float intensity = u_brightnessSaturationGammaIntensity.w;
  7047. vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection);
  7048. vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a);
  7049. vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0);
  7050. // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height
  7051. vec3 up = normalize(positionWC);
  7052. float occlusion = max(dot(lightDirectionWC, up), 0.05);
  7053. vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0);
  7054. vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0));
  7055. vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor);
  7056. float brightness = u_brightnessSaturationGammaIntensity.x;
  7057. float saturation = u_brightnessSaturationGammaIntensity.y;
  7058. float gamma = u_brightnessSaturationGammaIntensity.z;
  7059. #ifdef ENVIRONMENT_COLOR_CORRECT
  7060. color.rgb = mix(vec3(0.0), color.rgb, brightness);
  7061. color.rgb = czm_saturation(color.rgb, saturation);
  7062. #endif
  7063. 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.
  7064. color.rgb = czm_gammaCorrect(color.rgb);
  7065. out_FragColor = color;
  7066. }
  7067. `;var O2=`precision highp float;
  7068. in vec3 v_textureCoordinates;
  7069. uniform float u_roughness;
  7070. uniform samplerCube u_radianceTexture;
  7071. uniform vec3 u_faceDirection;
  7072. float vdcRadicalInverse(int i)
  7073. {
  7074. float r;
  7075. float base = 2.0;
  7076. float value = 0.0;
  7077. float invBase = 1.0 / base;
  7078. float invBi = invBase;
  7079. for (int x = 0; x < 100; x++)
  7080. {
  7081. if (i <= 0)
  7082. {
  7083. break;
  7084. }
  7085. r = mod(float(i), base);
  7086. value += r * invBi;
  7087. invBi *= invBase;
  7088. i = int(float(i) * invBase);
  7089. }
  7090. return value;
  7091. }
  7092. vec2 hammersley2D(int i, int N)
  7093. {
  7094. return vec2(float(i) / float(N), vdcRadicalInverse(i));
  7095. }
  7096. vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
  7097. {
  7098. float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
  7099. float phi = czm_twoPi * xi.x;
  7100. float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
  7101. float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
  7102. vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
  7103. vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
  7104. vec3 tangentX = normalize(cross(upVector, N));
  7105. vec3 tangentY = cross(N, tangentX);
  7106. return tangentX * H.x + tangentY * H.y + N * H.z;
  7107. }
  7108. // Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses
  7109. const int samples = 128;
  7110. void main() {
  7111. vec3 normal = u_faceDirection;
  7112. vec3 V = normalize(v_textureCoordinates);
  7113. float roughness = u_roughness;
  7114. vec4 color = vec4(0.0);
  7115. float weight = 0.0;
  7116. for (int i = 0; i < samples; ++i) {
  7117. vec2 xi = hammersley2D(i, samples);
  7118. vec3 H = importanceSampleGGX(xi, roughness, V);
  7119. vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector
  7120. float NdotL = max(dot(V, L), 0.0);
  7121. if (NdotL > 0.0) {
  7122. color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL;
  7123. weight += NdotL;
  7124. }
  7125. }
  7126. out_FragColor = color / weight;
  7127. }
  7128. `;var M2=`in vec3 position;
  7129. out vec3 v_textureCoordinates;
  7130. uniform vec3 u_faceDirection;
  7131. vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) {
  7132. vec2 scaledUV = uv;
  7133. if (faceDir.x != 0.0) {
  7134. return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x);
  7135. } else if (faceDir.y != 0.0) {
  7136. return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y);
  7137. } else {
  7138. return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z);
  7139. }
  7140. }
  7141. void main()
  7142. {
  7143. v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection);
  7144. v_textureCoordinates.y = -v_textureCoordinates.y;
  7145. v_textureCoordinates.z = -v_textureCoordinates.z;
  7146. gl_Position = vec4(position, 1.0);
  7147. }
  7148. `;function hi(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,this._shouldReset=!1,e=e??G.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(Mt.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),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(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=hi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Q;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new z(i,i),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??hi.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(hi.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._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});hi._maximumComputeCommandCount=8;hi._activeComputeCommandCount=0;hi._nextFrameCommandQueue=[];hi._queueCommand=(e,t)=>{if(hi._activeComputeCommandCount>=hi._maximumComputeCommandCount){hi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),hi._activeComputeCommandCount++};hi._updateCommandQueue=e=>{if(hi._maximumComputeCommandCount=Math.log2(Mt.maximumCubeMapSize),hi._nextFrameCommandQueue.length>0&&hi._activeComputeCommandCount<hi._maximumComputeCommandCount){let t=hi._nextFrameCommandQueue.shift();for(;l(t)&&hi._activeComputeCommandCount<hi._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=hi._nextFrameCommandQueue.shift();continue}e.commandList.push(t),hi._activeComputeCommandCount++,t=hi._nextFrameCommandQueue.shift()}l(t)&&hi._nextFrameCommandQueue.push(t)}};hi.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};hi.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var C7e=new h,E7e=new h;function v7e(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,E7e),a=1.025,s=C7e,c=l(r)?h.magnitude(r):o.maximumRadius;return s.x=c*a,s.y=c,s.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,s)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(s,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Ffe=new h,S7e=new R,w7e=new se,I7e=new U;function D7e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new oa({context:n,width:i.x,height:i.y,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:Xe.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new He({sources:[Ym,R2]}),e._radianceMapFS=o),tE.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,a=e._radiiAndDynamicAtmosphereColor,s=t.mapProjection.ellipsoid,c=pt.eastNorthUpToFixedFrame(r,s,S7e),u=w7e;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of oa.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:Xe.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new Kl({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>a,u_enuToFixedFrame:()=>c,u_faceDirection:()=>oa.getDirection(d,Ffe),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,I7e)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){hi._activeComputeCommandCount--;return}let A=e._radianceMapComputeCommands;A[g]=void 0;let y=new pa({context:n,colorTextures:[e._radianceMapTextures[g]]});y._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),y._unBind(),y.destroy(),hi._activeComputeCommandCount--,A.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,hi._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function P7e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,a=o.y/2,s=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new jt({minificationFilter:Vt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,g,m,A,y)=>()=>{if(e.isDestroyed()||p.canceled){hi._activeComputeCommandCount--;return}let x=e._convolutionComputeCommands;x[g]=void 0,n.copyFace(t,m,A,y),c++,hi._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[g]=void 0,u()},d=0;for(let p=1;p<i;++p){for(let g of oa.faceNames()){l(e._specularMapTextures[d])&&e._specularMapTextures[d].destroy();let m=e._specularMapTextures[d]=new Dt({context:s,width:r,height:a,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:Xe.RGBA}),A=e._va;l(A)||(A=oa.createVertexArray(s,g),e._va=A);let y=e._convolveSP;l(y)||(y=Qt.fromCache({context:s,vertexShaderSource:M2,fragmentShaderSource:O2,attributeLocations:{positions:0}}),e._convolveSP=y);let x=new Kl({shaderProgram:y,vertexArray:A,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??s.defaultTexture,u_faceDirection:()=>oa.getDirection(g,Ffe)}});x.postExecute=f(x,d,m,g,p),e._convolutionComputeCommands[d]=x,hi._queueCommand(x,t),++d}r/=2,a/=2}u()}var kfe=new z(3,3);function R7e(e,t){let n=t.context,i=kfe,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:je.FLOAT,pixelFormat:Xe.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new He({sources:[P2]}),e._irradianceMapFS=r);let a=new Kl({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});a.postExecute=()=>{if(e.isDestroyed()||a.canceled){hi._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,hi._activeComputeCommandCount--},e._irradianceComputeCommand=a,hi._queueCommand(a,t),e._irradianceTextureDirty=!0}function O7e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new pa({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=kfe,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let a=0;a<9;++a)e._sphericalHarmonicCoefficients[a]=h.unpack(r,a*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[a],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[a]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}hi.prototype.update=function(e){let t=e.mode;if(!(hi.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===ie.MORPHING){this._shouldRegenerateShaders=!1;return}hi._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=v7e(this,e)||i===k_.SUNLIGHT&&!Q.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=Q.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(D7e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(P7e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(R7e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){O7e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};hi.prototype.isDestroyed=function(){return!1};hi.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].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),fe(this)};hi.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};hi.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(U.fromCssColorString("#717145"));hi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var z_=hi;var nE={HIGHLIGHT:0,REPLACE:1,MIX:2};nE.getColorBlend=function(e,t){if(e===nE.HIGHLIGHT)return 0;if(e===nE.REPLACE)return 1;if(e===nE.MIX)return D.clamp(t,D.EPSILON4,1)};Object.freeze(nE);var Pl=nE;var zfe={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(zfe);var _h=zfe;var Ufe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(Ufe);var Rl=Ufe;var Vfe={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(Vfe);var Xm=Vfe;var jfe={};function uD(e){this._count=e.count,this._properties=qe(e.properties,!0)}uD.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,jfe)};uD.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,jfe,e)};uD.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return qe(n[e],!0)};uD.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=qe(n,!0)};var U_=uD;function gc(e){e=e??G.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,this._texture=e.texture}Object.defineProperties(gc.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}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},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}},texture:{get:function(){return this._texture}}});gc.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))};gc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};gc.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))};gc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var ZY=[];gc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(ZY);Jn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,ZY);Jn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(ZY);Jn(t,n)}return t};gc.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};gc.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 U_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};gc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};gc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};gc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};gc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};gc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};gc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};gc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};gc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),fe(this)};var mu=gc;function Gfe(e){e=e??G.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,a=Zu.createModelTextureReader({textureInfo:r,channels:M7e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let s=t.offset,c=t.scale,u=n.hasValueTransform||l(s)||l(c);s=s??n.offset,c=c??n.scale,s=n.unpackVectorAndMatrixTypes(s),c=n.unpackVectorAndMatrixTypes(c),this._offset=s,this._scale=c,this._hasValueTransform=u,this._textureReader=a,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Gfe.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}}});function M7e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var B2=Gfe;function eX(e){e=e??G.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,a={};if(l(t.properties))for(let s in t.properties)t.properties.hasOwnProperty(s)&&(a[s]=new B2({property:t.properties[s],classProperty:n.properties[s],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=a,this._extras=r,this._extensions=o}Object.defineProperties(eX.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}}});eX.prototype.getProperty=function(e){return this._properties[e]};var V_=eX;function Hfe(e){e=e??G.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=i??n.offset,o=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(Hfe.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 L2=Hfe;function tX(e){e=e??G.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 L2({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(tX.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}}});tX.prototype.getProperty=function(e){return this._properties[e]};var iE=tX;function oE(e){e=e??G.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(oE.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}}});oE.prototype.getPropertyTable=function(e){return this._propertyTables[e]};oE.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};oE.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};oE.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return fe(this)};var Ys=oE;function B7e(e){e=e??G.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let a=0;a<t.propertyTables.length;a++){let s=t.propertyTables[a],c=n.classes[s.class],u=L7e(s,e.bufferViews,c,e.context),f=new mh({count:s.count,properties:s.properties,class:c,bufferViews:e.bufferViews});i.push(new mu({id:a,name:s.name,count:s.count,metadataTable:f,extras:s.extras,extensions:s.extensions,texture:u}))}let o=[];if(l(t.propertyTextures))for(let a=0;a<t.propertyTextures.length;a++){let s=t.propertyTextures[a];o.push(new V_({id:a,name:s.name,propertyTexture:s,class:n.classes[s.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let a=0;a<t.propertyAttributes.length;a++){let s=t.propertyAttributes[a];r.push(new iE({id:a,name:s.name,class:n.classes[s.class],propertyAttribute:s}))}return new Ys({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var fD=4;function L7e(e,t,n,i){let o=e.properties;if(!l(o))return;let r=e.count,a;try{a=N7e(o,t,n,r)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let s=a.length;if(s===0)return;if(r>Mt.maximumTextureSize||s>Mt.maximumTextureSize){_t("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${Mt.maximumTextureSize}.`);return}let c=k7e(a,r),u=new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.NEAREST,magnificationFilter:ti.NEAREST});return Dt.create({context:i,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:r,height:s,arrayBufferView:c}})}function N7e(e,t,n,i){let o=[],r=n.properties;for(let[a,s]of Object.entries(r)){if(!s.isGpuCompatible(fD))continue;let c=e[a],u=l(c)?t[c.values]:F7e(s,i),f=u.length,d=s.cpuBytesPerElement(),p=f/d;if(p!==i)throw new re(`Property with ID: "${a}" has (${p}), which does not match number of features in the property table: (${i}).`);o.push({view:u,classProperty:s})}return o}function F7e(e,t){let n=e.noData,i=ht.getComponentCount(e.type),o=e.isArray?e.arrayLength:1;e.type===ht.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),o===1&&(n=[n]);let r=e.cpuBytesPerElement(),a=Rt.getSizeInBytes(e.valueType),s=new ArrayBuffer(r*t),c=new DataView(s),u=Rt.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let d=0;d<o;d++)for(let p=0;p<i;p++){let g=d*i+p;u.set(r*f+g*a,n[d][p])}return new Uint8Array(s)}function k7e(e,t){let n=e.length,i=new Uint8Array(n*t*fD),o=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let r=0;r<n;r++){let a=e[r],s=a.classProperty,c=r*t*fD,u=s.valueType,f=Rt.gpuComponentType(u);if(u!==f){U7e(a,o,c);continue}z7e(a,i,c)}return i}function z7e(e,t,n){let i=e.view,o=e.classProperty.cpuBytesPerElement(),r=i.length/o;for(let a=0;a<r;a++){let s=a*o,c=n+a*fD;t.set(i.subarray(s,s+o),c)}}function U7e(e,t,n){let i=e.classProperty,o=e.view,r=i.valueType,a=Rt.gpuComponentType(r),s=i.cpuBytesPerElement(),c=o.length/s,u=new DataView(o.buffer,o.byteOffset,o.byteLength),f=Rt.getDataViewAccessors(u,r),d=Rt.getDataViewAccessors(t,a),p=Rt.downcastFunction(r);for(let g=0;g<c;g++){let m=g*s,A=n+g*fD,y=f.get(m);d.set(A,p(y))}}var N2=B7e;function V7e(e){e=e??G.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 s=r[i],c=t.featureTables[s],u=n.classes[c.class],f=new mh({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new mu({id:s,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let a=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let s=r[i],c=t.featureTextures[s];a.push(new V_({id:s,propertyTexture:j7e(c),class:n.classes[c.class],textures:e.textures}))}return new Ys({schema:n,propertyTables:o,propertyTextures:a,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function j7e(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:G7e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=It(o.texture,r,!0)}return t}function G7e(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 F2=V7e;var nX=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:o,gltfResource:r,baseResource:a,supportedImageFormats:s,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=r,this._baseResource=a,this._gltf=n,this._extension=i,this._extensionLegacy=o,this._supportedImageFormats=s,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=H7e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let n=this._textureLoaders,i=n.length,o=!0;for(let c=0;c<i;++c){let f=n[c].process(t);o=o&&f}if(!o)return!1;let r=this._schemaLoader.schema,a={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let d=new Uint8Array(f.typedArray);a[u]=d}}let s={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(s[u]=f.texture)}return l(this._extension)?this._structuralMetadata=N2({extension:this._extension,schema:r,bufferViews:a,textures:s,context:t.context}):this._structuralMetadata=F2({extension:this._extensionLegacy,schema:r,bufferViews:a,textures:s}),Wfe(this),this._state=gt.READY,!0}unload(){Wfe(this),nWe(this),l(this._schemaLoader)&&Pi.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function H7e(e){try{let t=K7e(e),n=eWe(e),i=tWe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=gt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load structural metadata",t)}}function W7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,a=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(a)&&(t[a]=!0)}}function q7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,a=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(a)&&(t[a]=!0)}}function Y7e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];W7e(o.properties,n)}return n}function X7e(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)&&q7e(r,n)}}return n}async function K7e(e){let t;l(e._extension)?t=Y7e(e._extension):t=X7e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Pi.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 Q7e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&$7e(r,t)}return t}function $7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function J7e(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)&&Z7e(r,t)}}return t}function Z7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function eWe(e){let t;l(e._extension)?t=Q7e(e._extension):t=J7e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,a=e._frameState,s=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Pi.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a,asynchronous:s});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function tWe(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Pi.getSchemaLoader({resource:i})}else n=Pi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function Wfe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Pi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function nWe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Pi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var k2=nX;var px={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};px.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return px.TRANSLATION;case"ROTATION":return px.ROTATION;case"SCALE":return px.SCALE;case"_FEATURE_ID":return px.FEATURE_ID}};Object.freeze(px);var wr=px;var iWe=65534,oWe=255;function z2(e){e=e??G.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Xfe(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],rWe(this)}Object.defineProperties(z2.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function rWe(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,a={};for(let s=0;s<t.length;s+=3){let c=t[s],u=t[s+1],f=t[s+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),A=qfe(i,c,u,f,p,g,m);for(;l(A);){let y=a[A];if(!l(y)){y=r+o.length;let x=A;for(;x>=r;)x=o[x-r];o.push(x),a[A]=y}y>iWe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):y>oWe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),A===c?(c=y,t[s]=y):A===u?(u=y,t[s+1]=y):(f=y,t[s+2]=y),A=qfe(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function qfe(e,t,n,i,o,r,a){let s=a?1:0,c=o?1:0,u=0,f=iX(e,t,s,c,u);if(f===0)return t;let d=0,p=o?1:0,g=r?1:0,m=iX(e,n,d,p,g);if(m===0)return n;let A=a?1:0,y=0,x=r?1:0,b=iX(e,i,A,y,x);if(b===0)return i;let T=f&m&b,E,S,w;if(T&1)E=0,S=1,w=2;else if(T&2)E=0,w=1,S=2;else if(T&4)S=0,E=1,w=2;else if(T&8)S=0,w=1,E=2;else if(T&16)w=0,E=1,S=2;else if(T&32)w=0,S=1,E=2;else{let L=oX(f),_=oX(m),C=oX(b);return L<_&&L<C?t:_<C?n:i}let P=t*3;e[P+E]=s,e[P+S]=c,e[P+w]=u;let O=n*3;e[O+E]=d,e[O+S]=p,e[O+w]=g;let B=i*3;e[B+E]=A,e[B+S]=y,e[B+w]=x}function iX(e,t,n,i,o){let r=t*3,a=e[r],s=e[r+1],c=e[r+2];return l(a)?(a===n&&s===i&&c===o)<<0|(a===n&&s===o&&c===i)<<1|(a===i&&s===n&&c===o)<<2|(a===i&&s===o&&c===n)<<3|(a===o&&s===n&&c===i)<<4|(a===o&&s===i&&c===n)<<5:63}function oX(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}z2.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,a=new r(e.length+o*i);a.set(e);for(let s=0;s<o;s++){let c=t[s]*i,u=n+s*i;for(let f=0;f<i;f++)a[u+f]=a[c+f]}return a};z2.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,Mt.maximumTextureSize),i=n,o=Yfe(i),r=[];for(;i>1;)i>>=1,r.push(Yfe(i));let a=new Dt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:Xe.LUMINANCE,sampler:new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.LINEAR_MIPMAP_LINEAR,magnificationFilter:ti.LINEAR})});return t.outlineTexture=a,a};function Yfe(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 Xfe(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),a=Math.max(i,o),s=r*this._originalVertexCount+a;this._edges.add(s)}}Xfe.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 rE=z2;function Kfe(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function aWe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function U2(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}U2.prototype.postProcess=function(e){this.needsOutlines&&(sWe(this),uWe(this,e)),this.needsGaussianSplats&&lWe(this,e)};function sWe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new rE({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ue.fromTypedArray(n.typedArray);let r=cWe(o.outlineCoordinates),a=new Kfe(r);a.loadBuffer=!0,a.loadTypedArray=!1,e.attributePlans.push(a),t.outlineCoordinates=a.attribute;let s=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=s[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function cWe(e){let t=new yn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Y.FLOAT,t.type=Ft.VEC3,t.normalized=!1,t.count=e.length/3,t}function lWe(e,t){let n=e.attributePlans,i=n.length;for(let o=0;o<i;o++){let r=n[o];r.loadBuffer=!1,r.loadTypedArray=!0}}function uWe(e,t){fWe(e.attributePlans,t),l(e.indicesPlan)&&dWe(e.indicesPlan,t)}function fWe(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,a=r.typedArray;if(o.loadBuffer){let s=Ke.createVertexBuffer({typedArray:a,context:t,usage:Oe.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.buffer=s}o.loadTypedArray||(r.typedArray=void 0)}}function dWe(e,t){let n=e.indices;if(e.loadBuffer){let i=Ke.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Oe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}U2.AttributeLoadPlan=Kfe;U2.IndicesLoadPlan=aWe;var aE=U2;function hWe(e){e=e??G.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var V2=hWe;function Qfe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Qfe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var j2=Qfe;function $fe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties($fe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var G2=$fe;function Jfe(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Jfe.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var H2=Jfe;var Zfe={Direct:"Direct",Indirect:"Indirect"};Object.freeze(Zfe);var gx=Zfe;function ede(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(ede.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 dD=ede;function tde(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(tde.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 W2=tde;function sE(){}function nde(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function mWe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new j2({position:t,adjustmentParams:n})}function pWe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=nde(e.covarianceMatrix);return new G2({position:t,adjustmentParams:n,covarianceMatrix:i})}function gWe(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let r of e.params){let a=new W2({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(a)}return new H2({groupFlags:t,rotationThetas:n,params:i})}sE.load=function(e){let t=e.storageType;if(t===gx.Direct)return sE.loadDirect(e);if(t===gx.Indirect)return sE.loadIndirect(e);throw new re(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};sE.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let a=mWe(r);t.push(a)}let i=nde(e.covarianceDirectUpperTriangle);return new dD({storageType:gx.Direct,anchorPointsDirect:t,covarianceDirect:i})};sE.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let a of n){let s=pWe(a);t.push(s)}let i=e.intraTileCorrelationGroups,o=[];for(let a of i){let s=gWe(a);o.push(s)}return new dD({storageType:gx.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var q2=sE;function ide(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(ide.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 Y2=ide;function ode(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(ode.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var X2=ode;function rde(e){this._ppeTextures=e}Object.defineProperties(rde.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var K2=rde;function Wr(e){e=e??G.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,a=e.frameState,s=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=a,this._cacheKey=s,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Wr.prototype=Object.create(Ki.prototype),Wr.prototype.constructor=Wr);Object.defineProperties(Wr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Wr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=gt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=gt.FAILED,this.getError("Failed to load GPM data",e)}};Wr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=this._loadResources(this),this._promise)};function _We(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}Wr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=_We(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,a=this._asynchronous,s=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Pi.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:a});this._textureLoaders.push(u),this._textureIds.push(c),s.push(u.load())}return Promise.all(s)};Wr.ppeTexturesMetadataSchemaCache=new Map;Wr._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,o=e.offset??0,r=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:o,scale:r,min:n.min,max:n.max}}}};Wr._obtainPpeTexturesMetadataSchema=function(e){let n=Wr._collectPpeTexturePropertyIdentifiers(e).toString(),i=Wr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${Wr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},a=e.ppeTextures;for(let s=0;s<a.length;s++){let c=a[s],u=`ppeTexture_${s}`,f=Wr._createPpeTextureClassJson(c,s);r.classes[u]=f}return i=du.fromJson(r),Wr.ppeTexturesMetadataSchemaCache.set(n,i),i};Wr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=Wr._createPpeTextureClassJson(o,i),a=JSON.stringify(r);t.push(a)}return t};Wr._convertToStructuralMetadata=function(e,t){let n=[],i=Wr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let a=0;a<o.length;a++){let s=o[a],c=`ppeTexture_${a}`,f=s.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:s.index,texCoord:s.texCoord}}};n.push(new V_({id:a,name:s.name,propertyTexture:p,class:d,textures:t}))}return new Ys({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Wr.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(o[f]=d.texture)}let r=[],a=this._extension;if(l(a.ppeTextures)){let u=a.ppeTextures;for(let f of u){let d=f.traits,p=new X2({min:d.min,max:d.max,source:d.source}),g=new Y2({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(g)}}let s=new K2(r);this._meshPrimitiveGpmLocal=s;let c=Wr._convertToStructuralMetadata(s,o);return this._structuralMetadata=c,this._state=gt.READY,!0};Wr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Pi.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Wr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var Q2=Wr;function AWe(e){let n=(e.extensions??G.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let o=[];Jn(o,i);for(let r of n.primitiveGroups){let a=r.primitives[0];if(!l(a)||!i[a])return i;let s={...i[a],indices:r.indices};switch(s.mode){case ee.TRIANGLE_FAN:case ee.TRIANGLE_STRIP:case ee.LINE_STRIP:case ee.LINE_LOOP:break;default:return i}for(let c of r.primitives){let u=o[c];if(!l(u?.indices)||u.mode!==s.mode)return i;o[c]=void 0}o[a]=s}return o.filter(l)}var $2=AWe;var{Attribute:yWe,Indices:xWe,FeatureIdAttribute:sde,FeatureIdTexture:cde,FeatureIdImplicitRange:lde,MorphTarget:bWe,Primitive:TWe,Instances:CWe,Skin:EWe,Node:vWe,AnimatedPropertyType:SWe,AnimationSampler:wWe,AnimationTarget:IWe,AnimationChannel:DWe,Animation:PWe,ArticulationStage:RWe,Articulation:OWe,Asset:MWe,Scene:BWe,Components:LWe,MetallicRoughness:NWe,SpecularGlossiness:FWe,Specular:kWe,Anisotropy:rX,Clearcoat:aX,LineStyle:zWe,Material:UWe,Vector:VWe,Polygon:jWe}=yn,Ko={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},sX=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:o=!1,asynchronous:r=!0,incrementallyLoadTextures:a=!0,upAxis:s=Fi.Y,forwardAxis:c=Fi.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:d=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:g=!0,loadForClassification:m=!1,renameBatchIdSemantic:A=!1}=t,{baseResource:y=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=y,this._typedArray=i,this._releaseGltfJson=o,this._asynchronous=r,this._incrementallyLoadTextures=a,this._upAxis=s,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=m,this._renameBatchIdSemantic=A,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Ko.NOT_LOADED,this._textureState=Ko.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}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=GWe(this),this._promise)}_process(t){return this._state===Ko.READY?!0:(this._state===Ko.PROCESSING&&WWe(this,t),this._resourcesLoaded&&this._state===Ko.POST_PROCESSING&&(qWe(this,t.context),this._state=Ko.PROCESSED),this._resourcesLoaded&&this._state===Ko.PROCESSED?(ade(this),this._typedArray=void 0,this._state=Ko.READY,!0):!1)}_processTextures(t){if(this._textureState===Ko.READY)return!0;if(this._textureState!==Ko.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let o=0;o<i.length;++o){let r=i[o].process(t);r&&l(this._textureCallbacks[o])&&(this._textureCallbacks[o](),this._textureCallbacks[o]=void 0),n=n&&r}return n?(this._textureState=Ko.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===Ko.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=HWe(this,t).then(()=>{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=Ko.FAILED;let r=this._processError;this._processError=void 0,J2(this,r)}let n=this._textureErrors.pop();if(l(n)){let r=this.getError("Failed to load glTF texture",n);throw r.name="TextureError",r}if(this._state===Ko.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(r){this._state=Ko.FAILED,J2(this,r)}let o=!1;try{o=this._processTextures(t)}catch(r){this._textureState=Ko.FAILED,J2(this,r)}return this._incrementallyLoadTextures?i:i&&o}isUnloaded(){return this._state===Ko.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Pi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,nYe(this),ade(this),iYe(this),oYe(this),rYe(this),aYe(this),this._components=void 0,this._typedArray=void 0,this._state=Ko.UNLOADED}};async function GWe(e){e._state=Ko.LOADING,e._textureState=Ko.LOADING;try{let t=Pi.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=Ko.LOADED,e._textureState=Ko.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Ko.FAILED,e._textureState=Ko.FAILED,J2(e,t)}}async function HWe(e,t){cn.supportsWebP.initialized||await cn.supportsWebP.initialize(),e._supportedImageFormats=new V2({webp:cn.supportsWebP(),basis:t.context.supportsBasis});let n=tYe(e,t);return e._state=Ko.PROCESSING,e._textureState=Ko.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Pi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function J2(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function WWe(e,t){let n=!0,i=e._geometryLoaders;for(let a=0;a<i.length;++a){let s=i[a].process(t);s&&l(e._geometryCallbacks[a])&&(e._geometryCallbacks[a](),e._geometryCallbacks[a]=void 0),n=n&&s}let o=e._structuralMetadataLoader;if(l(o)){let a=o.process(t);a&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&a}let r=e._meshPrimitiveGpmLoader;if(l(r)){let a=r.process(t);a&&(l(e._components.structuralMetadata)&&_t("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&&a}n&&(e._state=Ko.POST_PROCESSING)}function qWe(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),(o.needsOutlines||o.needsGaussianSplats)&&YWe(e,o)}}function YWe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let s=0;s<r.length;s++){let c=r[s];l(c.buffer)&&n.push(c.buffer)}let a=i.indices;l(a)&&l(a.buffer)&&n.push(a.buffer)}function XWe(e,t,n,i,o,r,a,s,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return Pi.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:d,primitive:i,draco:o,spz:r,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:a,loadTypedArray:s})}function KWe(e,t,n,i,o,r,a){return Pi.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function ude(e,t){let n=Pi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function cX(e,t,n){let i=t.byteOffset,o=Ju(e,t),r=t.count,a=Zf(t.type),s=t.componentType,c=Y.getSizeInBytes(s),u=c*a,f=r*a;if(o===u)return n=new Uint8Array(n),Y.createArrayBufferView(s,n.buffer,n.byteOffset+i,f);let d=Y.createTypedArray(s,f),p=new DataView(n.buffer),g=new Array(a),m=D_(t.componentType);i=n.byteOffset+i;for(let A=0;A<r;++A){m(p,i,a,c,g);for(let y=0;y<a;++y)d[A*a+y]=g[y];i+=o}return d}function QWe(e,t){let n=e.type;if(n===Ft.SCALAR)return t.fill(0);let i=Ft.getMathType(n);return t.fill(i.clone(i.ZERO))}function $We(e,t,n,i){let o=e.type,r=e.count;if(o===Ft.SCALAR)for(let a=0;a<r;a++)n[a]=t[a];else if(o===Ft.VEC4&&i)for(let a=0;a<r;a++)n[a]=Le.unpack(t,a*4);else{let a=Ft.getMathType(o),s=Ft.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=a.unpack(t,c*s)}return n}async function JWe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let a=cX(r,n,t.typedArray);i=i??!1,$We(n,a,o,i)}function G_(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=ude(e,o),a=JWe(e,r,t,n,i);return e._loaderPromises.push(a),i}return QWe(t,i)}function j_(e,t){let n=Y.createTypedArray(t.componentType,t.count*Ft.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=ude(e,t.bufferView),{gltfJson:o}=e,r=i.load().then(()=>{if(e.isDestroyed())return;let a=cX(o,t,i.typedArray);n.set(a)});return e._loaderPromises.push(r),n}function pu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function ZWe(e){return e===Number?0:new e}function eqe(e){switch(e){case Y.BYTE:return 127;case Y.UNSIGNED_BYTE:return 255;case Y.SHORT:return 32767;case Y.UNSIGNED_SHORT:return 65535;default:return 1}}var tqe={VEC2:new z(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function nqe(e,t){let n=eqe(e.componentDatatype),i=tqe[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 iqe(e,t,n){let i=e.decodeMatrix,o=pu(n,e.decodedMin),r=pu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let a=new yn.Quantization;a.componentDatatype=t.componentDatatype,a.type=t.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new z(i[6],i[7]),a.quantizedVolumeStepSize=new z(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new h(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=a}function oqe(e,t,n,i,o){let r=e.accessors[t],a=Ft.getMathType(r.type),s=r.normalized??!1,c=new yWe;c.name=n,c.semantic=i,c.setIndex=o,c.constant=ZWe(a),c.componentDatatype=r.componentType,c.normalized=s,c.count=r.count,c.type=r.type,c.min=pu(a,r.min),c.max=pu(a,r.max),c.byteOffset=r.byteOffset,c.byteStride=Ju(e,r),vi(r,"WEB3D_quantized_attributes")&&iqe(r.extensions.WEB3D_quantized_attributes,c,a);let u=c.semantic===it.POSITION||c.semantic===it.NORMAL||c.semantic===it.TANGENT||c.semantic===it.TEXCOORD||c.semantic===it.FEATURE_ID||c.semantic===it.SCALE||c.semantic===it.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&s&&u&&nqe(c,a),c}function fde(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var rqe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function lX(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=rqe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function aqe(e){let t=e===it.POSITION,n=e===it.FEATURE_ID,i=e===it.TEXCOORD;return t||n||i}function sqe(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=Y.createArrayBufferView(o,t.typedArray.buffer)}}function cqe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=Y.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===it.POSITION){let o=a=>{let s=1/0,c=-1/0,u=1/0,f=-1/0,d=1/0,p=-1/0;for(let g=0;g<a.length;g+=3){let m=a[g],A=a[g+1],y=a[g+2];s=Math.min(s,m),c=Math.max(c,m),u=Math.min(u,A),f=Math.max(f,A),d=Math.min(d,y),p=Math.max(p,y)}return[new h(s,u,d),new h(c,f,p)]},r=e.typedArray;[e.min,e.max]=o(r)}}function lqe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let a=i.typedArray;n.typedArray=cX(e,t,a),o||(n.byteOffset=0,n.byteStride=void 0)}}function dde(e,t,n,i,o,r,a,s,c){let u=e.gltfJson,f=u.accessors[t],d=f.bufferView,p=n.gltfSemantic,g=n.renamedSemantic,m=n.modelSemantic,A=l(m)?fde(g):void 0,x=oqe(u,t,p,m,A);if(!l(o)&&!l(d)&&!l(r))return x;let b=XWe(e,t,p,i,o,r,a,s,c),T=e._geometryLoaders.length;e._geometryLoaders.push(b);let E=b.load();return e._loaderPromises.push(E),e._geometryCallbacks[T]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[p])?sqe(x,b,a,s):l(r)?cqe(x,b,a,s):lqe(u,f,x,b,a,s)},x}function hde(e,t,n,i,o,r,a,s,c){let u=n.modelSemantic,f=u===it.POSITION,d=u===it.FEATURE_ID,p=f&&!a&&e._loadAttributesFor2D&&!c.scene3DOnly,g=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&d,A=e._loadAttributesAsTypedArray,y=!A,x=A||p||g||m,E=dde(e,t,n,i,o,r,s?!1:y,s?!0:x,c),S=new aE.AttributeLoadPlan(E);return S.loadBuffer=y,S.loadTypedArray=x,S}function uqe(e,t,n,i,o){let r=e.gltfJson.accessors,a=l(n.ROTATION),s=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=lX(e,wr,i),u=c.modelSemantic,f=u===wr.TRANSLATION||u===wr.ROTATION||u===wr.SCALE,d=u===wr.TRANSLATION,p=e._loadAttributesAsTypedArray||a&&f||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,m=!p,A=e._loadAttributesFor2D&&!o.scene3DOnly;return dde(e,t,c,void 0,void 0,void 0,m,p||d&&(!s||A||g),o)}function fqe(e,t,n,i,o,r){let a=e.gltfJson.accessors[t],s=a.bufferView,c=n.extensions??G.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(s))return;let d=new xWe;d.count=a.count;let p=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,m=e._loadForClassification&&i,y=!p,x=p||g||m||f,E=KWe(e,t,n,u,o?!1:y,o?!0:x,r),S=e._geometryLoaders.length;e._geometryLoaders.push(E);let w=E.load();e._loaderPromises.push(w),e._geometryCallbacks[S]=()=>{d.indexDatatype=E.indexDatatype,d.buffer=E.buffer,d.typedArray=E.typedArray};let P=new aE.IndicesLoadPlan(d);return P.loadBuffer=y,P.loadTypedArray=x,P}function Ol(e,t,n,i){let o=e.gltfJson,r=Zu.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let a=Pi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),s=Zu.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(a);let u=a.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Ko.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{s.texture=a.texture,l(i)&&(s.texture.sampler=i)},s}function dqe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=t,c=new FWe;return l(i)&&(c.diffuseTexture=Ol(e,i,n)),l(o)&&(c.specularGlossinessTexture=Ol(e,o,n)),c.diffuseFactor=pu(se,r),c.specularFactor=pu(h,a),c.glossinessFactor=s,c}function hqe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=t,c=new NWe;return l(i)&&(c.baseColorTexture=Ol(e,i,n)),l(o)&&(c.metallicRoughnessTexture=Ol(e,o,n)),c.baseColorFactor=pu(se,r),c.metallicFactor=a,c.roughnessFactor=s,c}function mqe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=t,s=new kWe;return l(o)&&(s.specularTexture=Ol(e,o,n)),l(a)&&(s.specularColorTexture=Ol(e,a,n)),s.specularFactor=i,s.specularColorFactor=pu(h,r),s}function pqe(e,t,n){let{anisotropyStrength:i=rX.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=rX.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,a=new rX;return l(r)&&(a.anisotropyTexture=Ol(e,r,n)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function gqe(e,t,n){let{clearcoatFactor:i=aX.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=aX.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=t,c=new aX;return l(o)&&(c.clearcoatTexture=Ol(e,o,n)),l(a)&&(c.clearcoatRoughnessTexture=Ol(e,a,n)),l(s)&&(c.clearcoatNormalTexture=Ol(e,s,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function _qe(e){if(!l(e))return;let t=new zWe;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function Aqe(e,t,n){let i=new UWe,o=t.extensions??G.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=dqe(e,r,n):(l(u)&&(i.metallicRoughness=hqe(e,u,n)),l(a)&&!i.unlit&&(i.specular=mqe(e,a,n)),l(s)&&!i.unlit&&(i.anisotropy=pqe(e,s,n)),l(c)&&!i.unlit&&(i.clearcoat=gqe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Ol(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Ol(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Ol(e,t.occlusionTexture,n)),i.emissiveFactor=pu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided;let f=o.BENTLEY_materials_point_style;if(l(f)&&l(f.diameter)){let d=f.diameter;d>=1&&(i.pointDiameter=Math.floor(d))}return i.lineStyle=_qe(o.BENTLEY_materials_line_style),i}function mde(e,t){let n=new sde;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 pde(e,t,n,i){let o=new sde,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=fde(r.attribute),o.positionalLabel=i,o}function gde(e,t){let n=new lde;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 _de(e,t,n,i){let o=new lde,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function yqe(e,t,n,i){let o=new cde;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=Ol(e,r,n,jt.NEAREST);let s=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=s,o}function xqe(e,t,n,i,o,r){let a=new cde,s=t.featureIds,c=s.texture;return a.featureCount=o,a.propertyTableId=n,a.textureReader=Ol(e,c,i,jt.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function bqe(e,t,n,i,o){let r=new bWe,a=void 0,s=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let d=t[f],p=lX(e,it,f),g=hde(e,d,p,a,s,c,u,n,o);r.attributes.push(g.attribute),i.attributePlans.push(g)}return r}function Tqe(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function Ade(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let o=i.pbrMetallicRoughness??G.EMPTY_OBJECT,r=pu(se,o.baseColorFactor);return l(r)?r:new se(1,1,1,1)}function Cqe(e){switch(e){case Y.UNSIGNED_BYTE:return 255;case Y.UNSIGNED_SHORT:return 65535;case Y.UNSIGNED_INT:return 4294967295;default:throw new re("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function Eqe(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let o=0;o<t.length;o++){let r=t[o]??G.EMPTY_OBJECT,a=r.indices,s=e.gltfJson.accessors[a];if(!l(s))throw new re("Edge visibility line string accessor not found!");let c=G_(e,s),u=Cqe(s.componentType),f=l(r.material)?r.material:n;i[o]={indices:c,restartIndex:u,componentType:s.componentType,materialColor:Ade(e,f)}}return i}function vqe(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let o=e.gltfJson.accessors[i];if(!l(o))throw new re("Edge visibility accessor not found!");n.visibility=G_(e,o)}if(n.materialColor=Ade(e,t.material),l(t.silhouetteNormals)){let o=e.gltfJson.accessors[t.silhouetteNormals];l(o)&&(n.silhouetteNormals=G_(e,o))}return l(t.lineStrings)&&(n.lineStrings=Eqe(e,t.lineStrings,t.material)),n}function Sqe(e,t,n,i){let o=new TWe,r=new aE(o);e._primitiveLoadPlans.push(r);let a=t.material;l(a)&&(o.material=Aqe(e,e.gltfJson.materials[a],i));let s=t.extensions??G.EMPTY_OBJECT,c=s.EXT_mesh_polygon;l(c)&&(o.polygon=Iqe(e,t,c));let u=s.CESIUM_mesh_vector;l(u)&&(o.vector=Dqe(e,u));let f=!1,d=s.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,r.needsOutlines=!0,r.outlineIndices=wqe(e,d,r)),o.edgeVisibility=vqe(e,s.EXT_mesh_primitive_edge_visibility);let p=Tqe(s);l(p)&&(f=!0,r.needsGaussianSplats=!0);let g=e._loadForClassification,m=s.KHR_draco_mesh_compression,A=!1,y=t.attributes;if(l(y))for(let B in y){if(!y.hasOwnProperty(B))continue;let L=y[B],_=lX(e,it,B),C=_.modelSemantic;if(g&&!aqe(C))continue;C===it.FEATURE_ID&&(A=!0);let v=hde(e,L,_,t,m,p,n,f,i);r.attributePlans.push(v),o.attributes.push(v.attribute)}let x=t.targets;if(l(x)&&!g)for(let B=0;B<x.length;++B)o.morphTargets.push(bqe(e,x[B],f,r,i));let b=t.indices;if(l(b)){let B=fqe(e,b,t,A,f,i);l(B)&&(r.indicesPlan=B,o.indices=B.indices)}let T=s.EXT_structural_metadata,E=s.EXT_mesh_features,S=s.EXT_feature_metadata,w=l(S),P=s.NGA_gpm_local;l(E)?Pqe(e,o,E,i):w&&Rqe(e,o,S,i),l(T)?Oqe(o,T):w&&Mqe(e,o,S),l(P)&&Bqe(o,P);let O=t.mode;if(g&&O!==Re.TRIANGLES)throw new re("Only triangle meshes can be used for classification.");return o.primitiveType=O,o}function wqe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return G_(e,i,!1)}function Iqe(e,t,n){let i=new jWe,o=e.gltfJson.accessors;return i.count=n.count,t.mode===Re.LINE_LOOP?(i.loopIndices=j_(e,o[t.indices]),i.loopIndicesOffsets=j_(e,o[n.indicesOffsets]),i.triangleIndices=j_(e,o[n.triangleIndices]),i.triangleIndicesOffsets=j_(e,o[n.triangleIndicesOffsets])):t.mode===Re.TRIANGLES&&(i.loopIndices=j_(e,o[n.loopIndices]),i.loopIndicesOffsets=j_(e,o[n.loopIndicesOffsets]),i.triangleIndices=j_(e,o[t.indices]),i.triangleIndicesOffsets=j_(e,o[n.indicesOffsets])),i}function Dqe(e,t){if(!l(t))return;let n=new VWe;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function o(r,a){if(l(r))return G_(e,i[r])}return n.polygonAttributeOffsets=o(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=o(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=o(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=o(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function Pqe(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let a=o[r],s=`featureId_${r}`,c;l(a.texture)?c=yqe(e,a,i,s):l(a.attribute)?c=mde(a,s):c=gde(a,s),t.featureIds.push(c)}}function Rqe(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,a=n.featureIdAttributes;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m;l(u.featureIds.attribute)?m=pde(u,d,p,g):m=_de(u,d,p,g),t.featureIds.push(m)}let s=n.featureIdTextures;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m=xqe(e,u,d,i,p,g);t.featureIds.push(m)}}function Oqe(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function Mqe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function Bqe(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function Lqe(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new CWe,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(uqe(e,f,r,u,n))}let a=i.extensions??G.EMPTY_OBJECT,s=t.EXT_instance_features,c=a.EXT_feature_metadata;return l(s)?Nqe(o,s):l(c)&&Fqe(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function Nqe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,a;l(o.attribute)?a=mde(o,r):a=gde(o,r),e.featureIds.push(a)}}function Fqe(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let a=0;a<r.length;++a){let s=r[a],c=s.featureTable,u=i.indexOf(c),f=o[c].count,d=`instanceFeatureId_${a}`,p;l(s.featureIds.attribute)?p=pde(s,u,f,d):p=_de(s,u,f,d),t.featureIds.push(p)}}function kqe(e,t,n){let i=new vWe;i.name=t.name,i.matrix=pu(R,t.matrix),i.translation=pu(h,t.translation),i.rotation=pu(Le,t.rotation),i.scale=pu(h,t.scale);let o=t.extensions??G.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations,s=o.CESIUM_mesh_vector;if(l(r)){if(e._loadForClassification)throw new re("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=Lqe(e,o,n)}l(a)&&(i.articulationName=a.articulationName),l(s)&&(i.meshVector=s);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=$2(u);for(let g=0;g<f.length;++g)i.primitives.push(Sqe(e,f[g],l(i.instances),n));let d=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(d)?d.slice():new Array(p.length).fill(0)}return i}function zqe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let a=kqe(e,o,t);return a.index=r,a});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function Uqe(e,t,n){let i=new EWe,o=t.joints;i.joints=o.map(a=>n[a]);let r=t.inverseBindMatrices;if(l(r)){let a=e.gltfJson.accessors[r];i.inverseBindMatrices=G_(e,a)}else i.inverseBindMatrices=new Array(o.length).fill(R.IDENTITY);return i}function Vqe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,a){let s=Uqe(e,r,t);return s.index=a,s}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let a=o[r].skin;l(a)&&(t[r].skin=i[a])}return i}async function jqe(e,t,n,i){let o=new k2({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 Gqe(e,t,n,i){let o=new Q2({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 Hqe(e,t){let n=new wWe,i=e.gltfJson.accessors,o=i[t.input];n.input=G_(e,o);let r=t.interpolation;n.interpolation=Xm[r]??Xm.LINEAR;let a=i[t.output];return n.output=G_(e,a,!0),n}function Wqe(e,t){let n=new IWe,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=SWe[o],n}function qqe(e,t,n){let i=new DWe,o=e.sampler;return i.sampler=t[o],i.target=Wqe(e.target,n),i}function Yqe(e,t,n){let i=new PWe;i.name=t.name;let o=t.samplers.map(function(a,s){let c=Hqe(e,a);return c.index=s,c}),r=t.channels.map(function(a){return qqe(a,o,n)});return i.samplers=o,i.channels=r,i}function Xqe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let a=Yqe(e,o,t);return a.index=r,a})}function Kqe(e){let t=new RWe;t.name=e.name;let n=e.type.toUpperCase();return t.type=Rl[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Qqe(e){let t=new OWe;return t.name=e.name,t.stages=e.stages.map(Kqe),t}function $qe(e){let n=(e.extensions??G.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(Qqe):[]}function Jqe(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function Zqe(e,t){let n=new BWe,i=Jqe(e);return n.nodes=i.map(function(o){return t[o]}),n}var eYe=new h;function tYe(e,t){let n=e.gltfJson,i=n.extensions??G.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(l(r)){let b=r.featureTables,T=r.featureTextures,E=l(b)?b:[],S=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let s=zqe(e,t),c=Vqe(e,s),u=Xqe(e,s),f=$qe(n),d=Zqe(n,s),p=new LWe,g=new MWe,m=n.asset.copyright;if(l(m)){let b=m.split(";").map(function(T){return new xt(T.trim())});g.credits=b}if(p.asset=g,p.scene=d,p.nodes=s,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(a)){let b=h.fromArray(a.center,0,eYe);p.transform=R.fromTranslation(b,p.transform)}if(e._components=p,l(o)||l(r)){let b=jqe(e,o,r,t);e._loaderPromises.push(b)}let A=i.NGA_gpm_local;if(l(A)){let b=q2.load(A);e._components.extensions.NGA_gpm_local=b}let y=n.meshes;if(l(y))for(let b of y){let T=b.primitives;if(l(T))for(let E of T){let S=E.extensions;if(l(S)){let w=S.NGA_gpm_local;if(l(w)){let P=Gqe(e,n,w,t);e._loaderPromises.push(P)}}}}let x=[];return Jn(x,e._loaderPromises),e._incrementallyLoadTextures||Jn(x,e._texturesPromises),Promise.all(x)}function nYe(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Pi.unload(t[n]);e._textureLoaders.length=0}function ade(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Pi.unload(t[n]);e._bufferViewLoaders.length=0}function iYe(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Pi.unload(t[n]);e._geometryLoaders.length=0}function oYe(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 rYe(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function aYe(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var id=sX;var Z2=`uniform sampler2D u_pointCloud_colorGBuffer;
  7149. uniform sampler2D u_pointCloud_depthGBuffer;
  7150. uniform vec2 u_distanceAndEdlStrength;
  7151. in vec2 v_textureCoordinates;
  7152. vec2 neighborContribution(float log2Depth, vec2 offset)
  7153. {
  7154. float dist = u_distanceAndEdlStrength.x;
  7155. vec2 texCoordOrig = v_textureCoordinates + offset * dist;
  7156. vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
  7157. vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);
  7158. float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));
  7159. float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));
  7160. // ignore depth values that are the clear depth
  7161. if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
  7162. return vec2(0.0);
  7163. }
  7164. // interpolate the two adjacent depth values
  7165. float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
  7166. vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
  7167. return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
  7168. }
  7169. void main()
  7170. {
  7171. float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));
  7172. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
  7173. eyeCoordinate /= eyeCoordinate.w;
  7174. float log2Depth = log2(-eyeCoordinate.z);
  7175. if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer
  7176. {
  7177. discard;
  7178. }
  7179. vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);
  7180. // sample from neighbors left, right, down, up
  7181. vec2 texelSize = 1.0 / czm_viewport.zw;
  7182. vec2 responseAndCount = vec2(0.0);
  7183. responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
  7184. responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
  7185. responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
  7186. responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));
  7187. float response = responseAndCount.x / responseAndCount.y;
  7188. float strength = u_distanceAndEdlStrength.y;
  7189. float shade = exp(-response * 300.0 * strength);
  7190. color.rgb *= shade;
  7191. out_FragColor = vec4(color);
  7192. // Input and output depth are the same.
  7193. gl_FragDepth = depthOrLogDepth;
  7194. }
  7195. `;function cE(){this._framebuffer=new bi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(cE.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 sYe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var uX=new z;function cYe(e,t){let n=new He({defines:["LOG_DEPTH_WRITE"],sources:[Z2]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return uX.x=e._radius,uX.y=e._strength,uX}},o=Ve.fromCache({blending:Jt.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Ht.setCesium3DTileBit(),stencilMask:Ht.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Ie.CESIUM_3D_TILE,owner:e}),e._clearCommand=new si({framebuffer:e.framebuffer,color:new U(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function lYe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),cYe(e,t)}function yde(e){return e.drawBuffers&&e.fragmentDepth}cE.isSupported=yde;function uYe(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;
  7196. layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=He.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main()
  7197. {
  7198. czm_point_cloud_post_process_main();
  7199. #ifdef LOG_DEPTH
  7200. czm_writeLogDepth();
  7201. out_FragData_1 = czm_packDepth(gl_FragDepth);
  7202. #else
  7203. out_FragData_1 = czm_packDepth(gl_FragCoord.z);
  7204. #endif
  7205. }`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}cE.prototype.update=function(e,t,n,i){if(!yde(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,lYe(this,e.context);let o,r=e.commandList,a=r.length;for(o=t;o<a;++o){let u=r[o];if(u.primitiveType!==Re.POINTS||u.pass===Ie.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=tt.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=uYe(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let s=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(s)};cE.prototype.isDestroyed=function(){return!1};cE.prototype.destroy=function(){return sYe(this),fe(this)};var H_=cE;function xde(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}xde.isSupported=function(e){return H_.isSupported(e.context)};var I0=xde;var _c={},fYe=new se(0,0,0,1),Qc=new se,dYe=new Je,fX=new z,dX=new z;_c.worldToWindowCoordinates=function(e,t,n){return _c.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var bde=new se,Tde=new h;function hD(e,t,n,i){let o=n.viewMatrix,r=R.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,bde),bde),a=h.multiplyComponents(t,h.normalize(r,Tde),Tde);return r.x+=t.x+a.x,r.y+=t.y+a.y,r.z+=a.z,R.multiplyByVector(n.frustum.projectionMatrix,r,i)}var hYe=new de(Math.PI,D.PI_OVER_TWO),mYe=new h,pYe=new h;_c.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=_c.computeActualEllipsoidPosition(o,t,fYe);if(!l(r))return;let a=e.canvas,s=dYe;s.x=0,s.y=0,s.width=a.clientWidth,s.height=a.clientHeight;let c=e.camera,u=!1;if(o.mode===ie.SCENE2D){let f=e.mapProjection,d=hYe,p=f.project(d,mYe),g=h.clone(c.position,pYe),m=c.frustum.clone(),A=R.computeViewportTransformation(s,0,1,new R),y=c.frustum.projectionMatrix,x=c.positionWC.y,b=h.fromElements(D.sign(x)*p.x-x,0,-c.positionWC.x),T=pt.pointToGLWindowCoordinates(y,A,b);if(x===0||T.x<=0||T.x>=a.clientWidth)u=!0;else{if(T.x>a.clientWidth*.5){s.width=T.x,c.frustum.right=p.x-x,Qc=hD(r,n,c,Qc),_c.clipToGLWindowCoordinates(s,Qc,fX),s.x+=T.x,c.position.x=-c.position.x;let E=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-E,Qc=hD(r,n,c,Qc),_c.clipToGLWindowCoordinates(s,Qc,dX)}else{s.x+=T.x,s.width-=T.x,c.frustum.left=-p.x-x,Qc=hD(r,n,c,Qc),_c.clipToGLWindowCoordinates(s,Qc,fX),s.x=s.x-s.width,c.position.x=-c.position.x;let E=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-E,Qc=hD(r,n,c,Qc),_c.clipToGLWindowCoordinates(s,Qc,dX)}h.clone(g,c.position),c.frustum=m.clone(),i=z.clone(fX,i),(i.x<0||i.x>a.clientWidth)&&(i.x=dX.x)}}if(o.mode!==ie.SCENE2D||u){if(Qc=hD(r,n,c,Qc),Qc.z<0&&!(c.frustum instanceof fn)&&!(c.frustum instanceof ga))return;i=_c.clipToGLWindowCoordinates(s,Qc,i)}return i.y=a.clientHeight-i.y,i};_c.worldToDrawingBufferCoordinates=function(e,t,n){if(n=_c.worldToWindowCoordinates(e,t,n),!!l(n))return _c.transformWindowToDrawingBuffer(e,n,n)};var D0=new h,gYe=new de;_c.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===ie.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,gYe);if(!l(r))return;if(o.project(r,D0),i===ie.COLUMBUS_VIEW)return h.fromElements(D0.z,D0.x,D0.y,n);if(i===ie.SCENE2D)return h.fromElements(0,D0.x,D0.y,n);let a=e.morphTime;return h.fromElements(D.lerp(D0.z,t.x,a),D.lerp(D0.x,t.y,a),D.lerp(D0.y,t.z,a),n)};var Cde=new h,Ede=new h,vde=new R;_c.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Cde),R.computeViewportTransformation(e,0,1,vde),R.multiplyByPoint(vde,Cde,Ede),z.fromCartesian3(Ede,n)};_c.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return z.fromElements(t.x*o,t.y*r,n)};var _Ye=new se,Sde=new se;_c.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,a=r.currentFrustum,s=a.x,c=a.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-s/(m+s))/(c-s)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,_Ye);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=R.multiplyByVector(r.inverseViewProjection,f,Sde);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=Sde,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(s-c)-s-c)*.5,d.w=1,d=R.multiplyByVector(r.inverseView,d,d)}return h.fromCartesian4(d,i)};var io=_c;var lE={};lE._deprecationWarning=Hs;var P0=Uint32Array.BYTES_PER_ELEMENT;lE.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=P0;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=P0;let a=o.getUint32(t,!0);t+=P0;let s=o.getUint32(t,!0);t+=P0;let c=o.getUint32(t,!0);t+=P0;let u=o.getUint32(t,!0);t+=P0;let f=o.getUint32(t,!0);t+=P0;let d;u>=570425344?(t-=P0*2,d=s,u=c,f=0,s=0,c=0,lE._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.")):f>=570425344&&(t-=P0,d=u,u=s,f=c,s=0,c=0,lE._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;s===0?p={BATCH_LENGTH:d??0}:(p=Sr(i,t,s),t+=s);let g=new Uint8Array(e,t,c);t+=c;let m,A;u>0&&(m=Sr(i,t,u),t+=u,f>0&&(A=new Uint8Array(e,t,f),A=new Uint8Array(A),t+=f));let y=n+a-t;if(y===0)throw new re("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,y):(lE._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+y))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:A,gltf:x}};var ek=lE;function mD(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function wde(e,t,n,i,o,r){let a=e._cachedTypedArrays,s=a[t];return l(s)||(s=Y.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),a[t]=s),s}function AYe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=Y.createTypedArray(n,i),o[t]=r),r}mD.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??Y.UNSIGNED_INT,n=n??1,wde(this,e,t,n,1,i.byteOffset)):i};mD.prototype.hasProperty=function(e){return l(this.json[e])};mD.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Y.fromName(i.componentType)),wde(this,e,t,n,this.featuresLength,i.byteOffset)):AYe(this,e,t,i)};mD.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let a=this.getPropertyArray(e,t,n);if(n===1)return a[i];for(let s=0;s<n;++s)o[s]=a[n*i+s];return o};var Km=mD;function pD(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput,a=yYe(n),s;l(a.jsonProperties)&&(s=new U_({count:t,properties:a.jsonProperties}));let c;l(a.hierarchy)&&(c=new BC({extension:a.hierarchy,binaryBody:i}));let u=Hm.BATCH_TABLE_CLASS_NAME,f=a.binaryProperties,d,p,g;if(o){let y=bYe(t,u,f,i,r);g=y.transcodedSchema,p=[new iE({propertyAttribute:y.propertyAttributeJson,class:y.transcodedClass})]}else{let y=xYe(t,u,f,i);g=y.transcodedSchema;let x=y.featureTableJson;d=new mh({count:x.count,properties:x.properties,class:y.transcodedClass,bufferViews:y.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(s)||l(c)){let y=new mu({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:s,batchTableHierarchy:c});m.push(y)}let A={schema:g,propertyTables:m,propertyAttributes:p,extensions:a.extensions,extras:a.extras};return new Ys(A)}function yYe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(pD._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,a={};for(let s in e){if(!e.hasOwnProperty(s)||s==="HIERARCHY"||s==="extensions"||s==="extras")continue;let c=e[s];Array.isArray(c)?(r=l(r)?r:{},r[s]=c):a[s]=c}return{binaryProperties:a,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function xYe(e,t,n,i){let o={},r={},a={},s=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new re(`Property ${d} requires a batch table binary.`);let p=n[d],g=uh(p);r[d]={bufferView:s},o[d]=Ide(p),a[s]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),s++}let c={classes:{}};c.classes[t]={properties:o};let u=du.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:a,transcodedSchema:u,transcodedClass:u.classes[t]}}function bYe(e,t,n,i,o){let r={},a={},s=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new re(`Property ${d} requires a batch table binary.`);let g=mt.sanitizeGlslIdentifier(d);(g===""||r.hasOwnProperty(g))&&(g=`property_${s}`,s++);let m=Ide(p);m.name=d,r[g]=m;let A=g.toUpperCase();A.startsWith("_")||(A=`_${A}`);let y=p.typedArray;l(y)||(y=uh(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let x=new yn.Attribute;x.name=A,x.count=e,x.type=p.type;let b=Y.fromTypedArray(y);(b===Y.INT||b===Y.UNSIGNED_INT||b===Y.DOUBLE)&&(pD._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${A}" 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.`),y=new Float32Array(y)),x.componentDatatype=Y.fromTypedArray(y),x.typedArray=y,o.push(x),a[g]={attribute:A}}let c={classes:{}};c.classes[t]={properties:r};let u=du.fromJson(c);return{class:t,propertyAttributeJson:{properties:a},transcodedSchema:u,transcodedClass:u.classes[t]}}function Ide(e){let t=TYe(e.componentType);return{type:e.type,componentType:t}}function TYe(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"}}pD._deprecationWarning=Hs;pD._oneTimeWarning=_t;var W_=pD;var _x={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},CYe=yn.FeatureIdAttribute,hX=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,o=t.arrayBuffer,r=t.byteOffset??0,a=t.releaseGltfJson??!1,s=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??Fi.Y,f=t.forwardAxis??Fi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,g=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,A=t.loadPrimitiveOutline??!0,y=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=o,this._byteOffset=r,this._releaseGltfJson=a,this._asynchronous=s,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=p,this._enablePick=g,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=A,this._loadForClassification=y,this._state=_x.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=R.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=ek.parse(this._arrayBuffer,this._byteOffset),n=t.batchLength,i=t.featureTableJson,o=t.featureTableBinary,r=t.batchTableJson,a=t.batchTableBinary,s=new Km(i,o);n=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=n;let c=s.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(c)&&(this._transform=R.fromTranslation(h.fromArray(c))),this._batchTable={json:r,binary:a};let u=new id({typedArray:t.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=u,this._state=_x.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=_x.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return EYe(f,d)}),this._promise}process(t){if(this._state===_x.READY)return!0;if(this._state!==_x.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=R.multiplyTransformation(this._transform,i.transform,i.transform),vYe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=_x.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function EYe(e,t){return e.unload(),e._state=_x.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function vYe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=W_({count:i,batchTable:n.json,binaryBody:n.binary});else{let s=new mu({name:Hm.BATCH_TABLE_CLASS_NAME,count:i});o=new Ys({schema:{},propertyTables:[s]})}let r=t.scene.nodes,a=r.length;for(let s=0;s<a;s++)Dde(r[s]);t.structuralMetadata=o}function Dde(e){let t=e.children.length;for(let i=0;i<t;i++)Dde(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=mt.getAttributeBySemantic(o,it.FEATURE_ID);if(l(r)){r.setIndex=0;let a=new CYe;a.propertyTableId=0,a.setIndex=0,a.positionalLabel="featureId_0",o.featureIds.push(a)}}}var tk=hX;var mX=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=kYe(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function SYe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function wYe(){this.features=[]}function pX(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function gX(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=pX(e[o]);return[n]}function IYe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=gX(e[i])[0];return n}function Pde(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=gX(e[i])[0];return n}function DYe(e){let t=e.length,n=[];for(let i=0;i<t;i++){let o=Pde(e[i]);Jn(n,o)}return n}function PYe(e){return[pX(e)]}function RYe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=pX(e[i]);return n}var OYe={LineString:gX,MultiLineString:IYe,MultiPolygon:DYe,Polygon:Pde,MultiPoint:RYe,Point:PYe},MYe={LineString:Re.LINES,MultiLineString:Re.LINES,MultiPolygon:Re.LINES,Polygon:Re.LINES,MultiPoint:Re.POINTS,Point:Re.POINTS};function Rde(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=OYe[n],o=MYe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let a=new SYe;o===Re.LINES?a.lines=i(r):o===Re.POINTS&&(a.points=i(r)),a.properties=e.properties,t.features.push(a)}function BYe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Rde(n[o],t)}var LYe={FeatureCollection:BYe,Feature:Rde},nk=new h;function NYe(e,t,n){let i=0,o=0,r=e.length;for(let B=0;B<r;B++){let L=e[B];if(l(L.lines)){let _=L.lines.length;for(let C=0;C<_;C++){let v=L.lines[C];i+=v.length,o+=(v.length-1)*2}}}let a=new Float32Array(i*3),s=new Float32Array(i),c=Ue.createTypedArray(i,o),u=Ue.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let B=0;B<r;B++){let L=e[B];if(!l(L.lines))continue;let _=L.lines.length;for(let C=0;C<_;C++){let v=L.lines[C],I=v.length;for(let M=0;M<I;M++){let N=v[M],j=h.fromDegrees(N.x,N.y,N.z,te.WGS84,nk),k=R.multiplyByPoint(t,j,nk);h.minimumByComponent(f,k,f),h.maximumByComponent(d,k,d),h.pack(k,a,p*3),s[p]=B,M<I-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=Ke.createVertexBuffer({typedArray:a,context:n.context,usage:Oe.STATIC_DRAW});m.vertexArrayDestroyable=!1;let A=Ke.createVertexBuffer({typedArray:s,context:n.context,usage:Oe.STATIC_DRAW});A.vertexArrayDestroyable=!1;let y=Ke.createIndexBuffer({typedArray:c,context:n.context,usage:Oe.STATIC_DRAW,indexDatatype:u});y.vertexArrayDestroyable=!1;let x=new yn.Attribute;x.semantic=it.POSITION,x.componentDatatype=Y.FLOAT,x.type=Ft.VEC3,x.count=i,x.min=f,x.max=d,x.buffer=m;let b=new yn.Attribute;b.semantic=it.FEATURE_ID,b.setIndex=0,b.componentDatatype=Y.FLOAT,b.type=Ft.SCALAR,b.count=i,b.buffer=A;let T=[x,b],E=new yn.Material;E.unlit=!0;let S=new yn.Indices;S.indexDatatype=u,S.count=c.length,S.buffer=y;let w=new yn.FeatureIdAttribute;w.featureCount=r,w.propertyTableId=0,w.setIndex=0,w.positionalLabel="featureId_0";let P=[w],O=new yn.Primitive;return O.attributes=T,O.indices=S,O.featureIds=P,O.primitiveType=Re.LINES,O.material=E,O}function FYe(e,t,n){let i=0,o=e.length;for(let T=0;T<o;T++){let E=e[T];l(E.points)&&(i+=E.points.length)}let r=new Float32Array(i*3),a=new Float32Array(i),s=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let T=0;T<o;T++){let E=e[T];if(!l(E.points))continue;let S=E.points.length;for(let w=0;w<S;w++){let P=E.points[w],O=h.fromDegrees(P.x,P.y,P.z,te.WGS84,nk),B=R.multiplyByPoint(t,O,nk);h.minimumByComponent(s,B,s),h.maximumByComponent(c,B,c),h.pack(B,r,u*3),a[u]=T,u++}}let f=Ke.createVertexBuffer({typedArray:r,context:n.context,usage:Oe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=Ke.createVertexBuffer({typedArray:a,context:n.context,usage:Oe.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new yn.Attribute;p.semantic=it.POSITION,p.componentDatatype=Y.FLOAT,p.type=Ft.VEC3,p.count=i,p.min=s,p.max=c,p.buffer=f;let g=new yn.Attribute;g.semantic=it.FEATURE_ID,g.setIndex=0,g.componentDatatype=Y.FLOAT,g.type=Ft.SCALAR,g.count=i,g.buffer=d;let m=[p,g],A=new yn.Material;A.unlit=!0;let y=new yn.FeatureIdAttribute;y.featureCount=o,y.propertyTableId=0,y.setIndex=0,y.positionalLabel="featureId_0";let x=[y],b=new yn.Primitive;return b.attributes=m,b.featureIds=x,b.primitiveType=Re.POINTS,b.material=A,b}function kYe(e,t){let n=new wYe,i=LYe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new re("GeoJSON must have at least one feature");let a={};for(let B=0;B<r;B++){let _=o[B].properties??G.EMPTY_OBJECT;for(let C in _)_.hasOwnProperty(C)&&(l(a[C])||(a[C]=new Array(r)))}for(let B=0;B<r;B++){let L=o[B];for(let _ in a)if(a.hasOwnProperty(_)){let C=L.properties[_]??"";a[_][B]=C}}let s=new U_({count:r,properties:a}),u=[new mu({id:0,count:r,jsonMetadataTable:s})],f=du.fromJson({}),d=new Ys({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,A=!1;for(let B=0;B<r;B++){let L=o[B];if(l(L.lines)){m=!0;let _=L.lines.length;for(let C=0;C<_;C++){let v=L.lines[C],I=v.length;for(let M=0;M<I;M++)h.minimumByComponent(p,v[M],p),h.maximumByComponent(g,v[M],g)}}if(l(L.points)){A=!0;let _=L.points.length;for(let C=0;C<_;C++){let v=L.points[C];h.minimumByComponent(p,v,p),h.maximumByComponent(g,v,g)}}}let y=h.midpoint(p,g,new h),x=h.fromDegrees(y.x,y.y,y.z,te.WGS84,new h),b=pt.eastNorthUpToFixedFrame(x,te.WGS84,new R),T=R.inverseTransformation(b,new R),E=[];m&&E.push(NYe(o,T,t)),A&&E.push(FYe(o,T,t));let S=new yn.Node;S.index=0,S.primitives=E;let w=[S],P=new yn.Scene;P.nodes=w;let O=new yn.Components;return O.scene=P,O.nodes=w,O.transform=b,O.structuralMetadata=d,O}var ik=mX;var ok={};ok._deprecationWarning=Hs;var q_=Uint32Array.BYTES_PER_ELEMENT;ok.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=q_;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=q_;let a=o.getUint32(t,!0);t+=q_;let s=o.getUint32(t,!0);if(s===0)throw new re("featureTableJsonByteLength is zero, the feature table must be defined.");t+=q_;let c=o.getUint32(t,!0);t+=q_;let u=o.getUint32(t,!0);t+=q_;let f=o.getUint32(t,!0);t+=q_;let d=o.getUint32(t,!0);if(d!==1&&d!==0)throw new re(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=q_;let p=Sr(i,t,s);t+=s;let g=new Uint8Array(e,t,c);t+=c;let m,A;u>0&&(m=Sr(i,t,u),t+=u,f>0&&(A=new Uint8Array(e,t,f),A=new Uint8Array(A),t+=f));let y=n+a-t;if(y===0)throw new re("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,y):(ok._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+y))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:A,gltf:x}};var rk=ok;var R0={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},ak=yn.Attribute,zYe=yn.FeatureIdAttribute,Mde=yn.Instances,_X=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,o=t.baseResource,r=t.byteOffset??0,a=t.releaseGltfJson??!1,s=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??Fi.Y,f=t.forwardAxis??Fi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,g=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;o=l(o)?o:n.clone(),this._i3dmResource=n,this._baseResource=o,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=a,this._asynchronous=s,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._enablePick=m,this._state=R0.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=R.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=rk.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,o=t.batchTableJson,r=t.batchTableBinary,a=t.gltfFormat,s=new Km(n,i);this._featureTable=s;let c=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=c,!l(c))throw new re("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=s.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(u)&&(this._transform=R.fromTranslation(h.fromArray(u))),this._batchTable={json:o,binary:r};let f={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(a===0){let p=Ku(t.gltf);p=p.replace(/[\s\0]+$/,"");let g=this._baseResource.getDerivedResource({url:p});f.gltfResource=g,f.baseResource=g}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let d=new id(f);return this._gltfLoader=d,this._state=R0.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=R0.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw UYe(this,p)}),this._promise}process(t){if(this._state===R0.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===R0.PROCESSING&&(i=n.process(t)),!i)return!1;let o=n.components;return o.transform=R.multiplyTransformation(this._transform,o.transform,o.transform),GYe(this,o,t),VYe(this,o),this._components=o,this._arrayBuffer=void 0,this._state=R0.READY,!0}isUnloaded(){return this._state===R0.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),XYe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=R0.UNLOADED}};function UYe(e,t){return e.unload(),e._state=R0.FAILED,e.getError("Failed to load i3dm",t)}function VYe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=W_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new mu({name:Hm.BATCH_TABLE_CLASS_NAME,count:i});o=new Ys({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var sk=new h,AX=new Array(4),jYe=new R;function GYe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let a=o.getGlobalProperty("RTC_CENTER",Y.FLOAT,3),s=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||s,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=WYe(o,r),d;c&&(d=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let g=new Float32Array(r),m=h.unpackArray(f),A=new h,y=new h,x=new h,b=new h,T=new $,E=new Le,S=new Array(4),w=new h,P=new Array(3),O=new R;if(!l(a)||h.equals(h.unpack(a),h.ZERO)){let k=ce.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],k.center,sk),f[3*i+0]=sk.x,f[3*i+1]=sk.y,f[3*i+2]=sk.z;let V=R.fromTranslation(k.center,jYe);t.transform=R.multiplyTransformation(V,t.transform,t.transform)}for(i=0;i<r;i++){A=h.clone(m[i]),l(a)&&h.add(A,h.unpack(a),A),c&&(qYe(o,s,i,E,A,x,y,b,T,O),Le.pack(E,S,0),d[4*i+0]=S[0],d[4*i+1]=S[1],d[4*i+2]=S[2],d[4*i+3]=S[3]),u&&(YYe(o,i,w),h.pack(w,P,0),p[3*i+0]=P[0],p[3*i+1]=P[1],p[3*i+2]=P[2]);let k=o.getProperty("BATCH_ID",Y.UNSIGNED_SHORT,1,i);l(k)||(k=i),g[i]=k}let B=new Mde;B.transformInWorldSpace=!0;let L=e._buffers,_=new ak;if(_.name="Instance Translation",_.semantic=wr.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Ft.VEC3,_.count=r,_.typedArray=f,!c){let k=Ke.createVertexBuffer({context:n.context,typedArray:f,usage:Oe.STATIC_DRAW});k.vertexArrayDestroyable=!1,L.push(k),_.buffer=k}if(B.attributes.push(_),c){let k=new ak;k.name="Instance Rotation",k.semantic=wr.ROTATION,k.componentDatatype=Y.FLOAT,k.type=Ft.VEC4,k.count=r,k.typedArray=d,B.attributes.push(k)}if(u){let k=new ak;if(k.name="Instance Scale",k.semantic=wr.SCALE,k.componentDatatype=Y.FLOAT,k.type=Ft.VEC3,k.count=r,c)k.typedArray=p;else{let V=Ke.createVertexBuffer({context:n.context,typedArray:p,usage:Oe.STATIC_DRAW});V.vertexArrayDestroyable=!1,L.push(V),k.buffer=V}B.attributes.push(k)}let C=new ak;C.name="Instance Feature ID",C.setIndex=0,C.semantic=wr.FEATURE_ID,C.componentDatatype=Y.FLOAT,C.type=Ft.SCALAR,C.count=r;let v=Ke.createVertexBuffer({context:n.context,typedArray:g,usage:Oe.STATIC_DRAW});v.vertexArrayDestroyable=!1,L.push(v),C.buffer=v,B.attributes.push(C);let I=new zYe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",B.featureIds.push(I);let M=t.nodes,N=M.length,j=!1;for(i=0;i<N;i++){let k=M[i];k.primitives.length>0&&(k.instances=j?HYe(B):B,j=!0)}}function HYe(e){let t=new Mde;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=qe(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function WYe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Y.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(o))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let a=0;a<n.length/3;a++)for(let s=0;s<3;s++){let c=3*a+s;r[c]=n[c]/65535*o[s]+i[s]}return r}else throw new re("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Ode=new Array(4);function qYe(e,t,n,i,o,r,a,s,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,AX),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,Ode),p=!1;if(l(f)){if(!l(d))throw new re("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,r),h.unpack(d,0,a),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Y.UNSIGNED_SHORT,2,n,AX),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,Ode);if(l(g)){if(!l(m))throw new re("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");on.octDecodeInRange(g[0],g[1],65535,r),on.octDecodeInRange(m[0],m[1],65535,a),p=!0}else t?(pt.eastNorthUpToFixedFrame(o,te.WGS84,u),R.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(a,r,s),h.normalize(s,s),$.setColumn(c,0,a,c),$.setColumn(c,1,r,c),$.setColumn(c,2,s,c)),Le.fromRotationMatrix(c,i)}function YYe(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Y.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",Y.FLOAT,3,t,AX);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function XYe(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}var ck=_X;var Bde={STOPPED:0,ANIMATING:1};Object.freeze(Bde);var Qm=Bde;function uE(){this.times=void 0,this.points=void 0,_e.throwInstantiationError()}uE.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};uE.prototype.evaluate=_e.throwInstantiationError;uE.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=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};uE.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};uE.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var To=uE;function fE(e){this._value=e,this._valueType=To.getPointType(e)}Object.defineProperties(fE.prototype,{value:{get:function(){return this._value}}});fE.prototype.findTimeInterval=function(e){};fE.prototype.wrapTime=function(e){return 0};fE.prototype.clampTime=function(e){return 0};fE.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var lk=fE;function dE(e){e=e??G.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(dE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});dE.prototype.findTimeInterval=To.prototype.findTimeInterval;dE.prototype.wrapTime=To.prototype.wrapTime;dE.prototype.clampTime=To.prototype.clampTime;dE.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 Ax=dE;var Lde={};Lde.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),a=new Array(i.length),s;for(s=0;s<r.length;s++)r[s]=new h,a[s]=new h;o[0]=n[0]/t[0],r[0]=h.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(s=1;s<o.length;++s)c=1/(t[s]-o[s-1]*e[s-1]),o[s]=n[s]*c,r[s]=h.subtract(i[s],h.multiplyByScalar(r[s-1],e[s-1],r[s]),r[s]),r[s]=h.multiplyByScalar(r[s],c,r[s]);for(c=1/(t[s]-o[s-1]*e[s-1]),r[s]=h.subtract(i[s],h.multiplyByScalar(r[s-1],e[s-1],r[s]),r[s]),r[s]=h.multiplyByScalar(r[s],c,r[s]),a[a.length-1]=r[r.length-1],s=a.length-2;s>=0;--s)a[s]=h.subtract(r[s],h.multiplyByScalar(a[s+1],o[s],a[s]),a[s]);return a};var gD=Lde;var Nde=[],Fde=[],kde=[],zde=[];function KYe(e,t,n){let i=Nde,o=kde,r=Fde,a=zde;i.length=o.length=e.length-1,r.length=a.length=e.length;let s;i[0]=r[0]=1,o[0]=0;let c=a[0];for(l(c)||(c=a[0]=new h),h.clone(t,c),s=1;s<i.length-1;++s)i[s]=o[s]=1,r[s]=4,c=a[s],l(c)||(c=a[s]=new h),h.subtract(e[s+1],e[s-1],c),h.multiplyByScalar(c,3,c);return i[s]=0,o[s]=1,r[s]=4,c=a[s],l(c)||(c=a[s]=new h),h.subtract(e[s+1],e[s-1],c),h.multiplyByScalar(c,3,c),r[s+1]=1,c=a[s+1],l(c)||(c=a[s+1]=new h),h.clone(n,c),gD.solve(i,r,o,a)}function QYe(e){let t=Nde,n=kde,i=Fde,o=zde;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let a=o[0];for(l(a)||(a=o[0]=new h),h.subtract(e[1],e[0],a),h.multiplyByScalar(a,3,a),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,a=o[r],l(a)||(a=o[r]=new h),h.subtract(e[r+1],e[r-1],a),h.multiplyByScalar(a,3,a);return i[r]=2,a=o[r],l(a)||(a=o[r]=new h),h.subtract(e[r],e[r-1],a),h.multiplyByScalar(a,3,a),gD.solve(t,i,n,o)}function gu(e){e=e??G.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(gu.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}}});gu.createC1=function(e){e=e??G.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 gu({times:t,points:n,inTangents:r,outTangents:o})};gu.createNaturalCubic=function(e){e=e??G.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new Ax({points:n,times:t});let i=QYe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new gu({times:t,points:n,inTangents:r,outTangents:o})};gu.createClampedCubic=function(e){e=e??G.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 Ax({points:n,times:t});let a=KYe(n,i,o),s=a.slice(0,a.length-1),c=a.slice(1,a.length);return new gu({times:t,points:n,inTangents:c,outTangents:s})};gu.hermiteCoefficientMatrix=new R(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);gu.prototype.findTimeInterval=To.prototype.findTimeInterval;var $Ye=new se,hE=new h;gu.prototype.wrapTime=To.prototype.wrapTime;gu.prototype.clampTime=To.prototype.clampTime;gu.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 a=this._lastTimeIndex,s=i[a+1]-i[a],c=(e-i[a])/s,u=$Ye;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=R.multiplyByVector(gu.hermiteCoefficientMatrix,u,u);f.z*=s,f.w*=s;let d=this._pointType;return d===Number?n[a]*f.x+n[a+1]*f.y+r[a]*f.z+o[a]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[a],f.x,t),d.multiplyByScalar(n[a+1],f.y,hE),d.add(t,hE,t),d.multiplyByScalar(r[a],f.z,hE),d.add(t,hE,t),d.multiplyByScalar(o[a],f.w,hE),d.add(t,hE,t))};var yx=gu;function mE(e){e=e??G.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(mE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});mE.prototype.findTimeInterval=To.prototype.findTimeInterval;mE.prototype.wrapTime=To.prototype.wrapTime;mE.prototype.clampTime=To.prototype.clampTime;mE.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 uk=mE;function JYe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Le);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[r])/(n[r+1]-n[r]),s=t[r],c=t[r+1];return Le.fastSlerp(s,c,a,o)}}function pE(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=JYe(this),this._lastTimeIndex=0}Object.defineProperties(pE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});pE.prototype.findTimeInterval=To.prototype.findTimeInterval;pE.prototype.wrapTime=To.prototype.wrapTime;pE.prototype.clampTime=To.prototype.clampTime;pE.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var fk=pE;var gE=yn.AnimatedPropertyType;function yX(e){e=e??G.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,iXe(this)}Object.defineProperties(yX.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 ZYe(e,t){let n=[],i=[],o=[],r=t.length;for(let a=0;a<r;a+=3)i.push(t[a]),n.push(t[a+1]),o.push(t[a+2]);return i.splice(0,1),o.length=o.length-1,new yx({times:e,points:n,inTangents:i,outTangents:o})}function Ude(e,t,n,i){if(e.length===1&&t.length===1)return new lk(t[0]);switch(n){case Xm.STEP:return new uk({times:e,points:t});case Xm.CUBICSPLINE:return ZYe(e,t);case Xm.LINEAR:return i===gE.ROTATION?new fk({times:e,points:t}):new Ax({times:e,points:t})}}function eXe(e,t,n,i,o){let r=[];if(i===gE.WEIGHTS){let s=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(s),d=c;if(n===Xm.CUBICSPLINE)for(u=0;u<s;u+=3)f[u]=t[d],f[u+1]=t[d+o],f[u+2]=t[d+2*o],d+=o*3;else for(u=0;u<s;u++)f[u]=t[d],d+=o;r.push(Ude(e,f,n,i))}}else r.push(Ude(e,t,n,i));return r}var tXe=new h,nXe=new Le;function iXe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,s=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=eXe(i,o,r,s,u);e._splines=f,e._path=s}yX.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===gE.WEIGHTS){let r=o.morphWeights,a=r.length;for(let s=0;s<a;s++){let c=t[s],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[s]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],a=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===gE.TRANSLATION||n===gE.SCALE?o[n]=r.evaluate(a,tXe):n===gE.ROTATION&&(o[n]=r.evaluate(a,nXe))}}};var dk=yX;function xX(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=Q.clone(n.startTime),this._delay=n.delay??0,this._stopTime=Q.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??ef.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new ye,this.update=new ye,this.stop=new ye,this._state=Qm.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,oXe(this)}Object.defineProperties(xX.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 oXe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,a=r.length,s=[];for(let c=0;c<a;c++){let u=r[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new dk({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),s.push(g)}e._runtimeChannels=s,e._localStartTime=t,e._localStopTime=n}xX.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var hk=xX;function O0(e){this.animationAdded=new ye,this.animationRemoved=new ye,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(O0.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function bX(e,t,n){let i=e._model,o=new hk(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}O0.prototype.add=function(e){e=e??G.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return bX(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 bX(this,n[i],e)};O0.prototype.addAll=function(e){e=e??G.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let a=bX(this,n[r],e);i.push(a)}return i};O0.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};O0.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])};O0.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};O0.prototype.get=function(e){return this._runtimeAnimations[e]};var mk=[];function rXe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}O0.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&Q.equals(e.time,this._previousTime))return!1;this._previousTime=Q.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let a=0;a<n;++a){let s=t[a];l(s._computedStartTime)||(s._computedStartTime=Q.addSeconds(s.startTime??o,s.delay,new Q)),l(s._duration)||(s._duration=s.localStopTime*(1/s.multiplier));let c=s._computedStartTime,u=s._duration,f=s.stopTime,d=Q.lessThanOrEquals(c,o),p=l(f)&&Q.greaterThan(o,f),g=0;if(u!==0){let y=Q.secondsDifference(p?f:o,c);g=l(s._animationTime)?s._animationTime(u,y):y/u}let m=s.loop===ef.REPEAT||s.loop===ef.MIRRORED_REPEAT,A=(d||m&&!l(s.startTime))&&(g<=1||m)&&!p;if(g===s._prevAnimationDelta){let y=s._state===Qm.STOPPED;if(A!==y)continue}if(s._prevAnimationDelta=g,A||s._state===Qm.ANIMATING){if(A&&s._state===Qm.STOPPED&&(s._state=Qm.ANIMATING,s.start.numberOfListeners>0&&e.afterRender.push(s._raiseStartEvent)),s.loop===ef.REPEAT)g=g-Math.floor(g);else if(s.loop===ef.MIRRORED_REPEAT){let x=Math.floor(g),b=g-x;g=x%2===1?1-b:b}s.reverse&&(g=1-g);let y=g*u*s.multiplier;y=D.clamp(y,s.localStartTime,s.localStopTime),s.animate(y),s.update.numberOfListeners>0&&(s._updateEventTime=y,e.afterRender.push(s._raiseUpdateEvent)),i=!0,A||(s._state=Qm.STOPPED,s.stop.numberOfListeners>0&&e.afterRender.push(s._raiseStopEvent),s.removeOnStop&&mk.push(s))}}n=mk.length;for(let a=0;a<n;++a){let s=mk[a];t.splice(t.indexOf(s),1),e.afterRender.push(rXe(this,r,s))}return mk.length=0,i};var pk=O0;function xx(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(xx.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 U),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}}});xx.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};xx.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};xx.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};xx.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};xx.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var gk=xx;var _E={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};_E.getStyleCommandsNeeded=function(e,t){return t===0?_E.ALL_OPAQUE:t===e?_E.ALL_TRANSLUCENT:_E.OPAQUE_AND_TRANSLUCENT};Object.freeze(_E);var $m=_E;var M0={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};M0.is3DTiles=function(e){switch(e){case M0.TILE_GLTF:case M0.TILE_B3DM:case M0.TILE_I3DM:case M0.TILE_PNTS:case M0.TILE_GEOJSON:return!0;case M0.GLTF:return!1}};Object.freeze(M0);var qr=M0;function ca(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=$m.ALL_OPAQUE,aXe(this)}Object.defineProperties(ca.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 aXe(e){let t=e._model,n=qr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let a=t.content;for(o=0;o<i;o++)r[o]=new as(a,o)}else for(o=0;o<i;o++)r[o]=new gk({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new uu({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}ca.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=$m.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};ca.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ca.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ca.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ca.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ca.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ca.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ca.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};ca.prototype.getFeature=function(e){return this._features[e]};ca.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};ca.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};ca.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};ca.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};ca.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};ca.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};ca.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};ca.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};ca.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var sXe=new U;ca.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(uu.DEFAULT_COLOR_VALUE),this.setAllShow(uu.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,sXe)??uu.DEFAULT_COLOR_VALUE:uu.DEFAULT_COLOR_VALUE,o=l(e.show)?e.show.evaluate(n)??uu.DEFAULT_SHOW_VALUE:uu.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};ca.prototype.isDestroyed=function(){return!1};ca.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),fe(this)};var _k=ca;var Vde={name:"TilesetPipelineStage"};Vde.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,he.FRAGMENT);let r={u_polygonOffset:function(){return z.ZERO}};e.uniformMap=It(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Ht.setCesium3DTileBit(),i.stencilMask=Ht.CESIUM_3D_TILE_MASK};var Ak=Vde;var yk=`// robust iterative solution without trig functions
  7206. // https://github.com/0xfaded/ellipse_demo/issues/1
  7207. // https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
  7208. //
  7209. // This version uses only a single iteration for best performance. For fog
  7210. // rendering, the difference is negligible.
  7211. vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) {
  7212. vec2 p = abs(pos);
  7213. vec2 inverseRadii = 1.0 / radii;
  7214. vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii;
  7215. // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
  7216. // but store the cos and sin of t in a vec2 for efficiency.
  7217. // Initial guess: t = cos(pi/4)
  7218. vec2 tTrigs = vec2(0.70710678118);
  7219. vec2 v = radii * tTrigs;
  7220. // Find the evolute of the ellipse (center of curvature) at v.
  7221. vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;
  7222. // Find the (approximate) intersection of p - evolute with the ellipsoid.
  7223. vec2 q = normalize(p - evolute) * length(v - evolute);
  7224. // Update the estimate of t.
  7225. tTrigs = (q + evolute) * inverseRadii;
  7226. tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
  7227. v = radii * tTrigs;
  7228. return v * sign(pos);
  7229. }
  7230. vec3 computeEllipsoidPositionWC(vec3 positionMC) {
  7231. // Get the world-space position and project onto a meridian plane of
  7232. // the ellipsoid
  7233. vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
  7234. vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);
  7235. vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);
  7236. // Reconstruct a 3D point in world space
  7237. return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);
  7238. }
  7239. void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {
  7240. vec3 fogColor = groundAtmosphereColor.rgb;
  7241. // If there is dynamic lighting, apply that to the fog.
  7242. const float NONE = 0.0;
  7243. if (czm_atmosphereDynamicLighting != NONE) {
  7244. float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);
  7245. fogColor *= darken;
  7246. }
  7247. // Tonemap if HDR rendering is disabled
  7248. #ifndef HDR
  7249. fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
  7250. fogColor.rgb = czm_inverseGamma(fogColor.rgb);
  7251. #endif
  7252. vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar);
  7253. color = vec4(withFog, color.a);
  7254. }
  7255. void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) {
  7256. vec3 rayleighColor;
  7257. vec3 mieColor;
  7258. float opacity;
  7259. vec3 positionWC;
  7260. vec3 lightDirection;
  7261. // When the camera is in space, compute the position per-fragment for
  7262. // more accurate ground atmosphere. All other cases will use
  7263. //
  7264. // The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717
  7265. if (false) {
  7266. positionWC = computeEllipsoidPositionWC(attributes.positionMC);
  7267. lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
  7268. // The fog color is derived from the ground atmosphere color
  7269. czm_computeGroundAtmosphereScattering(
  7270. positionWC,
  7271. lightDirection,
  7272. rayleighColor,
  7273. mieColor,
  7274. opacity
  7275. );
  7276. } else {
  7277. positionWC = attributes.positionWC;
  7278. lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
  7279. rayleighColor = v_atmosphereRayleighColor;
  7280. mieColor = v_atmosphereMieColor;
  7281. opacity = v_atmosphereOpacity;
  7282. }
  7283. //color correct rayleigh and mie colors
  7284. const bool ignoreBlackPixels = true;
  7285. rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels);
  7286. mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels);
  7287. vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
  7288. if (u_isInFog) {
  7289. float distanceToCamera = length(attributes.positionEC);
  7290. applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera);
  7291. } else {
  7292. // Ground atmosphere
  7293. }
  7294. }
  7295. `;var xk=`void atmosphereStage(ProcessedAttributes attributes) {
  7296. vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);
  7297. czm_computeGroundAtmosphereScattering(
  7298. // This assumes the geometry stage came before this.
  7299. v_positionWC,
  7300. lightDirection,
  7301. v_atmosphereRayleighColor,
  7302. v_atmosphereMieColor,
  7303. v_atmosphereOpacity
  7304. );
  7305. }
  7306. `;var jde={name:"AtmospherePipelineStage"};jde.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,he.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,he.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([xk]),i.addFragmentLines([yk]),i.addUniform("bool","u_isInFog",he.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=h.distance(n.camera.positionWC,t.boundingSphere.center);return D.fog(o,n.fog.density)>D.EPSILON3}};var bk=jde;var Tk=`#ifdef DIFFUSE_IBL
  7307. vec3 sampleDiffuseEnvironment(vec3 cubeDir)
  7308. {
  7309. #ifdef CUSTOM_SPHERICAL_HARMONICS
  7310. return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients);
  7311. #else
  7312. return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients);
  7313. #endif
  7314. }
  7315. #endif
  7316. #ifdef SPECULAR_IBL
  7317. vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness)
  7318. {
  7319. #ifdef CUSTOM_SPECULAR_IBL
  7320. float lod = roughness * model_specularEnvironmentMapsMaximumLOD;
  7321. return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb;
  7322. #else
  7323. float lod = roughness * czm_specularEnvironmentMapsMaximumLOD;
  7324. return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb;
  7325. #endif
  7326. }
  7327. vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness)
  7328. {
  7329. // see https://bruop.github.io/ibl/ at Single Scattering Results
  7330. // Roughness dependent fresnel, from Fdez-Aguera
  7331. vec3 f90 = max(vec3(1.0 - roughness), f0);
  7332. vec3 F = fresnelSchlick2(f0, f90, NdotV);
  7333. vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
  7334. vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness);
  7335. return specularSample * (F * brdfLut.x + brdfLut.y);
  7336. }
  7337. #endif
  7338. #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
  7339. /**
  7340. * Compute the light contributions from environment maps and spherical harmonic coefficients.
  7341. * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation
  7342. * of the single- and multi-scattering terms.
  7343. *
  7344. * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position.
  7345. * @param {vec3} normalEC The surface normal in eye coordinates.
  7346. * @param {czm_modelMaterial} The material properties.
  7347. * @return {vec3} The computed HDR color.
  7348. */
  7349. vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) {
  7350. vec3 f0 = material.specular;
  7351. float roughness = material.roughness;
  7352. float specularWeight = 1.0;
  7353. #ifdef USE_SPECULAR
  7354. specularWeight = material.specularWeight;
  7355. #endif
  7356. float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0);
  7357. // see https://bruop.github.io/ibl/ at Single Scattering Results
  7358. // Roughness dependent fresnel, from Fdez-Aguera
  7359. vec3 f90 = max(vec3(1.0 - roughness), f0);
  7360. vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV);
  7361. vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
  7362. vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y);
  7363. #ifdef DIFFUSE_IBL
  7364. vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC);
  7365. vec3 irradiance = sampleDiffuseEnvironment(normalMC);
  7366. vec3 averageFresnel = f0 + (1.0 - f0) / 21.0;
  7367. float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y);
  7368. vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems);
  7369. vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse;
  7370. vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x;
  7371. #else
  7372. vec3 diffuseContribution = vec3(0.0);
  7373. #endif
  7374. #ifdef USE_ANISOTROPY
  7375. // Bend normal to account for anisotropic distortion of specular reflection
  7376. vec3 anisotropyDirection = material.anisotropicB;
  7377. vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC);
  7378. vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);
  7379. float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness);
  7380. float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;
  7381. vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4));
  7382. vec3 reflectEC = reflect(-viewDirectionEC, bentNormal);
  7383. #else
  7384. vec3 reflectEC = reflect(-viewDirectionEC, normalEC);
  7385. #endif
  7386. #ifdef SPECULAR_IBL
  7387. vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC);
  7388. vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness);
  7389. vec3 specularContribution = radiance * FssEss * model_iblFactor.y;
  7390. #else
  7391. vec3 specularContribution = vec3(0.0);
  7392. #endif
  7393. return diffuseContribution + specularContribution;
  7394. }
  7395. #endif
  7396. `;var Gde={name:"ImageBasedLightingPipelineStage"},cXe=new z;Gde.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,a;l(i.specularEnvironmentMaps)||(a=o.radianceCubeMap);let s=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,he.FRAGMENT),r.addUniform("vec2","model_iblFactor",he.FRAGMENT),Nm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",he.FRAGMENT),l(a)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,he.BOTH),l(s)&&l(s[0])?(r.addDefine("DIFFUSE_IBL",void 0,he.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,he.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",he.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,he.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(a)?(r.addDefine("SPECULAR_IBL",void 0,he.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,he.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",he.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",he.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,he.FRAGMENT)),r.addFragmentLines(Tk);let c={model_iblFactor:function(){return z.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,cXe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return s},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(a)&&(c.model_specularEnvironmentMaps=function(){return a},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=It(c,e.uniformMap)};var Ck=Gde;var lXe=D.EPSILON16;function CX(e){e=e??G.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(CX.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=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,lXe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var uXe=new h,TX=new $;CX.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=uXe,o;switch(t){case Rl.XROTATE:o=$.fromRotationX(D.toRadians(n),TX),e=R.multiplyByMatrix3(e,o,e);break;case Rl.YROTATE:o=$.fromRotationY(D.toRadians(n),TX),e=R.multiplyByMatrix3(e,o,e);break;case Rl.ZROTATE:o=$.fromRotationZ(D.toRadians(n),TX),e=R.multiplyByMatrix3(e,o,e);break;case Rl.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=R.multiplyByTranslation(e,i,e);break;case Rl.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=R.multiplyByTranslation(e,i,e);break;case Rl.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=R.multiplyByTranslation(e,i,e);break;case Rl.XSCALE:i.x=n,i.y=1,i.z=1,e=R.multiplyByScale(e,i,e);break;case Rl.YSCALE:i.x=1,i.y=n,i.z=1,e=R.multiplyByScale(e,i,e);break;case Rl.ZSCALE:i.x=1,i.y=1,i.z=n,e=R.multiplyByScale(e,i,e);break;case Rl.UNIFORMSCALE:e=R.multiplyByUniformScale(e,n,e);break;default:break}return e};var Ek=CX;function vk(e){e=e??G.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,fXe(this)}Object.defineProperties(vk.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 fXe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let a=0;a<i;a++){let s=n[a],c=new Ek({stage:s,runtimeArticulation:e});o.push(c);let u=s.name;r[u]=c}}vk.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var dXe=new R,hXe=new R;vk.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=R.clone(R.IDENTITY,dXe),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 a=o[t],s=R.multiplyTransformation(a.originalTransform,e,hXe);a.transform=s}};var Sk=vk;var wk=`void modelColorStage(inout czm_modelMaterial material)
  7397. {
  7398. material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);
  7399. float highlight = ceil(model_colorBlend);
  7400. material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);
  7401. material.alpha *= model_color.a;
  7402. }
  7403. `;var AE={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};AE.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,he.FRAGMENT),i.addFragmentLines(wk);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=Ie.TRANSLUCENT),i.addUniform("vec4",AE.COLOR_UNIFORM_NAME,he.FRAGMENT),o[AE.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",AE.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),o[AE.COLOR_BLEND_UNIFORM_NAME]=function(){return Pl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=It(o,e.uniformMap)};var bx=AE;var Ik=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
  7404. vec4 getClippingPlane(
  7405. highp sampler2D packedClippingPlanes,
  7406. int clippingPlaneNumber,
  7407. mat4 transform
  7408. ) {
  7409. int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
  7410. int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
  7411. float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
  7412. float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
  7413. float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
  7414. float v = (float(pixY) + 0.5) * pixelHeight;
  7415. vec4 plane = texture(packedClippingPlanes, vec2(u, v));
  7416. return czm_transformPlane(plane, transform);
  7417. }
  7418. #else
  7419. // Handle uint8 clipping texture instead
  7420. vec4 getClippingPlane(
  7421. highp sampler2D packedClippingPlanes,
  7422. int clippingPlaneNumber,
  7423. mat4 transform
  7424. ) {
  7425. int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each
  7426. int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
  7427. int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
  7428. float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
  7429. float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
  7430. float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
  7431. float v = (float(pixY) + 0.5) * pixelHeight;
  7432. vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
  7433. vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
  7434. vec4 plane;
  7435. plane.xyz = czm_octDecode(oct, 65535.0);
  7436. plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
  7437. return czm_transformPlane(plane, transform);
  7438. }
  7439. #endif
  7440. float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
  7441. vec4 position = czm_windowToEyeCoordinates(fragCoord);
  7442. vec3 clipNormal = vec3(0.0);
  7443. vec3 clipPosition = vec3(0.0);
  7444. float pixelWidth = czm_metersPerPixel(position);
  7445. #ifdef UNION_CLIPPING_REGIONS
  7446. 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.
  7447. #else
  7448. float clipAmount = 0.0;
  7449. bool clipped = true;
  7450. #endif
  7451. for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
  7452. vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
  7453. clipNormal = clippingPlane.xyz;
  7454. clipPosition = -clippingPlane.w * clipNormal;
  7455. float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
  7456. #ifdef UNION_CLIPPING_REGIONS
  7457. clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
  7458. if (amount <= 0.0) {
  7459. discard;
  7460. }
  7461. #else
  7462. clipAmount = max(amount, clipAmount);
  7463. clipped = clipped && (amount <= 0.0);
  7464. #endif
  7465. }
  7466. #ifndef UNION_CLIPPING_REGIONS
  7467. if (clipped) {
  7468. discard;
  7469. }
  7470. #endif
  7471. return clipAmount;
  7472. }
  7473. void modelClippingPlanesStage(inout vec4 color)
  7474. {
  7475. float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
  7476. vec4 clippingPlanesEdgeColor = vec4(1.0);
  7477. clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
  7478. float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
  7479. if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
  7480. color = clippingPlanesEdgeColor;
  7481. }
  7482. }
  7483. `;var Hde={name:"ModelClippingPlanesPipelineStage"},mXe=new z;Hde.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,he.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,he.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,he.FRAGMENT),ba.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,he.FRAGMENT);let a=ba.getTextureResolution(i,o,mXe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",a.x,he.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",a.y,he.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",he.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",he.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",he.FRAGMENT),r.addFragmentLines(Ik);let s={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=U.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=It(s,e.uniformMap)};var Dk=Hde;var Pk=`void modelClippingPolygonsStage(ProcessedAttributes attributes)
  7484. {
  7485. vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC);
  7486. sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
  7487. vec2 minDistance = vec2(czm_infinity);
  7488. v_regionIndex = -1;
  7489. v_clippingPosition = vec2(czm_infinity);
  7490. for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
  7491. vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex);
  7492. vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;
  7493. vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
  7494. vec2 distance = abs(rectUv - clamped) * extents.wz;
  7495. if (minDistance.x > distance.x || minDistance.y > distance.y) {
  7496. minDistance = distance;
  7497. v_clippingPosition = rectUv;
  7498. }
  7499. float threshold = 0.01;
  7500. if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
  7501. v_regionIndex = regionIndex;
  7502. }
  7503. }
  7504. }
  7505. `;var Rk=`void modelClippingPolygonsStage()
  7506. {
  7507. vec2 clippingPosition = v_clippingPosition;
  7508. int regionIndex = v_regionIndex;
  7509. czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
  7510. }
  7511. `;var Wde={name:"ModelClippingPolygonsPipelineStage"};Wde.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,he.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,he.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,he.BOTH),o.addUniform("sampler2D","model_clippingDistance",he.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",he.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(Pk),o.addFragmentLines(Rk);let r={model_clippingDistance:function(){return i.clippingTexture??n.context.defaultTexture},model_clippingExtents:function(){return i.extentsTexture??n.context.defaultTexture}};e.uniformMap=It(r,e.uniformMap)};var Ok=Wde;function qde(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(qde.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 Mk=qde;var Bk=`mat4 getInstancingTransform()
  7512. {
  7513. mat4 instancingTransform;
  7514. #ifdef HAS_INSTANCE_MATRICES
  7515. instancingTransform = mat4(
  7516. a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1
  7517. a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2
  7518. a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3
  7519. a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4
  7520. );
  7521. #else
  7522. vec3 translation = vec3(0.0, 0.0, 0.0);
  7523. vec3 scale = vec3(1.0, 1.0, 1.0);
  7524. #ifdef HAS_INSTANCE_TRANSLATION
  7525. translation = a_instanceTranslation;
  7526. #endif
  7527. #ifdef HAS_INSTANCE_SCALE
  7528. scale = a_instanceScale;
  7529. #endif
  7530. instancingTransform = mat4(
  7531. scale.x, 0.0, 0.0, 0.0,
  7532. 0.0, scale.y, 0.0, 0.0,
  7533. 0.0, 0.0, scale.z, 0.0,
  7534. translation.x, translation.y, translation.z, 1.0
  7535. );
  7536. #endif
  7537. return instancingTransform;
  7538. }
  7539. #ifdef USE_2D_INSTANCING
  7540. mat4 getInstancingTransform2D()
  7541. {
  7542. mat4 instancingTransform2D;
  7543. #ifdef HAS_INSTANCE_MATRICES
  7544. instancingTransform2D = mat4(
  7545. a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1
  7546. a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2
  7547. a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3
  7548. a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4
  7549. );
  7550. #else
  7551. vec3 translation2D = vec3(0.0, 0.0, 0.0);
  7552. vec3 scale = vec3(1.0, 1.0, 1.0);
  7553. #ifdef HAS_INSTANCE_TRANSLATION
  7554. translation2D = a_instanceTranslation2D;
  7555. #endif
  7556. #ifdef HAS_INSTANCE_SCALE
  7557. scale = a_instanceScale;
  7558. #endif
  7559. instancingTransform2D = mat4(
  7560. scale.x, 0.0, 0.0, 0.0,
  7561. 0.0, scale.y, 0.0, 0.0,
  7562. 0.0, 0.0, scale.z, 0.0,
  7563. translation2D.x, translation2D.y, translation2D.z, 1.0
  7564. );
  7565. #endif
  7566. return instancingTransform2D;
  7567. }
  7568. #endif
  7569. `;var Lk=`void instancingStage(inout ProcessedAttributes attributes)
  7570. {
  7571. vec3 positionMC = attributes.positionMC;
  7572. mat4 instancingTransform = getInstancingTransform();
  7573. attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;
  7574. #ifdef HAS_NORMALS
  7575. vec3 normalMC = attributes.normalMC;
  7576. attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;
  7577. #endif
  7578. #ifdef USE_2D_INSTANCING
  7579. mat4 instancingTransform2D = getInstancingTransform2D();
  7580. attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
  7581. #endif
  7582. }
  7583. `;var Nk=`void legacyInstancingStage(
  7584. inout ProcessedAttributes attributes,
  7585. out mat4 instanceModelView,
  7586. out mat3 instanceModelViewInverseTranspose)
  7587. {
  7588. vec3 positionMC = attributes.positionMC;
  7589. mat4 instancingTransform = getInstancingTransform();
  7590. mat4 instanceModel = instancingTransform * u_instance_nodeTransform;
  7591. instanceModelView = u_instance_modifiedModelView;
  7592. instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);
  7593. attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;
  7594. #ifdef USE_2D_INSTANCING
  7595. mat4 instancingTransform2D = getInstancingTransform2D();
  7596. attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
  7597. #endif
  7598. }
  7599. `;var Fk=new R,pXe=new R,gXe=new R,Xde={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Zde,_transformsToTypedArray:vX};Xde.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(Bk);let a=e.model,s=a.sceneGraph,c=e.runtimeNode,u=n.mode!==ie.SCENE3D&&!n.scene3DOnly&&a._projectTo2D,f=a._enablePick&&!n.context.webgl2,d=[];RXe(e,n,i,d,u,f),BXe(e,n,i,d);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,he.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",he.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",he.VERTEX),p.u_instance_modifiedModelView=function(){let g=R.multiplyTransformation(a.modelMatrix,s.components.transform,Fk);return u?R.multiplyTransformation(n.context.uniformState.view3D,g,Fk):(n.mode!==ie.SCENE3D&&(g=pt.basisTo2D(n.mapProjection,g,Fk)),R.multiplyTransformation(n.context.uniformState.view,g,Fk))},p.u_instance_nodeTransform=function(){return R.multiplyTransformation(s.axisCorrectionMatrix,c.computedTransform,pXe)},r.addVertexLines(Nk)):r.addVertexLines(Lk),u){r.addDefine("USE_2D_INSTANCING",void 0,he.VERTEX),r.addUniform("mat4","u_modelView2D",he.VERTEX);let g=n.context,m=R.fromTranslation(c.instancingReferencePoint2D,new R);p.u_modelView2D=function(){return R.multiplyTransformation(g.uniformState.view,m,gXe)}}e.uniformMap=It(p,e.uniformMap),e.instanceCount=o,Jn(e.attributes,d)};var _D=new R,_Xe=new h;function AXe(e,t,n,i,o){let r=R.multiplyTransformation(t,e,_D);return r=R.multiplyTransformation(r,n,_D),o=pt.basisTo2D(i.mapProjection,r,o),o}function yXe(e,t,n,i,o){let r=R.fromTranslation(e,_D),a=R.multiplyTransformation(t,r,_D);a=R.multiplyTransformation(a,n,_D);let s=R.getTranslation(a,_Xe);return o=io.computeActualEllipsoidPosition(i,s,o),o}function Kde(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=R.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=R.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=R.clone(o.computedModelMatrix,t),t=R.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=R.clone(R.IDENTITY,n))}var Qde=new R,$de=new R,xXe=new R,bXe=new h;function TXe(e,t,n,i){let o=Qde,r=$de;Kde(t,o,r);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=AXe(f,o,r,n,xXe),p=R.getTranslation(d,bXe),g=h.subtract(p,s,p);i[u]=R.setTranslation(d,g,i[u])}return i}function CXe(e,t,n,i){let o=Qde,r=$de;Kde(t,o,r);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=yXe(f,o,r,n,f);i[u]=h.subtract(d,s,i[u])}return i}var EXe=new h,vXe=new h;function Jde(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=R.multiplyByPoint(i,n.instancingTranslationMin,EXe),r=io.computeActualEllipsoidPosition(t,o,o),a=R.multiplyByPoint(i,n.instancingTranslationMax,vXe),s=io.computeActualEllipsoidPosition(t,a,a);n.instancingReferencePoint2D=h.lerp(r,s,.5,new h)}function vX(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],a=12*o;i[a+0]=r[0],i[a+1]=r[4],i[a+2]=r[8],i[a+3]=r[12],i[a+4]=r[1],i[a+5]=r[5],i[a+6]=r[9],i[a+7]=r[13],i[a+8]=r[2],i[a+9]=r[6],i[a+10]=r[10],i[a+11]=r[14]}return i}function SXe(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],a=3*o;i[a+0]=r[0],i[a+1]=r[4],i[a+2]=r[8]}return i}var wXe=new h,IXe=new Le,DXe=new h;function Zde(e,t,n){let i=new Array(t),o=mt.getAttributeBySemantic(e,wr.TRANSLATION),r=mt.getAttributeBySemantic(e,wr.ROTATION),a=mt.getAttributeBySemantic(e,wr.SCALE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),d=l(a),p=u?o.typedArray:new Float32Array(t*3),g=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(g=on.dequantize(g,r.componentDatatype,r.type,t));let m;d?m=a.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let y=0;y<t;y++){let x=new h(p[y*3],p[y*3+1],p[y*3+2],wXe);h.maximumByComponent(s,x,s),h.minimumByComponent(c,x,c);let b=new Le(g[y*4],g[y*4+1],g[y*4+2],f?g[y*4+3]:1,IXe),T=new h(m[y*3],m[y*3+1],m[y*3+2],DXe),E=R.fromTranslationQuaternionRotationScale(x,b,T,new R);i[y]=E}let A=n.runtimeNode;return A.instancingTranslationMin=c,A.instancingTranslationMax=s,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),d&&(a.typedArray=void 0),i}function PXe(e,t,n){let i=new Array(t),o=e.typedArray,r=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,h.minimumByComponent(r,u,r),h.maximumByComponent(a,u,a)}let s=n.runtimeNode;return s.instancingTranslationMin=r,s.instancingTranslationMax=a,e.typedArray=void 0,i}function SX(e,t){let n=Ke.createVertexBuffer({context:t.context,typedArray:e,usage:Oe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function RXe(e,t,n,i,o,r){let a=mt.getAttributeBySemantic(n,wr.ROTATION);l(a)||r?OXe(e,n,i,t,o,r):MXe(e,n,i,t,o)}function OXe(e,t,n,i,o,r){let a=e.shaderBuilder,s=t.attributes[0].count,c=e.model,u=e.runtimeNode;a.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=Zde(t,s,e);let y=vX(d);p=SX(y,i),c._modelResources.push(p),r&&(u.transformsTypedArray=y),u.instancingTransformsBuffer=p}if(Yde(e,p,n,f),!o)return;let g=qe(i);g.mode=ie.COLUMBUS_VIEW,Jde(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let y=TXe(d,e,g,d),x=vX(y);m=SX(x,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Yde(e,m,n,"Transform2D")}function MXe(e,t,n,i,o,r){let a=e.shaderBuilder,s=e.runtimeNode,c=mt.getAttributeBySemantic(t,wr.TRANSLATION),u=mt.getAttributeBySemantic(t,wr.SCALE);if(l(u)&&(a.addDefine("HAS_INSTANCE_SCALE"),EX(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=PXe(c,c.count,e):l(s.instancingTranslationMin)||(s.instancingTranslationMin=c.min,s.instancingTranslationMax=c.max),a.addDefine("HAS_INSTANCE_TRANSLATION"),EX(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let g=qe(i);g.mode=ie.COLUMBUS_VIEW,Jde(e,g);let m=s.instancingTranslationBuffer2D;if(!l(m)){let b=CXe(f,e,g,f),T=SXe(b);r&&(s.transformsTypedArray=T),m=SX(T,i),e.model._modelResources.push(m),s.instancingTranslationBuffer2D=m}if(!o)return;EX(e,m,0,void 0,n,"Translation2D")}function Yde(e,t,n,i){let r=Y.getSizeInBytes(Y.FLOAT),a=r*12,s=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:a,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:a,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:a,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`),Jn(n,s)}function EX(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function BXe(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let a=0;a<o.length;a++){let s=o[a];s.semantic===wr.FEATURE_ID&&(s.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:s.buffer,componentsPerAttribute:Ft.getNumberOfComponents(s.type),componentDatatype:s.componentDatatype,normalize:!1,offsetInBytes:s.byteOffset,strideInBytes:s.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${s.setIndex}`))}}var kk=Xde;var wX={};wX.name="ModelMatrixUpdateStage";wX.update=function(e,t,n){let i=n.mode!==ie.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;ehe(e,t,o,e.transformToRoot),e._transformDirty=!1}};function LXe(e,t,n){e.modelMatrix=R.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=mt.getCullFace(e.modelMatrix,e.primitiveType)}function ehe(e,t,n,i){let o;i=R.multiplyTransformation(i,e.transform,new R),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let s=e.runtimePrimitives[o];LXe(s.drawCommand,n,i)}let a=e.children.length;for(o=0;o<a;o++){let s=t._runtimeNodes[e.children[o]];s._transformToRoot=R.clone(i,s._transformToRoot),ehe(s,t,n,i),s._transformDirty=!1}}var zk=wX;var the={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:nhe,_countGeneratedBuffers:ihe};the.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;nhe(i,o),ihe(i,r)};function nhe(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 ihe(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 Uk=the;function yE(e){e=e??G.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=R.clone(n,this._originalTransform),this._transform=R.clone(n,this._transform),this._transformToRoot=R.clone(i,this._transformToRoot),this._computedTransform=new R,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,NXe(this)}Object.defineProperties(yE.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=R.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),IX(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),IX(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),IX(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 NXe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=R.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new $y(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 IX(e,t){e._transformDirty=!0,e._transform=R.fromTranslationRotationScale(t,e._transform)}yE.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};yE.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(kk),t.push(Uk),n.push(zk)};yE.prototype.updateComputedTransform=function(){this._computedTransform=R.multiply(this._transformToRoot,this._transform,this._computedTransform)};yE.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 R);let r=R.multiplyTransformation(this.transformToRoot,this.transform,t[o]),a=R.inverseTransformation(r,t[o]);t[o]=R.multiplyTransformation(a,n[o],t[o])}};var Vk=yE;var ohe={name:"AlphaPipelineStage"};ohe.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===Ie.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=Jt.ALPHA_BLEND);let a=e.shaderBuilder,s=e.uniformMap;l(i.alphaCutoff)&&(a.addDefine("ALPHA_MODE_MASK",void 0,he.FRAGMENT),a.addUniform("float","u_alphaCutoff",he.FRAGMENT),s.u_alphaCutoff=function(){return i.alphaCutoff})};var jk=ohe;var rhe={name:"BatchTexturePipelineStage"};rhe.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,a=r.featureTables[r.featureTableId],s=a.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return s};let c=a.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return 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=It(o,e.uniformMap)};var Gk=rhe;var ahe={name:"ClassificationPipelineStage"};ahe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,he.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||FXe(t,o)};function FXe(e,t){let n=mt.getAttributeBySemantic(e,it.POSITION);if(!l(n))throw new re("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 a=r?o.count:n.count,s=mt.getAttributeBySemantic(e,it.FEATURE_ID,0);if(!l(s)){t.batchLengths=[a],t.batchOffsets=[0];return}let c=s.typedArray;s.typedArray=void 0;let u=[],f=[0],d=r?i[0]:0,p=c[d],g=0;for(let A=1;A<a;A++){let y=r?i[A]:A,x=c[y];if(x!==p){let b=A-g,T=A;u.push(b),f.push(T),g=T,p=x}}let m=a-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var Hk=ahe;var Wk=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
  7600. {
  7601. bool styleTranslucent = (featureColor.a != 1.0);
  7602. // Only render translucent features in the translucent pass (if the style or the original command has translucency).
  7603. if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
  7604. {
  7605. // If the model has a translucent silhouette, it needs to render during the silhouette color command,
  7606. // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
  7607. #ifdef HAS_SILHOUETTE
  7608. positionMC *= float(model_silhouettePass);
  7609. #else
  7610. positionMC *= 0.0;
  7611. #endif
  7612. }
  7613. // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
  7614. else if (czm_pass != czm_passTranslucent && styleTranslucent)
  7615. {
  7616. positionMC *= 0.0;
  7617. }
  7618. }
  7619. void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
  7620. {
  7621. float show = ceil(feature.color.a);
  7622. positionMC *= show;
  7623. #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)
  7624. filterByPassType(positionMC, feature.color);
  7625. #endif
  7626. }
  7627. `;var qk=`void filterByPassType(vec4 featureColor)
  7628. {
  7629. bool styleTranslucent = (featureColor.a != 1.0);
  7630. // Only render translucent features in the translucent pass (if the style or the original command has translucency).
  7631. if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
  7632. {
  7633. // If the model has a translucent silhouette, it needs to render during the silhouette color command,
  7634. // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
  7635. #ifdef HAS_SILHOUETTE
  7636. if(!model_silhouettePass) {
  7637. discard;
  7638. }
  7639. #else
  7640. discard;
  7641. #endif
  7642. }
  7643. // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
  7644. else if (czm_pass != czm_passTranslucent && styleTranslucent)
  7645. {
  7646. discard;
  7647. }
  7648. }
  7649. void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
  7650. {
  7651. vec4 featureColor = feature.color;
  7652. if (featureColor.a == 0.0)
  7653. {
  7654. discard;
  7655. }
  7656. // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.
  7657. // So, we only apply in in the fragment shader if the feature ID texture is used.
  7658. #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
  7659. filterByPassType(featureColor);
  7660. #endif
  7661. featureColor = czm_gammaCorrect(featureColor);
  7662. // Classification models compute the diffuse differently.
  7663. #ifdef HAS_CLASSIFICATION
  7664. material.diffuse = featureColor.rgb * featureColor.a;
  7665. #else
  7666. float highlight = ceil(model_colorBlend);
  7667. material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
  7668. #endif
  7669. material.alpha *= featureColor.a;
  7670. }
  7671. `;var she={name:"CPUStylingPipelineStage"};she.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(Wk),o.addFragmentLines(qk),o.addDefine("USE_CPU_STYLING",void 0,he.BOTH),l(i.color)||(o.addUniform("float",bx.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),e.uniformMap[bx.COLOR_BLEND_UNIFORM_NAME]=function(){return Pl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",he.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var Yk=she;var DX={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};DX.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(DX);var Y_=DX;var Xk=`void customShaderStage(
  7672. inout czm_modelVertexOutput vsOutput,
  7673. inout ProcessedAttributes attributes,
  7674. FeatureIds featureIds,
  7675. Metadata metadata,
  7676. MetadataClass metadataClass,
  7677. MetadataStatistics metadataStatistics
  7678. ) {
  7679. // VertexInput and initializeInputStruct() are dynamically generated in JS,
  7680. // see CustomShaderPipelineStage.js
  7681. VertexInput vsInput;
  7682. initializeInputStruct(vsInput, attributes);
  7683. vsInput.featureIds = featureIds;
  7684. vsInput.metadata = metadata;
  7685. vsInput.metadataClass = metadataClass;
  7686. vsInput.metadataStatistics = metadataStatistics;
  7687. vertexMain(vsInput, vsOutput);
  7688. attributes.positionMC = vsOutput.positionMC;
  7689. }
  7690. `;var Kk=`void customShaderStage(
  7691. inout czm_modelMaterial material,
  7692. ProcessedAttributes attributes,
  7693. FeatureIds featureIds,
  7694. Metadata metadata,
  7695. MetadataClass metadataClass,
  7696. MetadataStatistics metadataStatistics
  7697. ) {
  7698. // FragmentInput and initializeInputStruct() are dynamically generated in JS,
  7699. // see CustomShaderPipelineStage.js
  7700. FragmentInput fsInput;
  7701. initializeInputStruct(fsInput, attributes);
  7702. fsInput.featureIds = featureIds;
  7703. fsInput.metadata = metadata;
  7704. fsInput.metadataClass = metadataClass;
  7705. fsInput.metadataStatistics = metadataStatistics;
  7706. fragmentMain(fsInput, material);
  7707. }
  7708. `;var Qk=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
  7709. initializeFeatureIds(featureIds, attributes);
  7710. initializeFeatureIdAliases(featureIds);
  7711. }
  7712. `;var $k=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
  7713. {
  7714. initializeFeatureIds(featureIds, attributes);
  7715. initializeFeatureIdAliases(featureIds);
  7716. setFeatureIdVaryings();
  7717. }
  7718. `;var Qi={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()"};Qi.process=function(e,t,n){let i=e.shaderBuilder;kXe(i);let o=e.runtimeNode.node.instances;l(o)&&zXe(e,o,n),UXe(e,t,n),i.addVertexLines($k),i.addFragmentLines(Qk)};function kXe(e){e.addStruct(Qi.STRUCT_ID_FEATURE_IDS_VS,Qi.STRUCT_NAME_FEATURE_IDS,he.VERTEX),e.addStruct(Qi.STRUCT_ID_FEATURE_IDS_FS,Qi.STRUCT_NAME_FEATURE_IDS,he.FRAGMENT),e.addFunction(Qi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Qi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.VERTEX),e.addFunction(Qi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Qi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.FRAGMENT),e.addFunction(Qi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Qi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.VERTEX),e.addFunction(Qi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Qi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.FRAGMENT),e.addFunction(Qi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Qi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,he.VERTEX)}function zXe(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let a=i[r],s=a.positionalLabel;a instanceof yn.FeatureIdAttribute?VXe(e,a,s):che(e,a,s,o,1,n);let c=a.label;l(c)&&lhe(e,s,c,he.BOTH)}}function UXe(e,t,n){let i=t.featureIds,r=mt.getAttributeBySemantic(t,it.POSITION).count;for(let a=0;a<i.length;a++){let s=i[a],c=s.positionalLabel,u=he.BOTH;s instanceof yn.FeatureIdAttribute?jXe(e,s,c):s instanceof yn.FeatureIdImplicitRange?che(e,s,c,r,void 0,n):(GXe(e,s,c,a,n),u=he.FRAGMENT);let f=s.label;l(f)&&lhe(e,c,f,u)}}function VXe(e,t,n){let i=e.shaderBuilder;i.addStructField(Qi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Qi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),a=`a_${r}${o}`,s=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${a}));`,u=`featureIds.${n} = int(czm_round(${s}));`;i.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",s),i.addFunctionLines(Qi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${s} = ${a};`])}function jXe(e,t,n){let i=e.shaderBuilder;i.addStructField(Qi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Qi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),a=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,a),i.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,a)}function che(e,t,n,i,o,r){HXe(e,t,i,o,r);let a=e.shaderBuilder,s=`a_implicit_${n}`;a.addAttribute("float",s);let c=`v_implicit_${n}`;a.addVarying("float",c),a.addStructField(Qi.STRUCT_ID_FEATURE_IDS_VS,"int",n),a.addStructField(Qi.STRUCT_ID_FEATURE_IDS_FS,"int",n),a.addFunctionLines(Qi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${s};`]),a.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${s}));`]),a.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function GXe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,a=e.uniformMap,s=t.textureReader;a[r]=function(){return s.texture??o.context.defaultTexture};let c=s.channels,u=e.shaderBuilder;u.addStructField(Qi.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,he.FRAGMENT);let d=`v_texCoord_${s.texCoord}`,p=d,g=s.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let y=`${r}Transform`;u.addUniform("mat3",y,he.FRAGMENT),a[y]=function(){return g},p=`vec2(${y} * vec3(${d}, 1.0))`}let m=`texture(${r}, ${p}).${c}`,A=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[A])}function lhe(e,t,n,i){let o=e.shaderBuilder,r=he.includesVertexShader(i);r&&o.addStructField(Qi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Qi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let a=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,a),o.addFunctionLines(Qi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,a)}function HXe(e,t,n,i,o){let r=e.model,a,s;if(l(t.repeat)){let u=WXe(t,n);a=Ke.createVertexBuffer({context:o.context,typedArray:u,usage:Oe.STATIC_DRAW}),a.vertexArrayDestroyable=!1,r._pipelineResources.push(a),r.statistics.addBuffer(a,!1)}else s=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:s,vertexBuffer:a,normalize:!1,componentsPerAttribute:1,componentDatatype:Y.FLOAT,strideInBytes:Y.getSizeInBytes(Y.FLOAT),offsetInBytes:0};e.attributes.push(c)}function WXe(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 Tx=Qi;var Jk=`void metadataStage(
  7719. FeatureIds featureIds,
  7720. out Metadata metadata,
  7721. out MetadataClass metadataClass,
  7722. out MetadataStatistics metadataStatistics,
  7723. ProcessedAttributes attributes
  7724. )
  7725. {
  7726. initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
  7727. }
  7728. `;var Zk=`void metadataStage(
  7729. FeatureIds featureIds,
  7730. out Metadata metadata,
  7731. out MetadataClass metadataClass,
  7732. out MetadataStatistics metadataStatistics,
  7733. ProcessedAttributes attributes
  7734. )
  7735. {
  7736. initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
  7737. setMetadataVaryings();
  7738. }
  7739. `;var yi={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(FeatureIds featureIds, 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"}]};yi.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:a}=o,s=a?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=uKe(o,t),f=qXe(r.propertyAttributes,t,s),d=XXe(r.propertyTextures,s),p=$Xe(r.propertyTables,t,e,s,u),g=f.concat(d).concat(p);eKe(i,g),iKe(i),i.addVertexLines(Zk),i.addFragmentLines(Jk);for(let m=0;m<f.length;m++){let A=f[m];oKe(e,A)}for(let m=0;m<d.length;m++){let A=d[m];aKe(e,A,c)}for(let m=0;m<p.length;m++){let A=p[m];cKe(e,A,c)}};function qXe(e,t,n){return l(e)?e.flatMap(i=>YXe(i,t,n)):[]}function YXe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=mt,a=e.class.id,s=n?.classes[a],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:A}=o(g);u[f]={metadataVariable:r(d),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:A,propertyStatistics:s?.properties[d],shaderDestination:he.BOTH}}return u}function XXe(e,t){return l(e)?e.flatMap(n=>KXe(n,t)):[]}function KXe(e,t){let{sanitizeGlslIdentifier:n}=mt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([s,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),a=new Array(r.length);for(let s=0;s<r.length;s++){let[c,u]=r[s];a[s]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:he.FRAGMENT}}return a}var QXe=4;function $Xe(e,t,n,i,o){if(!l(e))return[];let r=ZXe(n,t);return e.filter(a=>l(a.class)&&r.has(String(a.id))).flatMap(a=>JXe(a,r,i,o))}function JXe(e,t,n,i){let{sanitizeGlslIdentifier:o}=mt,r=e.class,a=n?.classes[r.id],s=t.get(String(e.id))??{},c=s.shaderDestination??he.BOTH,u=e.properties,f=r.properties,d=[],p=0;for(let[g,m]of Object.entries(f)){if(!m.isGpuCompatible(QXe))continue;let A=u[g],y=he.intersection(hKe(g,i),c);if(y===he.NONE){p++;continue}d.push({metadataVariable:o(g),property:A,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:a?.properties[g],shaderDestination:y,propertyTable:e,featureIdVariableName:s.variableName,propertyInfoIndex:p}),p++}return d}function ZXe(e,t){let n=new Map;function i(s,c){let u=s?.propertyTableId;if(!l(u))return;let f=String(u),d={variableName:s.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,d)}let o=t?.featureIds??[];for(let s=0;s<o.length;s++){let c=o[s],u=l(c?.textureReader);i(c,u?he.FRAGMENT:he.BOTH)}let a=e.runtimeNode?.node?.instances?.featureIds??[];for(let s=0;s<a.length;s++){let c=a[s];i(c,he.BOTH)}return n}function eKe(e,t){let n=new Set,i=new Set;for(let s=0;s<t.length;s++){let{type:c,glslType:u,propertyStatistics:f}=t[s];n.add(u),l(f)&&c!==ht.ENUM&&i.add(u)}let o=yi.METADATA_CLASS_FIELDS;for(let s of n){let c=`${s}MetadataClass`;a(c,s,o)}let r=yi.METADATA_STATISTICS_FIELDS;for(let s of i){let c=`${s}MetadataStatistics`;a(c,s,r)}function a(s,c,u){e.addStruct(s,s,he.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?nKe(c):c;e.addStructField(s,p,d)}}}var tKe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function nKe(e){let t=tKe[e];return l(t)?t:e}function iKe(e){e.addStruct(yi.STRUCT_ID_METADATA_VS,yi.STRUCT_NAME_METADATA,he.VERTEX),e.addStruct(yi.STRUCT_ID_METADATA_FS,yi.STRUCT_NAME_METADATA,he.FRAGMENT),e.addStruct(yi.STRUCT_ID_METADATA_CLASS_VS,yi.STRUCT_NAME_METADATA_CLASS,he.VERTEX),e.addStruct(yi.STRUCT_ID_METADATA_CLASS_FS,yi.STRUCT_NAME_METADATA_CLASS,he.FRAGMENT),e.addStruct(yi.STRUCT_ID_METADATA_STATISTICS_VS,yi.STRUCT_NAME_METADATA_STATISTICS,he.VERTEX),e.addStruct(yi.STRUCT_ID_METADATA_STATISTICS_FS,yi.STRUCT_NAME_METADATA_STATISTICS,he.FRAGMENT),e.addFunction(yi.FUNCTION_ID_INITIALIZE_METADATA_VS,yi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.VERTEX),e.addFunction(yi.FUNCTION_ID_INITIALIZE_METADATA_FS,yi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.FRAGMENT),e.addFunction(yi.FUNCTION_ID_SET_METADATA_VARYINGS,yi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,he.VERTEX)}function oKe(e,t){rKe(e,t),PX(e.shaderBuilder,t),RX(e.shaderBuilder,t)}function rKe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,a=OX({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:he.BOTH,property:o});n.addStructField(yi.STRUCT_ID_METADATA_VS,r,i),n.addStructField(yi.STRUCT_ID_METADATA_FS,r,i);let s=`metadata.${i} = ${a};`;n.addFunctionLines(yi.FUNCTION_ID_INITIALIZE_METADATA_VS,[s]),n.addFunctionLines(yi.FUNCTION_ID_INITIALIZE_METADATA_FS,[s])}function aKe(e,t,n){sKe(e,t,n),PX(e.shaderBuilder,t),RX(e.shaderBuilder,t)}function sKe(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:a,property:s}=t,{texCoord:c,channels:u,index:f,texture:d,transform:p}=s.textureReader,g=`u_propertyTexture_${f}`,m=[];o.hasOwnProperty(g)||(i.addUniform("sampler2D",g,he.FRAGMENT),o[g]=()=>d),i.addStructField(yi.STRUCT_ID_METADATA_FS,a,r);let A=`attributes.texCoord_${c}`,y=A;if(l(p)&&!$.equals(p,$.IDENTITY)){let w=`${g}Transform`;i.addUniform("mat3",w,he.FRAGMENT),o[w]=function(){return p},y=`vec2(${w} * vec3(${A}, 1.0))`}let x=`texture(${g}, ${y}).${u}`,b=s.classProperty,T;n?T=b.unpackTextureInShader(x,u,r,m):T=b.unpackTextureInShaderWebGL1(x);let E=OX({valueExpression:T,renderResources:e,glslType:a,metadataVariable:r,shaderDestination:he.FRAGMENT,property:s}),S=`metadata.${r} = ${E};`;m.push(S),i.addFunctionLines(yi.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function PX(e,t){let n=t.classProperty,{metadataVariable:i,glslType:o,shaderDestination:r}=t,a=uhe(yi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),s=`${o}MetadataClass`;e.addStructField(yi.STRUCT_ID_METADATA_CLASS_FS,s,i),e.addFunctionLines(yi.FUNCTION_ID_INITIALIZE_METADATA_FS,a),he.includesVertexShader(r)&&(e.addStructField(yi.STRUCT_ID_METADATA_CLASS_VS,s,i),e.addFunctionLines(yi.FUNCTION_ID_INITIALIZE_METADATA_VS,a))}function RX(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===ht.ENUM)return;let a=yi.METADATA_STATISTICS_FIELDS,s=`metadataStatistics.${i}`,c=uhe(a,n,s,r),u=`${r}MetadataStatistics`;e.addStructField(yi.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(yi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),he.includesVertexShader(t.shaderDestination)&&(e.addStructField(yi.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(yi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function cKe(e,t,n){lKe(e,t,n),PX(e.shaderBuilder,t),RX(e.shaderBuilder,t)}function lKe(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:a,property:s,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){_t("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let d=`u_propertyTableTexture_${u.id}`,p=[];o.hasOwnProperty(d)||(i.addUniform("sampler2D",d,he.BOTH),o[d]=()=>u.texture);let g=t.shaderDestination;he.includesVertexShader(g)&&i.addStructField(yi.STRUCT_ID_METADATA_VS,a,r),he.includesFragmentShader(g)&&i.addStructField(yi.STRUCT_ID_METADATA_FS,a,r);let A=`ivec2(${`featureIds.${c}`}, ${f})`,y=`texelFetch(${d}, ${A}, 0)`,x=t.classProperty,b=x.unpackTextureInShader(y,"rgba",r,p),T=OX({valueExpression:b,renderResources:e,glslType:a,metadataVariable:r,shaderDestination:g,property:s??x}),E=`metadata.${r} = ${T};`;p.push(E),he.includesVertexShader(g)&&i.addFunctionLines(yi.FUNCTION_ID_INITIALIZE_METADATA_VS,p),he.includesFragmentShader(g)&&i.addFunctionLines(yi.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function uhe(e,t,n,i){function o(r){let a=t[r.specName];if(l(a))return`${n}.${r.shaderName} = ${i}(${a});`}return l(t)?e.map(o).filter(l):[]}function OX(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:a,uniformMap:s}=e.renderResources,{glslType:c,shaderDestination:u}=e;a.addUniform(c,o,u),a.addUniform(c,r,u);let{offset:f,scale:d}=n;return s[o]=()=>f,s[r]=()=>d,`czm_valueTransform(${o}, ${r}, ${t})`}function uKe(e,t){let n=new Set,i=new Set;return fKe(e,n,i),dKe(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function fKe(e,t,n){let i=e.customShader;if(!l(i))return;let o=i.usedVariablesFragment?.metadataSet??{};for(let a in o)o.hasOwnProperty(a)&&n.add(a);let r=i.usedVariablesVertex?.metadataSet??{};for(let a in r)r.hasOwnProperty(a)&&t.add(a)}function dKe(e,t,n,i){let o=e.style;if(!(l(o)&&t.primitiveType===Re.POINTS))return;let a=o.color?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let s=o.show?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let c=o.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function hKe(e,t){let n=t.usedInFragment.has(e)?he.FRAGMENT:he.NONE,i=t.usedInVertex.has(e)?he.VERTEX:he.NONE;return he.union(n,i)}var Ah=yi;var fhe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(fhe);var Cx=fhe;var ws={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:_t};ws.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:a}=o,{lightingModel:s,translucencyMode:c}=a;l(s)&&(e.lightingOptions.lightingModel=s),c===Cx.TRANSLUCENT?r.pass=Ie.TRANSLUCENT:c===Cx.OPAQUE&&(r.pass=void 0);let u=bKe(a,t,e);if(!u.customShaderEnabled)return;if(vKe(i,a,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,he.BOTH),l(a.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,he.VERTEX),l(a.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,he.FRAGMENT);let p=Y_.getDefineName(a.mode);i.addDefine(p,void 0,he.FRAGMENT)}let f=a.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=a.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=It(e.uniformMap,a.uniformMap)};function mKe(e){let t={};for(let n=0;n<e.length;n++){let i=mt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var pKe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},gKe={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 dhe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=pKe[t],i=gKe[t];if(l(n))return{attributeField:[n,e],value:i}}function _Ke(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!phe(i.metadataSet,n))return{enabled:!1};let o=i.attributeSet,r=hhe(t,o,!1),a=mhe(t,o,!1),s,c=[],u=[];for(let f in r){if(!r.hasOwnProperty(f))continue;let p=[r[f].glslType,f];c.push(p),s=`vsInput.attributes.${f} = attributes.${f};`,u.push(s)}for(let f=0;f<a.length;f++){let d=a[f],p=dhe(d);if(!l(p))return ws._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),s=`vsInput.attributes.${d} = ${p.value};`,u.push(s)}return{enabled:!0,attributeFields:c,initializationLines:u}}function AKe(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 yKe(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!phe(i.metadataSet,n))return{enabled:!1};let o=i.attributeSet,r=hhe(t,o,!0),a=mhe(t,o,!0),s,c=[],u=[];for(let d in r){if(!r.hasOwnProperty(d))continue;let g=[r[d].glslType,d];c.push(g),s=`fsInput.attributes.${d} = attributes.${d};`,u.push(s)}for(let d=0;d<a.length;d++){let p=a[d],g=dhe(p);if(!l(g))return ws._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(g.attributeField),s=`fsInput.attributes.${p} = ${g.value};`,u.push(s)}let f=AKe(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var xKe={positionWC:!0,positionEC:!0};function hhe(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],a=o;n&&o==="normalMC"?a="normalEC":n&&o==="tangentMC"&&(a="tangentEC",r.glslType="vec3"),t.hasOwnProperty(a)&&(i[a]=r)}return i}function mhe(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||xKe.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 bKe(e,t,n){let i=mKe(t.attributes),o=SKe(t,n.model.structuralMetadata),r=_Ke(e,i,o),a=yKe(e,i,o),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&a.enabled;return{vertexLines:r,fragmentLines:a,customShaderEnabled:r.enabled||a.enabled,shouldComputePositionWC:c}}function TKe(e,t){let n=ws.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ws.STRUCT_NAME_ATTRIBUTES,he.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let a=0;a<i.length;a++){let[s,c]=i[a];e.addStructField(n,s,c)}n=ws.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ws.STRUCT_NAME_VERTEX_INPUT,he.VERTEX),e.addStructField(n,ws.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Tx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Ah.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Ah.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Ah.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ws.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,ws.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,he.VERTEX),e.addFunctionLines(r,o)}function CKe(e,t){let n=ws.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ws.STRUCT_NAME_ATTRIBUTES,he.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let a=0;a<i.length;a++){let[s,c]=i[a];e.addStructField(n,s,c)}n=ws.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ws.STRUCT_NAME_FRAGMENT_INPUT,he.FRAGMENT),e.addStructField(n,ws.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Tx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Ah.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Ah.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Ah.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ws.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,ws.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,he.FRAGMENT),e.addFunctionLines(r,o)}var EKe=[];function vKe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=EKe;i.enabled&&(TKe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,Xk),e.addVertexLines(r)),o.enabled&&(CKe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,Kk),e.addFragmentLines(r))}function SKe(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,o=l(e.featureIds)?e.featureIds.map(s=>s.propertyTableId):[],r=new Set;function a(s,c){for(let u of s){let d=c[u].class.properties;Object.keys(d).forEach(p=>r.add(p))}}return a(n,t.propertyTextures),a(i,t.propertyAttributes),a(o,t.propertyTables),r}function phe(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return ws._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var e3=ws;var AD={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};AD.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,he.VERTEX),i.addFunction(AD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,AD.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,he.VERTEX);let a=t.attributes;for(let s=0;s<a.length;s++){let c=a[s],u=c.quantization;if(!l(u))continue;let f=c.semantic===it.POSITION,d=c.semantic===it.TEXCOORD;if(r&&!f&&!d)continue;let p=mt.getAttributeInfo(c);IKe(i,p),wKe(e,p)}};function wKe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let a=`model_normalizationRange_${o}`;n.addUniform("float",a,he.VERTEX),i[a]=function(){return r.normalizationRange}}else{let a=`model_quantizedVolumeOffset_${o}`,s=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,a,he.VERTEX),n.addUniform(c,s,he.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=ghe(u,0),f=ghe(f,1)),i[a]=function(){return u},i[s]=function(){return f}}}function ghe(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function IKe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=DKe(n,i):o=PKe(n),e.addFunctionLines(AD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function DKe(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 PKe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var t3=AD;var n3=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) {
  7740. if (u_isEdgePass) {
  7741. return;
  7742. }
  7743. vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;
  7744. vec4 edgeColor = texture(czm_edgeColorTexture, screenCoord);
  7745. vec4 edgeId = texture(czm_edgeIdTexture, screenCoord);
  7746. // Packed window-space depth from edge pass (0..1)
  7747. float edgeDepthWin = czm_unpackDepth(texture(czm_edgeDepthTexture, screenCoord));
  7748. // Near / far for current frustum
  7749. float n = czm_currentFrustum.x;
  7750. float f = czm_currentFrustum.y;
  7751. // geometry depth in eye coordinate
  7752. vec4 geomEC = czm_windowToEyeCoordinates(gl_FragCoord);
  7753. float geomDepthLinear = -geomEC.z;
  7754. // Convert edge depth to linear depth
  7755. float z_ndc_edge = edgeDepthWin * 2.0 - 1.0;
  7756. float edgeDepthLinear = (2.0 * n * f) / (f + n - z_ndc_edge * (f - n));
  7757. float d = abs(edgeDepthLinear - geomDepthLinear);
  7758. // Adaptive epsilon using linear depth fwidth for robustness
  7759. float pixelStepLinear = fwidth(geomDepthLinear);
  7760. float rel = geomDepthLinear * 0.0005;
  7761. float eps = max(n * 1e-4, max(pixelStepLinear * 1.5, rel));
  7762. // If Edge isn't behind any geometry and the pixel has edge data
  7763. if (d < eps && edgeId.r > 0.0) {
  7764. #ifdef HAS_EDGE_FEATURE_ID
  7765. float edgeFeatureId = edgeId.g;
  7766. float currentFeatureId = float(featureIds.featureId_0);
  7767. #endif
  7768. float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
  7769. // Background / sky / globe: always show edge
  7770. bool isBackground = geomDepthLinear > globeDepth;
  7771. bool drawEdge = isBackground;
  7772. #ifdef HAS_EDGE_FEATURE_ID
  7773. bool hasEdgeFeature = edgeFeatureId > 0.0;
  7774. bool hasCurrentFeature = currentFeatureId > 0.0;
  7775. bool featuresMatch = edgeFeatureId == currentFeatureId;
  7776. drawEdge = drawEdge || !hasEdgeFeature || !hasCurrentFeature || featuresMatch;
  7777. #else
  7778. drawEdge = true;
  7779. #endif
  7780. if (drawEdge) {
  7781. color = edgeColor;
  7782. }
  7783. }
  7784. }
  7785. `;var _he={name:"EdgeDetectionPipelineStage"};_he.process=function(e){e.shaderBuilder.addFragmentLines([n3])};var i3=_he;var o3=`// CESIUM_REDIRECTED_COLOR_OUTPUT flag is used to avoid color attachment conflicts
  7786. // when shaders are processed by different rendering pipelines (e.g., OIT).
  7787. // Only declare MRT outputs when not in a derived shader context.
  7788. #if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
  7789. layout(location = 1) out vec4 out_id; // edge id / metadata
  7790. layout(location = 2) out vec4 out_edgeDepth; // packed depth
  7791. #endif
  7792. void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds)
  7793. {
  7794. #ifdef HAS_EDGE_VISIBILITY
  7795. if (!u_isEdgePass) {
  7796. return;
  7797. }
  7798. float edgeTypeInt = v_edgeType * 255.0;
  7799. if (edgeTypeInt < 0.5) {
  7800. discard;
  7801. }
  7802. if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { // silhouette candidate
  7803. // Silhouette check done in vertex shader
  7804. // v_shouldDiscard will be > 0.5 if this edge should be discarded
  7805. if (v_shouldDiscard > 0.5) {
  7806. discard;
  7807. }
  7808. }
  7809. vec4 finalColor = color;
  7810. #ifdef HAS_EDGE_COLOR_ATTRIBUTE
  7811. if (v_edgeColor.a >= 0.0) {
  7812. finalColor = v_edgeColor;
  7813. }
  7814. #endif
  7815. #ifdef HAS_LINE_PATTERN
  7816. // Pattern is 16-bit, each bit represents visibility at that position
  7817. const float maskLength = 16.0;
  7818. // Get the relative position within the dash from 0 to 1
  7819. float dashPosition = fract(v_lineCoord / maskLength);
  7820. // Figure out the mask index
  7821. float maskIndex = floor(dashPosition * maskLength);
  7822. // Test the bit mask
  7823. float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
  7824. // If bit is 0 (gap), discard the fragment (use < 1.0 for better numerical stability)
  7825. if (mod(maskTest, 2.0) < 1.0) {
  7826. discard;
  7827. }
  7828. #endif
  7829. color = finalColor;
  7830. #if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
  7831. // Write edge metadata
  7832. out_id = vec4(0.0);
  7833. out_id.r = edgeTypeInt; // Edge type (0-3)
  7834. #ifdef HAS_EDGE_FEATURE_ID
  7835. out_id.g = float(featureIds.featureId_0); // Feature ID if available
  7836. #else
  7837. out_id.g = 0.0;
  7838. #endif
  7839. // Pack depth into separate MRT attachment
  7840. out_edgeDepth = czm_packDepth(gl_FragCoord.z);
  7841. #endif
  7842. #endif
  7843. }`;var r3=`#ifdef HAS_EDGE_VISIBILITY
  7844. void edgeVisibilityStageVS() {
  7845. if (!u_isEdgePass) {
  7846. return;
  7847. }
  7848. v_edgeType = a_edgeType;
  7849. v_faceNormalAView = czm_normal * a_faceNormalA;
  7850. v_faceNormalBView = czm_normal * a_faceNormalB;
  7851. v_edgeOffset = a_edgeOffset;
  7852. // Silhouette detection: check both endpoints of the edge
  7853. v_shouldDiscard = 0.0;
  7854. float edgeTypeInt = a_edgeType * 255.0;
  7855. if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) {
  7856. vec3 normalA = normalize(v_faceNormalAView);
  7857. vec3 normalB = normalize(v_faceNormalBView);
  7858. const float perpTol = 2.5e-4;
  7859. // Check at current vertex (first endpoint)
  7860. vec4 currentPosEC = czm_modelView * vec4(v_positionMC, 1.0);
  7861. vec3 toEye1 = normalize(-currentPosEC.xyz);
  7862. float dotA1 = dot(normalA, toEye1);
  7863. float dotB1 = dot(normalB, toEye1);
  7864. // Check at other vertex (second endpoint)
  7865. vec4 otherPosEC = czm_modelView * vec4(a_edgeOtherPos, 1.0);
  7866. vec3 toEye2 = normalize(-otherPosEC.xyz);
  7867. float dotA2 = dot(normalA, toEye2);
  7868. float dotB2 = dot(normalB, toEye2);
  7869. // Discard if EITHER endpoint is non-silhouette
  7870. if (dotA1 * dotB1 > perpTol || dotA2 * dotB2 > perpTol) {
  7871. v_shouldDiscard = 1.0;
  7872. }
  7873. }
  7874. #ifdef HAS_EDGE_FEATURE_ID
  7875. v_featureId_0 = a_edgeFeatureId;
  7876. #endif
  7877. #ifdef HAS_EDGE_COLOR_ATTRIBUTE
  7878. v_edgeColor = a_edgeColor;
  7879. #endif
  7880. #ifdef HAS_LINE_PATTERN
  7881. #ifdef HAS_EDGE_CUMULATIVE_DISTANCE
  7882. v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld;
  7883. #else
  7884. vec4 currentClip = czm_modelViewProjection * vec4(v_positionMC, 1.0);
  7885. vec2 currentScreen = ((currentClip.xy / currentClip.w) * 0.5 + 0.5) * czm_viewport.zw;
  7886. vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
  7887. vec2 otherScreen = ((otherClip.xy / otherClip.w) * 0.5 + 0.5) * czm_viewport.zw;
  7888. vec2 windowDir = otherScreen - currentScreen;
  7889. const float textureCoordinateBase = 8192.0;
  7890. if (abs(windowDir.x) > abs(windowDir.y)) {
  7891. v_lineCoord = textureCoordinateBase + currentScreen.x;
  7892. } else {
  7893. v_lineCoord = textureCoordinateBase + currentScreen.y;
  7894. }
  7895. #endif
  7896. #endif
  7897. // Expand vertex to form quad
  7898. vec4 posClip = gl_Position;
  7899. if (length(a_edgeOtherPos) > 0.0 && abs(a_edgeOffset) > 0.0) {
  7900. vec4 currentClip = posClip;
  7901. vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
  7902. vec2 currentNDC = currentClip.xy / currentClip.w;
  7903. vec2 otherNDC = otherClip.xy / otherClip.w;
  7904. vec2 edgeDirNDC = otherNDC - currentNDC;
  7905. // Ensure consistent edge direction
  7906. if (edgeDirNDC.x < 0.0 || (abs(edgeDirNDC.x) < 0.001 && edgeDirNDC.y < 0.0)) {
  7907. edgeDirNDC = -edgeDirNDC;
  7908. }
  7909. edgeDirNDC = normalize(edgeDirNDC);
  7910. vec2 perpNDC = vec2(-edgeDirNDC.y, edgeDirNDC.x);
  7911. // Convert line width from pixels to clip space
  7912. float lineWidthPixels = u_lineWidth;
  7913. vec2 viewportSize = czm_viewport.zw;
  7914. vec2 clipPerPixel = (2.0 / viewportSize) * currentClip.w;
  7915. vec2 offsetClip = perpNDC * lineWidthPixels * clipPerPixel * 0.5 * a_edgeOffset;
  7916. posClip.xy += offsetClip;
  7917. }
  7918. gl_Position = posClip;
  7919. }
  7920. #endif
  7921. `;var MX=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,o=t.quantization;if(!l(o)&&!i)return n;let r=t.type,a=t.count,s=n;return i&&(s=on.dequantize(n,t.componentDatatype,r,a)),l(o)?e.dequantize(s,a,r,o):s}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,o=Ft.getNumberOfComponents(n),r=i*o,a=t.componentDatatype,s=t.quantization;l(s)&&(a=s.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,d=Y.getSizeInBytes(a),p=o*d,g=!l(f)||f===p;if(l(t.typedArray))return t.typedArray;if(g){let S=Y.createTypedArray(a,r);return c.getBufferData(S,u),S}let A=new Uint8Array(c.sizeInBytes);c.getBufferData(A);let y=Y.createTypedArray(a,r),x=f??p,b=new DataView(A.buffer,A.byteOffset,A.byteLength),T=new Array(o),E=e.createComponentsReader(a);for(let S=0;S<i;++S){let w=u+S*x;E(b,w,o,T);for(let P=0;P<o;++P)y[S*o+P]=T[P]}return y}static dequantize(t,n,i,o){if(o.octEncoded){let s=e.octDecode(t,n,o.normalizationRange,void 0);return o.octEncodedZXY&&e.convertZxyToXyz(s,s),s}let r=o.quantizedVolumeStepSize,a=o.quantizedVolumeOffset;if(i===Ft.SCALAR)return e.dequantize1D(t,n,r,a,void 0);if(i===Ft.VEC2)return e.dequantize2D(t,n,r,a,void 0);if(i===Ft.VEC3)return e.dequantize3D(t,n,r,a,void 0);if(i===Ft.VEC4)return e.dequantize4D(t,n,r,a,void 0);throw new _e(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,o){l(o)||(o=new Float32Array(t.length));let r=new h;for(let a=0;a<n;a++)h.unpack(t,a*3,r),on.octDecodeInRange(r.x,r.y,i,r),h.pack(r,o,a*3);return o}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let o=0;for(let r=0;r<n;r++,o+=3){let a=t[o+0],s=t[o+1],c=t[o+2];i[o+0]=s,i[o+1]=c,i[o+2]=a}return i}static dequantize1D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));for(let a=0;a<n;a++){let c=t[a]*i+o;r[a]=c}return r}static dequantize2D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let a=new z;for(let s=0;s<n;s++)z.unpack(t,s*2,a),z.multiplyComponents(a,i,a),z.add(a,o,a),z.pack(a,r,s*2);return r}static dequantize3D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let a=new h;for(let s=0;s<n;s++)h.unpack(t,s*3,a),h.multiplyComponents(a,i,a),h.add(a,o,a),h.pack(a,r,s*3);return r}static dequantize4D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let a=new se;for(let s=0;s<n;s++)se.unpack(t,s*4,a),se.multiplyComponents(a,i,a),se.add(a,o,a),se.pack(a,r,s*4);return r}static createComponentsReader(t){let n=e.createComponentReader(t),i=Y.getSizeInBytes(t);return function(o,r,a,s){let c=r;for(let u=0;u<a;++u)s[u]=n(o,c),c+=i}}static createComponentReader(t){switch(t){case Y.BYTE:return function(n,i){return n.getInt8(i)};case Y.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case Y.SHORT:return function(n,i){return n.getInt16(i,!0)};case Y.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case Y.INT:return function(n,i){return n.getInt32(i,!0)};case Y.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case Y.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case Y.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new _e(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let o=new h,r=t.length/3;for(let a=0;a<r;a++)h.unpack(t,a*3,o),R.multiplyByPoint(n,o,o),h.pack(o,i,a*3);return i}static readImplicitRangeAsTypedArray(t,n){let i=n.attributes[0]?.count??0,o=t.offset,r=t.repeat,a=new Float32Array(i);if(l(r))for(let s=0;s<i;s++)a[s]=o+Math.floor(s/r);else a.fill(o);return a}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,o=t.count,r=t.indexDatatype,a=e.createIndexTypedArray(r,o);return i.getBufferData(a),a}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Re.TRIANGLES)return i;if(n===Re.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Re.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new _e(`The primitiveType must be TRIANGLES (${Re.TRIANGLES}, TRIANGLE_STRIP (${Re.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Re.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case Ue.UNSIGNED_BYTE:return new Uint8Array(n);case Ue.UNSIGNED_SHORT:return new Uint16Array(n);case Ue.UNSIGNED_INT:return new Uint32Array(n)}throw new _e(`The indexDatatype must be UNSIGNED_BYTE (${Ue.UNSIGNED_BYTE}, UNSIGNED_SHORT (${Ue.UNSIGNED_SHORT}, or UNSIGNED_INT (${Ue.UNSIGNED_INT}, but is ${t}`)}static forEachPrimitive(t,n,i){let o=n?.mapProjection,r=n?.instanceFeatureIdLabel,a=t.sceneGraph;if(!l(a))return;let s={nodeComputedTransform:new R,modelMatrix:new R,computedModelMatrix:new R},c=a._runtimeNodes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=e.computeNodeTransforms(d,a,t,s),g=p.computedModelMatrix;l(o)&&(g=pt.basisTo2D(o,g,g));let m=e.computeInstanceTransforms(d,g,p.nodeComputedTransform,p.modelMatrix),A=l(r)?e.computeInstanceFeatureIds(d,r):void 0,y=[];for(let b=0;b<m.length;b++)y.push({transform:m[b],featureId:l(A)?A[b]:void 0});let x=d.runtimePrimitives.length;for(let b=0;b<x;b++){let T=d.runtimePrimitives[b];i(T,T.primitive,y,g)}}}static computeNodeTransforms(t,n,i,o){let r=t.node,a=R.clone(t.computedTransform,o.nodeComputedTransform),s=R.clone(n.computedModelMatrix,o.modelMatrix),c=r.instances;l(c)&&c.transformInWorldSpace&&(s=R.multiplyTransformation(i.modelMatrix,n.components.transform,s),a=R.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,a));let u=R.multiplyTransformation(s,a,o.computedModelMatrix);return o.computedModelMatrix=u,o.nodeComputedTransform=a,o.modelMatrix=s,o}static computeInstanceTransforms(t,n,i,o){let r=[],s=t.node.instances;if(l(s)){let c=s.attributes[0].count,u=s.attributes[0].componentDatatype,f=12,d=t.transformsTypedArray;if(!l(d)){let p=t.instancingTransformsBuffer;l(p)&&(d=Y.createTypedArray(u,c*f),p.getBufferData(d))}l(d)?e.computeInstanceTransformsFromTypedArray(d,c,r):e.computeInstanceTransformsFromAttributes(s,c,r);for(let p=0;p<r.length;p++){let g=r[p];s.transformInWorldSpace?(R.multiplyTransformation(g,i,g),R.multiplyTransformation(o,g,g)):R.multiplyTransformation(n,g,g)}}return r.length===0&&r.push(n),r}static computeInstanceFeatureIds(t,n){let o=t.node.instances;if(!l(o))return;let r=mt.getFeatureIdsByLabel(o.featureIds,n);if(!l(r))return;let a;if("setIndex"in r){let c=mt.getAttributeBySemantic(o,it.FEATURE_ID,r.setIndex);l(c)&&(a=e.readAttributeAsTypedArray(c))}if("offset"in r&&(a=e.readImplicitRangeAsTypedArray(r,o)),!l(a))return;let s=new Array(a.length);for(let c=0;c<a.length;c++)s[c]=a[c];return s}static computeInstanceTransformsFromTypedArray(t,n,i){for(let r=0;r<n;r++){let a=r*12,s=new R(t[a],t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],t[a+9],t[a+10],t[a+11],0,0,0,1);i.push(s)}}static computeInstanceTransformsFromAttributes(t,n,i){let o=mt.getAttributeBySemantic(t,wr.TRANSLATION),r=mt.getAttributeBySemantic(t,wr.ROTATION),a=mt.getAttributeBySemantic(t,wr.SCALE),s=l(o),c=l(r),u=l(a);if(!s&&!c&&!u)return;let f,d,p;s&&(f=e.readAttributeAsRawCompactTypedArray(o)),c&&(d=e.readAttributeAsRawCompactTypedArray(r)),u&&(p=e.readAttributeAsRawCompactTypedArray(a));for(let g=0;g<n;g++){let m=s?new h(f[g*3],f[g*3+1],f[g*3+2]):h.ZERO,A=c?new Le(d[g*4],d[g*4+1],d[g*4+2],d[g*4+3]):Le.IDENTITY,y=u?new h(p[g*3],p[g*3+1],p[g*3+2]):h.ONE,x=R.fromTranslationQuaternionRotationScale(m,A,y,new R);i.push(x)}}},Is=MX;var xE=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),Ahe={name:"EdgeVisibilityPipelineStage"};Ahe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,he.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,he.FRAGMENT),i.addFragmentLines(o3),i.addVertexLines(r3),i.addUniform("bool","u_isEdgePass",he.BOTH);let o=t.material,r=l(o)?o.lineStyle:void 0;(!l(r)||!l(r.width))&&i.addUniform("float","u_lineWidth",he.VERTEX);let a=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let s=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_faceNormalA"),u=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let f=i.addAttribute("vec3","a_edgeOtherPos"),d=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let p=OKe(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=MKe(g),y=p.edgeData.some(function(O){return l(O.color)})||l(m),x;y&&(x=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,he.BOTH));let b,T,E=mt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(E)&&(b=E,T=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,he.VERTEX));let S=RKe(p.edgeIndices,p.edgeData,t.edgeVisibility),w=BKe(p.edgeIndices,p.edgeData,e,n.context,a,c,u,s,x,f,d,m,t.edgeVisibility,S,b,T);if(!l(w))return;w.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,he.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(b)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let P=l(r)&&l(r.width)?r.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:w.vertexArray,indexCount:w.indexCount,primitiveType:Re.TRIANGLES,pass:Ie.CESIUM_3D_TILE_EDGES,lineWidth:P}};function RKe(e,t,n){let i=e.length/2,o=new Float32Array(i*6),r=n.silhouetteNormals;if(!l(r))return o;let a=new Float32Array(r.length*3),s=new h;for(let c=0;c<r.length;c++){let u=r[c];s.x=2*((u.x+128)/255)-1,s.y=2*((u.y+128)/255)-1,s.z=2*((u.z+128)/255)-1,h.magnitudeSquared(s)>0?h.normalize(s,s):(s.x=0,s.y=0,s.z=1),a[c*3]=s.x,a[c*3+1]=s.y,a[c*3+2]=s.z}for(let c=0;c<i;c++){let{edgeType:u,silhouetteEdgeIndex:f}=t[c];if(u!==xE.SILHOUETTE||f<0)continue;let d=f*2;if((d+1)*3+2>=a.length)continue;let p=d*3,g=(d+1)*3,m=c*6;o[m]=a[p],o[m+1]=a[p+1],o[m+2]=a[p+2],o[m+3]=a[g],o[m+4]=a[g+1],o[m+5]=a[g+2]}return o}function OKe(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,o=t.lineStrings,r=e.attributes,a=l(r)&&r.length>0?r[0].count:0,s=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(o)&&o.length>0;if(!s&&!c)return[];let u=s?i.typedArray:void 0,f=[],d=[],p=new Set,g=0,m=t.materialColor;if(s){let A=0,y=u.length,x=n;for(let b=0;b+2<y;b+=3){let T=u[b],E=u[b+1],S=u[b+2];for(let w=0;w<3;w++){let P,O;w===0?(P=T,O=E):w===1?(P=E,O=S):(P=S,O=T);let B=Math.floor(A/4),L=A%4*2;if(A++,B>=x.length)break;let C=x[B]>>L&3;if(C===xE.HIDDEN)continue;let v=Math.min(P,O),I=Math.max(P,O),M=`${v},${I}`;if(p.has(M))continue;p.add(M),f.push(P,O);let N=-1;C===xE.SILHOUETTE&&(N=g,g++),d.push({edgeType:C===xE.REPEATED_HARD?xE.HARD:C,silhouetteEdgeIndex:N,color:m})}}}if(c)for(let A=0;A<o.length;A++){let y=o[A];if(!l(y)||!l(y.indices))continue;let x=y.indices;if(!l(x)||x.length<2)continue;let b=y.restartIndex,T=l(y.materialColor)?y.materialColor:m,E;for(let S=0;S<x.length;S++){let w=x[S];if(l(b)&&w===b){E=void 0;continue}if(!l(E)){E=w;continue}let P=E,O=w;if(E=w,P===O||a>0&&(P<0||P>=a||O<0||O>=a))continue;let B=Math.min(P,O),L=Math.max(P,O),_=`${B},${L}`;p.has(_)||(p.add(_),f.push(P,O),d.push({edgeType:xE.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function MKe(e){if(!l(e))return;let t=mt.getAttributeBySemantic(e,it.COLOR);if(!l(t))return;let n=Ft.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=Is.readAttributeAsTypedArray(t)),!l(i))return;let o=t.count;if(!l(o)||o===0||i.length<o*n)return;let r=i instanceof Float32Array||i instanceof Float64Array,a=i instanceof Uint8Array,s=i instanceof Uint16Array;if(!r&&!a&&!s)return;let c=new Float32Array(o*4),u=function(f){let d;return r?d=f:a?d=f/255:s&&(d=f/65535),Math.min(Math.max(d,0),1)};for(let f=0;f<o;f++){let d=f*n,p=f*4;c[p]=u(i[d]),c[p+1]=u(i[d+1]),c[p+2]=u(i[d+2]),n===4?c[p+3]=u(i[d+3]):c[p+3]=1}return{colors:c,count:o}}function BKe(e,t,n,i,o,r,a,s,c,u,f,d,p,g,m,A){if(!l(e)||e.length===0)return;let y=t.length,b=y*4,T=0,E=mt.getAttributeBySemantic(n.runtimePrimitive.primitive,it.POSITION),S=l(E.typedArray)?E.typedArray:Is.readAttributeAsTypedArray(E),w=new Float32Array(b*3),P=new Float32Array(b),O=new Float32Array(b*3),B=new Float32Array(b*3),L=new Float32Array(b*3),_=new Float32Array(b),C=l(m),v=C?new Float32Array(b):void 0,I;C&&(I=l(m.typedArray)?m.typedArray:Is.readAttributeAsTypedArray(m));let M=l(c),N=M?new Float32Array(b*4):void 0,j=l(d)?d.colors:void 0,k=l(d)?d.count:0;function V(et){if(!M)return;let Pe=et*4;N[Pe]=0,N[Pe+1]=0,N[Pe+2]=0,N[Pe+3]=-1}function F(et,Pe){if(!M)return;let Ye=et*4,ut=l(Pe.x)?Pe.x:Pe[0],Ct=l(Pe.y)?Pe.y:Pe[1],en=l(Pe.z)?Pe.z:Pe[2],Gt=l(Pe.w)?Pe.w:l(Pe[3])?Pe[3]:1;N[Ye]=ut,N[Ye+1]=Ct,N[Ye+2]=en,N[Ye+3]=Gt}function W(et,Pe){if(!M)return;if(Pe>=k){V(et);return}let Ye=Pe*4,ut=et*4;N[ut]=j[Ye],N[ut+1]=j[Ye+1],N[ut+2]=j[Ye+2],N[ut+3]=j[Ye+3]}for(let et=0;et<y;et++){let Pe=e[et*2],Ye=e[et*2+1],Ct=t[et].edgeType/255,en=S[Pe*3],Gt=S[Pe*3+1],yt=S[Pe*3+2],wt=S[Ye*3],xn=S[Ye*3+1],at=S[Ye*3+2],st=et*4;w[st*3]=en,w[st*3+1]=Gt,w[st*3+2]=yt,L[st*3]=wt,L[st*3+1]=xn,L[st*3+2]=at,_[st]=-1,P[st]=Ct,w[(st+1)*3]=en,w[(st+1)*3+1]=Gt,w[(st+1)*3+2]=yt,L[(st+1)*3]=wt,L[(st+1)*3+1]=xn,L[(st+1)*3+2]=at,_[st+1]=1,P[st+1]=Ct,w[(st+2)*3]=wt,w[(st+2)*3+1]=xn,w[(st+2)*3+2]=at,L[(st+2)*3]=en,L[(st+2)*3+1]=Gt,L[(st+2)*3+2]=yt,_[st+2]=1,P[st+2]=Ct,w[(st+3)*3]=wt,w[(st+3)*3+1]=xn,w[(st+3)*3+2]=at,L[(st+3)*3]=en,L[(st+3)*3+1]=Gt,L[(st+3)*3+2]=yt,_[st+3]=-1,P[st+3]=Ct;let Ln=t[et].color;if(l(Ln))for(let sn=0;sn<4;sn++)F(st+sn,Ln);else if(l(j))for(let sn=0;sn<4;sn++)W(st+sn,Pe);else for(let sn=0;sn<4;sn++)V(st+sn);if(C){let sn=I[Pe],Qn=I[Ye];v[st]=sn,v[st+1]=sn,v[st+2]=Qn,v[st+3]=Qn}let Nn=et*6,so=g[Nn],jo=g[Nn+1],to=g[Nn+2],no=g[Nn+3],jn=g[Nn+4],Gn=g[Nn+5];for(let sn=0;sn<4;sn++)O[(st+sn)*3]=so,O[(st+sn)*3+1]=jo,O[(st+sn)*3+2]=to,B[(st+sn)*3]=no,B[(st+sn)*3+1]=jn,B[(st+sn)*3+2]=Gn}let q=Ke.createVertexBuffer({context:i,typedArray:w,usage:Oe.STATIC_DRAW}),J=Ke.createVertexBuffer({context:i,typedArray:P,usage:Oe.STATIC_DRAW}),H=Ke.createVertexBuffer({context:i,typedArray:O,usage:Oe.STATIC_DRAW}),Z=Ke.createVertexBuffer({context:i,typedArray:B,usage:Oe.STATIC_DRAW}),K=Ke.createVertexBuffer({context:i,typedArray:L,usage:Oe.STATIC_DRAW}),le=Ke.createVertexBuffer({context:i,typedArray:_,usage:Oe.STATIC_DRAW}),me=M?Ke.createVertexBuffer({context:i,typedArray:N,usage:Oe.STATIC_DRAW}):void 0,ae=C?Ke.createVertexBuffer({context:i,typedArray:v,usage:Oe.STATIC_DRAW}):void 0,ge=y*2*3,we=b>65534,Ee=we?new Uint32Array(ge):new Uint16Array(ge);for(let et=0;et<y;et++){let Pe=et*4,Ye=et*6;Ee[Ye]=Pe,Ee[Ye+1]=Pe+1,Ee[Ye+2]=Pe+2,Ee[Ye+3]=Pe,Ee[Ye+4]=Pe+2,Ee[Ye+5]=Pe+3}let Be=Ke.createIndexBuffer({context:i,typedArray:Ee,usage:Oe.STATIC_DRAW,indexDatatype:we?Ue.UNSIGNED_INT:Ue.UNSIGNED_SHORT}),ke=[{index:T,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:o,vertexBuffer:J,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1},{index:r,vertexBuffer:H,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:a,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:u,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:f,vertexBuffer:le,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1}];M&&ke.push({index:c,vertexBuffer:me,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1}),C&&ke.push({index:A,vertexBuffer:ae,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1});let Ge=n.runtimePrimitive.primitive;if(l(Ge.featureIds)&&Ge.featureIds.length>0){let et=Ge.featureIds[0];if(l(et.setIndex)){let Pe=Ge.attributes.find(Ye=>Ye.semantic===it.FEATURE_ID&&Ye.setIndex===et.setIndex);if(l(Pe)){let Ye=l(Pe.typedArray)?Pe.typedArray:Is.readAttributeAsTypedArray(Pe),ut=new Float32Array(b);for(let en=0;en<y;en++){let Gt=e[en*2],yt=Gt<Ye.length?Ye[Gt]:0;for(let wt=0;wt<4;wt++)ut[en*4+wt]=yt}let Ct=Ke.createVertexBuffer({context:i,typedArray:ut,usage:Oe.STATIC_DRAW});ke.push({index:s,vertexBuffer:Ct,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1})}}}return{vertexArray:new Fn({context:i,attributes:ke,indexBuffer:Be}),indexCount:ge,hasEdgeFeatureIds:l(Ge.featureIds)&&Ge.featureIds.length>0}}var a3=Ahe;var s3=`void geometryStage(out ProcessedAttributes attributes)
  7922. {
  7923. attributes.positionMC = v_positionMC;
  7924. attributes.positionEC = v_positionEC;
  7925. #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)
  7926. attributes.positionWC = v_positionWC;
  7927. #endif
  7928. #ifdef HAS_NORMALS
  7929. // renormalize after interpolation
  7930. attributes.normalEC = normalize(v_normalEC);
  7931. #endif
  7932. #ifdef HAS_TANGENTS
  7933. attributes.tangentEC = normalize(v_tangentEC);
  7934. #endif
  7935. #ifdef HAS_BITANGENTS
  7936. attributes.bitangentEC = normalize(v_bitangentEC);
  7937. #endif
  7938. // Everything else is dynamically generated in GeometryPipelineStage
  7939. setDynamicVaryings(attributes);
  7940. }
  7941. `;var c3=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
  7942. {
  7943. vec4 computedPosition;
  7944. // Compute positions in different coordinate systems
  7945. vec3 positionMC = attributes.positionMC;
  7946. v_positionMC = positionMC;
  7947. v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;
  7948. #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
  7949. vec3 position2D = attributes.position2D;
  7950. vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
  7951. computedPosition = czm_projection * vec4(positionEC, 1.0);
  7952. #else
  7953. computedPosition = czm_projection * vec4(v_positionEC, 1.0);
  7954. #endif
  7955. // Sometimes the custom shader and/or style needs this
  7956. #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS)
  7957. // Note that this is a 32-bit position which may result in jitter on small
  7958. // scales.
  7959. v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
  7960. #endif
  7961. #ifdef HAS_NORMALS
  7962. v_normalEC = normalize(normal * attributes.normalMC);
  7963. #endif
  7964. #ifdef HAS_TANGENTS
  7965. v_tangentEC = normalize(normal * attributes.tangentMC);
  7966. #endif
  7967. #ifdef HAS_BITANGENTS
  7968. v_bitangentEC = normalize(normal * attributes.bitangentMC);
  7969. #endif
  7970. // All other varyings need to be dynamically generated in
  7971. // GeometryPipelineStage
  7972. setDynamicVaryings(attributes);
  7973. return computedPosition;
  7974. }
  7975. `;var yD=`vec2 computeSt(float featureId)
  7976. {
  7977. float stepX = model_textureStep.x;
  7978. float centerX = model_textureStep.y;
  7979. #ifdef MULTILINE_BATCH_TEXTURE
  7980. float stepY = model_textureStep.z;
  7981. float centerY = model_textureStep.w;
  7982. float xId = mod(featureId, model_textureDimensions.x);
  7983. float yId = floor(featureId / model_textureDimensions.x);
  7984. return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
  7985. #else
  7986. return vec2(centerX + (featureId * stepX), 0.5);
  7987. #endif
  7988. }
  7989. void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
  7990. {
  7991. int featureId = featureIds.SELECTED_FEATURE_ID;
  7992. if (featureId < model_featuresLength)
  7993. {
  7994. vec2 featureSt = computeSt(float(featureId));
  7995. feature.id = featureId;
  7996. feature.st = featureSt;
  7997. feature.color = texture(model_batchTexture, featureSt);
  7998. }
  7999. // Floating point comparisons can be unreliable in GLSL, so we
  8000. // increment the feature ID to make sure it's always greater
  8001. // then the model_featuresLength - a condition we check for in the
  8002. // pick ID, to avoid sampling the pick texture if the feature ID is
  8003. // greater than the number of features.
  8004. else
  8005. {
  8006. feature.id = model_featuresLength + 1;
  8007. feature.st = vec2(0.0);
  8008. feature.color = vec4(1.0);
  8009. }
  8010. #ifdef HAS_NULL_FEATURE_ID
  8011. if (featureId == model_nullFeatureId) {
  8012. feature.id = featureId;
  8013. feature.st = vec2(0.0);
  8014. feature.color = vec4(1.0);
  8015. }
  8016. #endif
  8017. }
  8018. `;var xD={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};xD.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,a=LKe(o,r,t),s=a.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,s),i.addDefine("SELECTED_FEATURE_ID",a.variableName,s),i.addDefine(a.featureIdDefine,void 0,s),NKe(i);let c=a.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,s),i.addUniform("int","model_nullFeatureId",s),u.model_nullFeatureId=function(){return c}),a.shaderDestination===he.BOTH&&i.addVertexLines(yD),i.addFragmentLines(yD)};function yhe(e){return e instanceof yn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function xhe(e){return e instanceof yn.FeatureIdTexture?he.FRAGMENT:he.BOTH}function LKe(e,t,n){let i,o;return l(t.instances)&&(o=mt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:xhe(o),featureIdDefine:yhe(o)}):(o=mt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:xhe(o),featureIdDefine:yhe(o)})}function NKe(e){e.addStructField(xD.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(xD.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(xD.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Ex=xD;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",he.VERTEX),i.addStruct(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",he.FRAGMENT),i.addStruct(Ex.STRUCT_ID_SELECTED_FEATURE,Ex.STRUCT_NAME_SELECTED_FEATURE,he.BOTH),i.addFunction(Ds.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ds.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,he.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,he.VERTEX),i.addFunction(Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ds.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,he.FRAGMENT),o.type===qr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,he.FRAGMENT);let r=n.mode!==ie.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,a=l(e.runtimeNode.node.instances),s=r&&!a,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=Ft.getAttributeLocationCount(f.type),p=f.semantic===it.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!s?g=0:g=e.attributeIndex++;let m=!p&&t.primitiveType===Re.POINTS&&n.context.webgl2?"flat":void 0;FKe(e,f,g,d,r,a,m)}qKe(i,t.attributes),t.primitiveType===Re.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(c3),i.addFragmentLines(s3)};function FKe(e,t,n,i,o,r,a){let s=e.shaderBuilder,c=mt.getAttributeInfo(t),u=o&&!r;i>1?UKe(e,t,n,i):zKe(e,t,n,u),jKe(s,c,u),VKe(s,c,a),l(t.semantic)&&kKe(s,t),GKe(s,c,o),HKe(s,c,u),WKe(s,c)}function kKe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case it.NORMAL:e.addDefine("HAS_NORMALS");break;case it.TANGENT:e.addDefine("HAS_TANGENTS");break;case it.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case it.TEXCOORD:case it.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function zKe(e,t,n,i){let{quantization:o,semantic:r,setIndex:a}=t,{type:s,componentDatatype:c}=l(o)?o:t;r===it.FEATURE_ID&&a>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a+1);let u=r===it.POSITION,f=u?0:n,d=Ft.getNumberOfComponents(s),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:Y.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function UKe(e,t,n,i){let{quantization:o,normalized:r}=t,{type:a,componentDatatype:s}=l(o)?o:t,u=Ft.getNumberOfComponents(a)/i,f=Y.getSizeInBytes(s),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,A={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:s,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(A)}}function VKe(e,t,n){let i=t.variableName,o=`v_${i}`,r;i==="normalMC"?(o="v_normalEC",r=t.glslType):i==="tangentMC"?(r="vec3",o="v_tangentEC"):r=t.glslType,e.addVarying(r,o,n)}function jKe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,a;t.isQuantized?(r=`a_quantized_${o}`,a=t.quantizedGlslType):(r=`a_${o}`,a=t.glslType);let s=i===it.POSITION;s?e.setPositionAttribute(a,r):e.addAttribute(a,r),s&&n&&e.addAttribute("vec3","a_position2D")}function GKe(e,t,n){let i=Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:a}=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,a,r),e.addStructField(o,a,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function HKe(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 a=[];o==="tangentMC"?(a.push("attributes.tangentMC = a_tangentMC.xyz;"),a.push("attributes.tangentSignMC = a_tangentMC.w;")):a.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,a)}function WKe(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,a=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[a]),o=Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,a=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[a])}function qKe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===it.NORMAL?n=!0:r.semantic===it.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 l3=Ds;var BX=new de,LX=new de,bhe=new h,The=new h,NX=class{constructor(t){lt(this,"_rectangleSouthwestInMeters");lt(this,"_rectangleNortheastInMeters");if(t=t??G.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??te.default,this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1,this._projection=new di(this._ellipsoid),l(t.rectangleSouthwestInMeters)&&l(t.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=t.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=t.rectangleNortheastInMeters;else{let o=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new z(-o,-o),this._rectangleNortheastInMeters=new z(o,o)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,bhe),this._projection.unproject(bhe,BX),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,The),this._projection.unproject(The,LX),this._rectangle=new oe(BX.longitude,BX.latitude,LX.longitude,LX.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=this._projection,o=i.project(oe.southwest(t)),r=i.project(oe.northeast(t));return l(n)?(n.west=o.x,n.south=o.y,n.east=r.x,n.north=r.y,n):new oe(o.x,o.y,r.x,r.y)}tileXYToNativeRectangle(t,n,i,o){let r=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,c=this._rectangleSouthwestInMeters.x+t*s,u=this._rectangleSouthwestInMeters.x+(t+1)*s,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/a,d=this._rectangleNortheastInMeters.y-n*f,p=this._rectangleNortheastInMeters.y-(n+1)*f;return l(o)?(o.west=c,o.south=p,o.east=u,o.north=d,o):new oe(c,p,u,d)}tileXYToRectangle(t,n,i,o){let r=this.tileXYToNativeRectangle(t,n,i,o),a=this._projection,s=a.unproject(new h(r.west,r.south)),c=a.unproject(new h(r.east,r.north));return r.west=s.longitude,r.south=s.latitude,r.east=c.longitude,r.north=c.latitude,r}positionToTileXY(t,n,i){let o=this._rectangle;if(!oe.contains(o,t))return;let r=this.getNumberOfXTilesAtLevel(n),a=this.getNumberOfYTilesAtLevel(n),c=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/a,p=this._projection.project(t),g=p.x-this._rectangleSouthwestInMeters.x,m=this._rectangleNortheastInMeters.y-p.y,A=g/c|0;A>=r&&(A=r-1);let y=m/f|0;return y>=a&&(y=a-1),l(i)?(i.x=A,i.y=y,i):new z(A,y)}},Ir=NX;var FX,Che="AAPTauP-rqeCeHTtrSMga9XbPxQ..ZMIZzf1tcwicoJi5E5T2mG0EO3qlIRkQNe5S-uA95RJKU0YkrwOT0AF-lSIyXXBFakDJIPaxsZ5vpnzlaW3kCYG2Tk53bY6OntMqn1EBYtDPyqz38iM4NU_bbDN3DuxUdkxYDWnxJXxxWe3bEeUANbvhKK76PU7N0wjZgtEYHYocspYXSHxbCEYo_eXrHDkrWpgkzcmQ3WpQqf2XprJ39pbqVSZbxskDh3zBm92XxUaiSmdf7rC1w3VoAT1_UarLJfAQ",bE={};bE.defaultAccessToken=Che;bE.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});bE.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});bE.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});bE.getDefaultTokenCredit=function(e){if(e===Che){if(!l(FX)){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>';FX=new xt(t,!0)}return FX}};var od=bE;function kX(e){e=e??G.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let a=mm(r);if(e.disableCheckIfAllPixelsAreTransparent){let s=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,d=u.length;s&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;a[g+3]>0&&(s=!1)}s&&(a=void 0)}n._missingImagePixels=a,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}kX.prototype.isReady=function(){return this._isReady};kX.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=mm(e),o=e.width;for(let r=0,a=t.length;r<a;++r){let s=t[r],c=s.x*4+s.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var u3=kX;function zX(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}zX.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])};zX.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 Jm=zX;function TE(){_e.throwInstantiationError()}Object.defineProperties(TE.prototype,{rectangle:{get:_e.throwInstantiationError},tileWidth:{get:_e.throwInstantiationError},tileHeight:{get:_e.throwInstantiationError},maximumLevel:{get:_e.throwInstantiationError},minimumLevel:{get:_e.throwInstantiationError},tilingScheme:{get:_e.throwInstantiationError},tileDiscardPolicy:{get:_e.throwInstantiationError},errorEvent:{get:_e.throwInstantiationError},credit:{get:_e.throwInstantiationError},proxy:{get:_e.throwInstantiationError},hasAlphaChannel:{get:_e.throwInstantiationError}});TE.prototype.getTileCredits=function(e,t,n){_e.throwInstantiationError()};TE.prototype.requestImage=function(e,t,n,i){_e.throwInstantiationError()};TE.prototype.pickFeatures=function(e,t,n,i,o){_e.throwInstantiationError()};var YKe=/\.ktx2$/i;TE.loadImage=function(e,t){let n=De.createIfNeeded(t);return YKe.test(n.url)?Hu(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var rd=TE;var Ehe={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(Ehe);var Zm=Ehe;function vhe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Yi({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new xt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}vhe.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 u3({missingImageUrl:She(e,0,0,this.maximumLevel).url,pixelsToCheck:[new z(0,0),new z(200,20),new z(20,200),new z(80,110),new z(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function XKe(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 Ir({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 re(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 di,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)),a=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 oe(r.longitude,r.latitude,a.longitude,a.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=oe.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 re(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new xt(e.copyrightText)]:t.credit=new xt(e.copyrightText))}function KKe(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new re(n)}async function QKe(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();XKe(i,t)}catch(i){KKe(e,i)}}function ep(e){e=e??G.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Yi({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=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 xt(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new ye}ep.fromBasemapType=async function(e,t){t=t??G.EMPTY_OBJECT;let n,i,o;switch(e){case Zm.SATELLITE:{n=t.token??od.defaultAccessToken,i=De.createIfNeeded(od.defaultWorldImageryServer),i.appendForwardSlash();let r=od.getDefaultTokenCredit(n);l(r)&&(o=xt.clone(r))}break;case Zm.OCEANS:{n=t.token??od.defaultAccessToken,i=De.createIfNeeded(od.defaultWorldOceanServer),i.appendForwardSlash();let r=od.getDefaultTokenCredit(n);l(r)&&(o=xt.clone(r))}break;case Zm.HILLSHADE:{n=t.token??od.defaultAccessToken,i=De.createIfNeeded(od.defaultWorldHillshadeServer),i.appendForwardSlash();let r=od.getDefaultTokenCredit(n);l(r)&&(o=xt.clone(r))}break;default:}return ep.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function She(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let a=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${a.west},${a.south},${a.east},${a.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Hi?(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(ep.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}}});ep.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new ep(t);i._resource=n;let o=new vhe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await QKe(n,o),o.build(i),i};ep.prototype.getTileCredits=function(e,t,n){return this._tileCredits};ep.prototype.requestImage=function(e,t,n,i){return rd.loadImage(this,She(this,e,t,n,i))};ep.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),a,s,c;if(this._tilingScheme.projection instanceof Hi)a=D.toDegrees(i),s=D.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new de(i,o,0));a=p.x,s=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${a},${s}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let A=0;A<m.length;++A){let y=m[A],x=new Jm;if(x.data=y,x.name=y.value,x.properties=y.attributes,x.configureDescriptionFromProperties(y.attributes),y.geometryType==="esriGeometryPoint"&&y.geometry){let b=y.geometry.spatialReference&&y.geometry.spatialReference.wkid?y.geometry.spatialReference.wkid:4326;if(b===4326||b===4283)x.position=de.fromDegrees(y.geometry.x,y.geometry.y,y.geometry.z);else if(b===102100||b===900913||b===3857){let T=new di;x.position=T.unproject(new h(y.geometry.x,y.geometry.y,y.geometry.z))}}g.push(x)}return g})};ep._metadataCache={};var X_=ep;function $Ke(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+=`
  8019. ${o}`),t}var B0=$Ke;function f3(e,t,n,i,o,r,a){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=a}f3.reportError=function(e,t,n,i,o,r,a,s){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=a,c.retry=!1,c.error=s,++c.timesRetried):c=new f3(t,i,o,r,a,0,s),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${B0(i)}`),c};f3.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Qo=f3;var whe={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"};Object.freeze(whe);var bD=whe;function TD(e){}TD.prototype.isReady=function(){return!0};TD.prototype.shouldDiscardImage=function(e){return TD.EMPTY_IMAGE===e};var d3;Object.defineProperties(TD,{EMPTY_IMAGE:{get:function(){return l(d3)||(d3=new Image,d3.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),d3}}});var CD=TD;function Ihe(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}Ihe.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 xt)break;o.credit=new xt(o.attribution);let r=o.coverageAreas;for(let a=0,s=o.coverageAreas.length;a<s;++a){let c=r[a],u=c.bbox;c.bbox=new oe(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}};function JKe(e,t){if(e.resourceSets.length!==1)throw new re("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 ZKe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Qo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new re(i)}async function eQe(e,t,n){let i=e.url,o=cs._metadataCache[i];l(o)||(o=e.fetchJson(),cs._metadataCache[i]=o);try{let r=await o;return JKe(r,t)}catch(r){ZKe(e,r,n)}}function cs(e){e=e??G.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=e.mapStyle??bD.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new CD),this._proxy=e.proxy,this._credit=new xt(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${cs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Ir({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 ye}Object.defineProperties(cs.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)}}});cs.fromUrl=async function(e,t){t=t??G.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=t.mapStyle??bD.AERIAL,o=De.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 a=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),s=new cs(t);s._resource=o;let c=new Ihe(t);return await eQe(a,c),c.build(s),s};var tQe=new oe;cs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,tQe);return oQe(this._attributionList,n,i)};cs.prototype.requestImage=function(e,t,n,i){let o=rd.loadImage(this,nQe(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?CD.EMPTY_IMAGE:Promise.reject(r)})};cs.prototype.pickFeatures=function(e,t,n,i,o){};cs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,a=0;(e&r)!==0&&(a|=1),(t&r)!==0&&(a|=2),i+=a}return i};cs.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,a=+e[i-o];(a&1)!==0&&(t|=r),(a&2)!==0&&(n|=r)}return{x:t,y:n,level:i}};cs._logoUrl=void 0;Object.defineProperties(cs,{logoUrl:{get:function(){return l(cs._logoUrl)||(cs._logoUrl=Xt("Assets/Images/bing_maps_credit.png")),cs._logoUrl},set:function(e){cs._logoUrl=e}}});function nQe(e,t,n,i,o){let r=e._imageUrlTemplate,a=e._imageUrlSubdomains,s=(t+n+i)%a.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:cs.tileXYToQuadKey(t,n,i),subdomain:a[s],culture:e._culture},queryParameters:{n:"z"}})}var iQe=new oe;function oQe(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let a=e[o],s=a.coverageAreas,c=!1;for(let u=0,f=a.coverageAreas.length;!c&&u<f;++u){let d=s[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=oe.intersection(n,d.bbox,iQe);l(p)&&(c=!0)}}c&&i.push(a.credit)}return i}cs._metadataCache={};var h3=cs;var Dhe=/{[^}]+}/g,Phe={x:cQe,y:uQe,z:hQe,s:mQe,reverseX:lQe,reverseY:fQe,reverseZ:dQe,westDegrees:pQe,southDegrees:gQe,eastDegrees:_Qe,northDegrees:AQe,westProjected:yQe,southProjected:xQe,eastProjected:bQe,northProjected:TQe,width:CQe,height:EQe},rQe=It(Phe,{i:vQe,j:SQe,reverseI:wQe,reverseJ:IQe,longitudeDegrees:PQe,latitudeDegrees:RQe,longitudeProjected:OQe,latitudeProjected:MQe,format:LQe});function ED(e){e=e??G.EMPTY_OBJECT,this._errorEvent=new ye;let t=De.createIfNeeded(e.url),n=De.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Ir({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=oe.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new xt(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,a=It(Phe,r),s=It(rQe,r);this._tags=a,this._pickFeaturesTags=s,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=e.enablePickFeatures??!0}Object.defineProperties(ED.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}}});ED.prototype.getTileCredits=function(e,t,n){};ED.prototype.requestImage=function(e,t,n,i){return rd.loadImage(this,aQe(this,e,t,n,i))};ED.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,a=this;function s(u,f){return u.callback(f)}function c(){if(r>=a._getFeatureInfoFormats.length)return Promise.resolve([]);let u=a._getFeatureInfoFormats[r],f=sQe(a,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(s.bind(void 0,u)).catch(c)}return c()};var m3=!1,tf=new oe,p3=!1,vD=new oe;function aQe(e,t,n,i,o){m3=!1,p3=!1;let r=e._resource,a=r.getUrlComponent(!0),s=e._tags,c={},u=a.match(Dhe);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(s[d])&&(c[d]=s[d](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var UX=!1,EE=new z,VX=!1;function sQe(e,t,n,i,o,r,a){m3=!1,p3=!1,UX=!1,VX=!1;let s=e._pickFeaturesResource,c=s.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(Dhe);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,o,r,a))}),s.getDerivedResource({templateValues:f})}function vE(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 cQe(e,t,n,i){return vE(e,"{x}",t)}function lQe(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return vE(e,"{reverseX}",o)}function uQe(e,t,n,i){return vE(e,"{y}",n)}function fQe(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return vE(e,"{reverseY}",o)}function dQe(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return vE(e,"{reverseZ}",r)}function hQe(e,t,n,i){return vE(e,"{z}",i)}function mQe(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function g3(e,t,n,i){m3||(e.tilingScheme.tileXYToRectangle(t,n,i,tf),tf.west=D.toDegrees(tf.west),tf.south=D.toDegrees(tf.south),tf.east=D.toDegrees(tf.east),tf.north=D.toDegrees(tf.north),m3=!0)}function pQe(e,t,n,i){return g3(e,t,n,i),tf.west}function gQe(e,t,n,i){return g3(e,t,n,i),tf.south}function _Qe(e,t,n,i){return g3(e,t,n,i),tf.east}function AQe(e,t,n,i){return g3(e,t,n,i),tf.north}function _3(e,t,n,i){p3||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,vD),p3=!0)}function yQe(e,t,n,i){return _3(e,t,n,i),vD.west}function xQe(e,t,n,i){return _3(e,t,n,i),vD.south}function bQe(e,t,n,i){return _3(e,t,n,i),vD.east}function TQe(e,t,n,i){return _3(e,t,n,i),vD.north}function CQe(e,t,n,i){return e.tileWidth}function EQe(e,t,n,i){return e.tileHeight}function vQe(e,t,n,i,o,r,a){return A3(e,t,n,i,o,r),EE.x}function SQe(e,t,n,i,o,r,a){return A3(e,t,n,i,o,r),EE.y}function wQe(e,t,n,i,o,r,a){return A3(e,t,n,i,o,r),e.tileWidth-EE.x-1}function IQe(e,t,n,i,o,r,a){return A3(e,t,n,i,o,r),e.tileHeight-EE.y-1}var DQe=new oe,CE=new h;function A3(e,t,n,i,o,r,a){if(UX)return;jX(e,t,n,i,o,r);let s=CE,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,DQe);EE.x=e.tileWidth*(s.x-c.west)/c.width|0,EE.y=e.tileHeight*(c.north-s.y)/c.height|0,UX=!0}function PQe(e,t,n,i,o,r,a){return D.toDegrees(o)}function RQe(e,t,n,i,o,r,a){return D.toDegrees(r)}function OQe(e,t,n,i,o,r,a){return jX(e,t,n,i,o,r),CE.x}function MQe(e,t,n,i,o,r,a){return jX(e,t,n,i,o,r),CE.y}var BQe=new de;function jX(e,t,n,i,o,r,a){if(!VX){if(e.tilingScheme.projection instanceof Hi)CE.x=D.toDegrees(o),CE.y=D.toDegrees(r);else{let s=BQe;s.longitude=o,s.latitude=r,e.tilingScheme.projection.project(s,CE)}VX=!0}}function LQe(e,t,n,i,o,r,a){return a}var Ca=ED;function ad(e){Ca.call(this,e)}ad._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return ad._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof r0)return ad._metadataFailure(e,t);throw o}};ad.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??G.EMPTY_OBJECT;let r=await ad._requestMetadata(t,i,o);return new ad(r)};l(Object.create)&&(ad.prototype=Object.create(Ca.prototype),ad.prototype.constructor=ad);function Rhe(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 Ohe(e,t,n){let i=e.positionToTileXY(oe.southwest(t),n),o=e.positionToTileXY(oe.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}ad._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,a=/tileset/i,s=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let O=0;O<g.length;O++)if(r.test(g.item(O).nodeName))u=g.item(O);else if(s.test(g.item(O).nodeName)){d=g.item(O);let B=g.item(O).childNodes;for(let L=0;L<B.length;L++)a.test(B.item(L).nodeName)&&p.push(B.item(L))}else c.test(g.item(O).nodeName)&&(f=g.item(O));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Qo.reportError(void 0,o,o.errorEvent,m),new re(m);let A=t.fileExtension??u.getAttribute("extension"),y=t.tileWidth??parseInt(u.getAttribute("width"),10),x=t.tileHeight??parseInt(u.getAttribute("height"),10),b=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),T=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),E=d.getAttribute("profile"),S=t.tilingScheme;if(!l(S))if(E==="geodetic"||E==="global-geodetic")S=new Yi({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")S=new Ir({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(o)&&Qo.reportError(void 0,o,o.errorEvent,m),new re(m);let w=oe.clone(t.rectangle);if(!l(w)){let O,B,L,_;t.flipXY??!1?(L=new z(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new z(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new z(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new z(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let v=E==="geodetic"||E==="mercator";if(S.projection instanceof Hi||v)O=de.fromDegrees(L.x,L.y),B=de.fromDegrees(_.x,_.y);else{let I=S.projection;O=I.unproject(L),B=I.unproject(_)}w=new oe(O.longitude,O.latitude,B.longitude,B.latitude)}return w=Rhe(w,S),b=Ohe(S,w,b),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${A}`}),tilingScheme:S,rectangle:w,tileWidth:y,tileHeight:x,minimumLevel:b,maximumLevel:T,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};ad._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,a=l(e.tilingScheme)?e.tilingScheme:new Ir({ellipsoid:e.ellipsoid}),s=e.rectangle??a.rectangle;s=Rhe(s,a);let c=Ohe(a,s,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:a,rectangle:s,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var vx=ad;function Mhe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Mhe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function NQe(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 re(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new re(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new oe(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Ir({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new re(o)}return!0}function FQe(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Qo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function kQe(e,t,n){try{let i=await e.fetchText();NQe(i,t)}catch(i){FQe(i,e,n)}}function _u(e){e=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 xt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${_u.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 ye}Object.defineProperties(_u.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}}});_u.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=De.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"}}),a=new Mhe(n);a.channel=t,await kQe(r,a);let s=new _u(n);return a.build(s),s._resource=o,s._url=e,s._path=i,s};_u.prototype.getTileCredits=function(e,t,n){};_u.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 rd.loadImage(this,o)};_u.prototype.pickFeatures=function(e,t,n,i,o){};_u._logoUrl=void 0;Object.defineProperties(_u,{logoUrl:{get:function(){return l(_u._logoUrl)||(_u._logoUrl=Xt("Assets/Images/google_earth_credit.png")),_u._logoUrl},set:function(e){_u._logoUrl=e}}});var y3=_u;var zQe=/\/$/,Bhe=new xt('&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 SE(e){e=e??G.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=De.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();zQe.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let a;l(e.credit)?(a=e.credit,typeof a=="string"&&(a=new xt(a))):a=Bhe,this._resource=i,this._imageryProvider=new Ca({url:i,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(SE.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}}});SE.prototype.getTileCredits=function(e,t,n){};SE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};SE.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};SE._defaultCredit=Bhe;var x3=SE;function Sx(e){e=e??G.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=e.rectangle??oe.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 ye;let i=e.credit;typeof i=="string"&&(i=new xt(i)),this._credit=i;let o=De.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(Sx.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 UQe(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Qo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return GX(e,n,r);throw l(n)&&(n._hasError=!0),new re(o)}async function GX(e,t,n){try{return await rd.loadImage(null,e)}catch(i){return UQe(e,i,t,n)}}Sx.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await GX(n);t=t??G.EMPTY_OBJECT;let o=new Sx({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};Sx.prototype.getTileCredits=function(e,t,n){};Sx.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await GX(this._resource,this);return this._image=o,Qo.reportSuccess(this._errorEvent),o}return this._image};Sx.prototype.pickFeatures=function(e,t,n,i,o){};var b3=Sx;function VQe(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=jQe:e==="xml"?n=qQe:(e==="html"||e==="text")&&(n=Lhe)),this.callback=n}function jQe(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Jm;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let a=o.geometry.coordinates[0],s=o.geometry.coordinates[1];r.position=de.fromDegrees(a,s)}t.push(r)}return t}var HX="http://www.mapinfo.com/mxp",GQe="http://www.esri.com/wms",HQe="http://www.opengis.net/wfs",WQe="http://www.opengis.net/gml";function qQe(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===HX)return YQe(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===GQe)return XQe(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===HQe)return KQe(e);if(t.localName==="ServiceExceptionReport")throw new re(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?QQe(e):$Qe(e)}function YQe(e){let t=[],i=e.documentElement.getElementsByTagNameNS(HX,"Feature");for(let o=0;o<i.length;++o){let r=i[o],a={},s=r.getElementsByTagNameNS(HX,"Val");for(let u=0;u<s.length;++u){let f=s[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();a[d]=p}}let c=new Jm;c.data=r,c.properties=a,c.configureNameFromProperties(a),c.configureDescriptionFromProperties(a),t.push(c)}return t}function XQe(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let a=o[r];i={};let s=a.attributes;for(let c=0;c<s.length;++c){let u=s[c];i[u.name]=u.value}n.push(T3(a,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let a=0;a<r.length;++a){let s=r[a];i={};let c=s.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(T3(s,i))}}return n}function KQe(e){let t=[],i=e.documentElement.getElementsByTagNameNS(WQe,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],a={};WX(r,a),t.push(T3(r,a))}return t}function QQe(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 re("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let a=o[r];if(a.nodeType===Node.ELEMENT_NODE){let s={};WX(a,s),t.push(T3(a,s))}}return t}function WX(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()&&WX(o,t)&&(t[o.localName]=o.textContent)}return n}function T3(e,t){let n=new Jm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function $Qe(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Jm;return o.data=e,o.description=n.innerHTML,[o]}var JQe=/<body>\s*<\/body>/im,ZQe=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,e$e=/<title>([\s\S]*)<\/title>/im;function Lhe(e){if(JQe.test(e)||ZQe.test(e))return;let t,n=e$e.exec(e);n&&n.length>1&&(t=n[1]);let i=new Jm;return i.name=t,i.description=e,i.data=e,[i]}var tp=VQe;function SD(e){e=e??G.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(SD.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)}}});SD.prototype.getFromCache=function(e,t,n,i){let o=Nhe(e,t,n),r,a=this._tileCache[this._currentIntervalIndex];if(l(a)&&l(a[o])){let s=a[o];r=s.promise.catch(function(c){throw i.state=s.request.state,c}),delete a[o]}return r};SD.prototype.checkApproachingInterval=function(e,t,n,i){let o=Nhe(e,t,n),r=this._tilesRequestedForInterval,a=Fhe(this),s={key:o,priorityFunction:i.priorityFunction};(!l(a)||!khe(this,s,a))&&r.push(s),r.length>=512&&r.splice(0,256)};SD.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let a=this._tileCache[o];for(let s in a)a.hasOwnProperty(s)&&a[s].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=Fhe(this);if(l(r)){let a=this._tilesRequestedForInterval,s=!0;for(;s&&a.length!==0;){let c=a.pop();s=khe(this,c,r),s||a.push(c)}}};function Nhe(e,t,n){return`${e}-${t}-${n}`}function t$e(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Fhe(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 a,s=t.indexOf(i);if(s<0)return;let c=t.get(s);return r>0?(a=Q.secondsDifference(c.stop,i),++s):(a=Q.secondsDifference(c.start,i),--s),a/=r,s>=0&&a<=5?t.get(s):void 0}function khe(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let a=t.key;if(l(r[a]))return!0;let s=t$e(a),c=new Cr({throttle:!1,throttleByServer:!0,type:ts.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(s.x,s.y,s.level,c,n);return l(u)?(r[a]={promise:u,request:c},!0):!1}var wE=SD;var n$e=[3034,3035,3042,3043,3044],i$e=[4471,4559];function yh(e){if(e=e??G.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new _e("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=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(yh.DefaultParameters,!0),n.setQueryParameters(yh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(zhe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(zhe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new wE({clock:e.clock,times:e.times,requestImageFunction:function(a,s,c,u,f){return Uhe(i,a,s,c,u,f)},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=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof di?"EPSG:3857":"CRS:84");let a=o.crs.split(":");if(a[0]==="EPSG"&&a.length===2){let s=Number(a[1]);(s>=4e3&&s<5e3&&!i$e.includes(s)||n$e.includes(s))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof di?"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 Ca({url:t,pickFeaturesUrl:n,tilingScheme: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:e.getFeatureInfoFormats??yh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function Uhe(e,t,n,i,o,r){let a=l(r)?r.data:void 0,s=e._tileProvider;return l(a)&&s._resource.setQueryParameters(a),s.requestImage(t,n,i,o)}function o$e(e,t,n,i,o,r,a){let s=l(a)?a.data:void 0,c=e._tileProvider;return l(s)&&c._pickFeaturesResource.setQueryParameters(s),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(yh.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}}});yh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};yh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,a;return l(r)&&(a=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Uhe(this,e,t,n,i,a)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};yh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,a=l(r)?r.currentInterval:void 0;return o$e(this,e,t,n,i,o,a)};yh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});yh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});yh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new tp("json","application/json")),Object.freeze(new tp("xml","text/xml")),Object.freeze(new tp("text","text/html"))]);function zhe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var C3=yh;function nf(e){e=e??G.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._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,o=e.tileMatrixSetID,r=t.url,a=e.format??"image/jpeg",s=r.match(/{/g);if(!l(s)||s.length===1&&/{s}/.test(r)?(t.setQueryParameters(nf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(nf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(nf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Vhe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(nf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(Vhe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=a,this._dimensions=e.dimensions,this._tilematrixset=o;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=o,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:a},!0),n.setQueryParameters({format:a},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:a}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new wE({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return jhe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new ye,this._tileProvider=new Ca({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Ir({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:e.getFeatureInfoFormats??nf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:a$e(this)})}function jhe(e,t,n,i,o,r){let a=e._tileProvider;return Ghe(e,a._resource,r),a.requestImage(t,n,i,o)}function r$e(e,t,n,i,o,r,a){let s=e._tileProvider;return Ghe(e,s._pickFeaturesResource,a),s.pickFeatures(t,n,i,o,r)}Object.defineProperties(nf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},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}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},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}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});nf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};nf.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,a;return l(r)&&(a=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=jhe(this,e,t,n,i,a)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};nf.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,a=l(r)?r.currentInterval:void 0;return r$e(this,e,t,n,i,o,a)};nf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});nf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});nf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new tp("json","application/json")),Object.freeze(new tp("xml","text/xml")),Object.freeze(new tp("text","text/html"))]);function Ghe(e,t,n){let i=e._dimensions,o=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(o)&&t.setTemplateValues(o);else{let r={};l(i)&&(r=It(r,i)),l(o)&&(r=It(r,o)),t.setQueryParameters(r)}}function a$e(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,o,r){return t(r)},tilematrix:function(n,i,o,r){return t(r)},TileRow:function(n,i,o){return o.toString()},tilerow:function(n,i,o){return o.toString()},TileCol:function(n,i,o){return i.toString()},tilecol:function(n,i,o){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function Vhe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var E3=nf;var IE={};IE.defaultApiKey=void 0;IE.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});IE.defaultStreetViewStaticApiKey=void 0;IE.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});IE.getDefaultCredit=function(){return new xt('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Ps=IE;var Hhe=/\/$/;function L0(e){e=e??G.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof ya?e.url:De.createIfNeeded(e.url??Ps.mapTilesApiEndpoint),n=t.getUrlComponent();Hhe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new xt(o)));let r=new Ca({url:t,credit:o,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});r._resource=t,this._imageryProvider=r,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(L0.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}}});L0.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=Whe(e),i=ya._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),o={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},r=await i.fetchJson(),a=r.options.url;return delete r.options.url,r.options={...r.options,...o},qX(a,r,i)};L0.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??Ps.mapTilesApiEndpoint,e.key=e.key??Ps.defaultApiKey;let t=e.overlayLayerType,n=await c$e(e);return new L0({...n,...e,credit:e.credit??Ps.getDefaultCredit()})};L0.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};L0.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};L0.prototype.pickFeatures=function(e,t,n,i,o){};L0.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(s$e(this._resource,this._viewportUrl,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],a=n[o];if(a){let s=new xt(a);r.push(s)}i.set(o,r)}return this._attributionsByLevel=i,i};async function s$e(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(G.EMPTY_OBJECT)}).fetchJson()).copyright}function Whe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,o={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(o.layerTypes=["layerRoadmap"]),l(n)&&(o.mapType="satellite",o.overlay=!0,o.layerTypes=[n]),l(i)&&(o.styles=i),o}async function c$e(e){let{language:t,region:n,key:i,url:o}=e,r=Whe(e),a=o.url??o;Hhe.test(a)||(a+="/");let s=await De.post({url:`${a}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...r,language:t,region:n})});return JSON.parse(s)}var v3=L0;var l$e=/\/$/;function DE(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof ya?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();l$e.test(i)||(i+="/");let o=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=o,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new xt(r)));let a=new Ca({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:r});a._resource=n,this._imageryProvider=a,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(DE.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}}});DE.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};DE.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};DE.prototype.pickFeatures=function(e,t,n,i,o){};DE.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(u$e(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],a=n[o].join(",");if(a){let s=new xt(a);r.push(s)}i.set(o,r)}return this._attributionsByLevel=i,i};async function u$e(e,t,n,i,o){return(await e.getDerivedResource({url:t,queryParameters:{zoom:o,bounds:"-180,-90,180,90"},data:JSON.stringify(G.EMPTY_OBJECT)}).fetchJson()).copyrights}var S3=DE;var f$e=async(e,t,n)=>vx.fromUrl(new ya(t,n)),d$e=async(e,{options:t})=>X_.fromUrl(e,t),h$e=async(e,{options:t})=>h3.fromUrl(e,t),m$e=async(e,{options:t})=>{let n=t.channel;return delete t.channel,y3.fromUrl(e,n,t)},p$e=async(e,{options:t})=>new x3({url:e,...t}),g$e=async(e,{options:t})=>b3.fromUrl(e,t),_$e=async(e,{options:t})=>vx.fromUrl(e,t),A$e=async(e,{options:t})=>new Ca({url:e,...t}),y$e=async(e,{options:t})=>new C3({url:e,...t}),x$e=async(e,{options:t})=>new E3({url:e,...t}),qX=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new ya(t,n),o=(r,a)=>{delete a.externalType,a.url=e;let{options:s}=a;r.setQueryParameters({session:s.session,key:s.key})};return i.refreshCallback=o,new v3({...t.options,url:i})},b$e=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new ya(t,n),o=(r,a)=>{delete a.externalType,a.url=e;let{options:s}=a;r.setQueryParameters({"subscription-key":s["subscription-key"]})};return i.refreshCallback=o,new S3({...t.options,url:i})},T$e={ARCGIS_MAPSERVER:d$e,BING:h$e,GOOGLE_EARTH:m$e,MAPBOX:p$e,SINGLE_TILE:g$e,TMS:_$e,URL_TEMPLATE:A$e,WMS:y$e,WMTS:x$e,GOOGLE_2D_MAPS:qX,AZURE_MAPS:b$e,defaultFactoryCallback:f$e},wD=Object.freeze(T$e);function np(e){e=e??G.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 ye}Object.defineProperties(np.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(){}}});np.fromAssetId=async function(e,t){t=t??G.EMPTY_OBJECT;let n=ya._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=np._endpointCache[i];l(o)||(o=n.fetchJson(),np._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new re(`Cesium ion asset ${e} is not an imagery asset.`);let a=r.externalType,s=wD.defaultFactoryCallback;r=qe(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(a)&&(s=wD[a],!l(s)))throw new re(`Unrecognized Cesium ion imagery type: ${a}`);let u=await s(c,r,n),f=new np(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=ya.getCreditsFromEndpoint(r,n),f._imageryProvider=u,f};np.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};np.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};np.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};np._endpointCache={};var Au=np;var qhe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(qhe);var K_=qhe;function C$e(e){e=e??G.EMPTY_OBJECT;let t=e.style??K_.AERIAL;return Au.fromAssetId(t)}var Q_=C$e;function Ea(){_e.throwInstantiationError()}Object.defineProperties(Ea.prototype,{errorEvent:{get:_e.throwInstantiationError},credit:{get:_e.throwInstantiationError},tilingScheme:{get:_e.throwInstantiationError},hasWaterMask:{get:_e.throwInstantiationError},hasVertexNormals:{get:_e.throwInstantiationError},availability:{get:_e.throwInstantiationError}});var Yhe=[];Ea.getRegularGridIndices=function(e,t){let n=Yhe[e];l(n)||(Yhe[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),$he(e,t,i,0)),i};var Xhe=[];Ea.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Xhe[e];l(n)||(Xhe[e]=n=[]);let i=n[t];if(!l(i)){let o=Ea.getRegularGridIndices(e,t),r=Qhe(e,t),a=r.westIndicesSouthToNorth,s=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var Khe=[];Ea.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Khe[e];l(n)||(Khe[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,a=e*2+t*2,s=Math.max(0,a-4)*6,c=o+a,u=r+s,f=Qhe(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,A=Ue.createTypedArray(c,u);$he(e,t,A,0),Ea.addSkirtIndices(d,p,g,m,o,A,r),i=n[t]={indices:A,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};Ea.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Ea.getSkirtIndexCount=function(e){return(e-4)*2*3};Ea.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Ea.addSkirtIndices=function(e,t,n,i,o,r,a){let s=o;a=w3(e,s,r,a),s+=e.length,a=w3(t,s,r,a),s+=t.length,a=w3(n,s,r,a),s+=n.length,w3(i,s,r,a)};Ea.addSkirtIndicesWithFilledCorners=function(e,t,n,i,o,r,a){Ea.addSkirtIndices(e,t,n,i,o,r,a);let s=Ea.getSkirtVertexCount(e,t,n,i),c=Ea.getSkirtIndexCount(s),u=a+c,f=e[0],d=i[0],p=n[0],g=t[0],m=o,A=m+e.length-1,y=A+1,x=y+t.length-1,b=x+1,T=b+n.length-1,E=T+1,S=E+i.length-1;r[u+0]=f,r[u+1]=m,r[u+2]=x,r[u+3]=g,r[u+4]=y,r[u+5]=T,r[u+6]=p,r[u+7]=b,r[u+8]=S,r[u+9]=d,r[u+10]=E,r[u+11]=A};function Qhe(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),a;for(a=0;a<e;++a)r[a]=a,i[a]=e*t-1-a;for(a=0;a<t;++a)o[a]=(a+1)*e-1,n[a]=(t-a-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function $he(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let a=0;a<e-1;++a){let s=o,c=s+e,u=c+1,f=s+1;n[i++]=s,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function w3(e,t,n,i){let o=e[0],r=e.length;for(let a=1;a<r;++a){let s=e[a];n[i++]=o,n[i++]=s,n[i++]=t,n[i++]=t,n[i++]=s,n[i++]=t+1,o=s,++t}return i}Ea.heightmapTerrainQuality=.25;Ea.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Ea.heightmapTerrainQuality/(t*n)};Ea.prototype.requestTileGeometry=_e.throwInstantiationError;Ea.prototype.getLevelMaximumGeometricError=_e.throwInstantiationError;Ea.prototype.getTileDataAvailable=_e.throwInstantiationError;Ea.prototype.loadTileDataAvailability=_e.throwInstantiationError;var zo=Ea;var I3=`uniform sampler2D u_texture;
  8020. in vec2 v_textureCoordinates;
  8021. void main()
  8022. {
  8023. out_FragColor = texture(u_texture, v_textureCoordinates);
  8024. }
  8025. `;var D3=`in vec4 position;
  8026. in float webMercatorT;
  8027. uniform vec2 u_textureDimensions;
  8028. out vec2 v_textureCoordinates;
  8029. void main()
  8030. {
  8031. v_textureCoordinates = vec2(position.x, webMercatorT);
  8032. gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));
  8033. }
  8034. `;var Jhe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(Jhe);var Vn=Jhe;function PE(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,a=n/2|0,s=i-1;this.parent=e.getImageryFromCache(r,a,s)}this.state=Vn.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}PE.createPlaceholder=function(e){let t=new PE(e,0,0,0);return t.addReference(),t.state=Vn.PLACEHOLDER,t};PE.prototype.addReference=function(){++this.referenceCount};PE.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(),fe(this),0):this.referenceCount};PE.prototype.processStateMachine=function(e,t,n){this.state===Vn.UNLOADED&&!n&&(this.state=Vn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Vn.RECEIVED&&(this.state=Vn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Vn.READY&&t&&!this.texture;(this.state===Vn.TEXTURE_LOADED||i)&&(this.state=Vn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var ID=PE;function YX(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}YX.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};YX.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Vn.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,a;for(;l(r)&&(r.state!==Vn.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==Vn.FAILED&&r.state!==Vn.INVALID&&(a=a||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===Vn.FAILED||i.state===Vn.INVALID?l(a)?(a.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var DD=YX;function Ri(e,t){this._imageryProvider=e,this._readyEvent=new ye,this._errorEvent=new ye,t=t??G.EMPTY_OBJECT,e=e??G.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Ri.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Ri.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Ri.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Ri.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Ri.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Ri.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Ri.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Ri.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??oe.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new DD(ID.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=t.colorToAlphaThreshold??Ri.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Ri.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}}});Ri.DEFAULT_BRIGHTNESS=1;Ri.DEFAULT_CONTRAST=1;Ri.DEFAULT_HUE=0;Ri.DEFAULT_SATURATION=1;Ri.DEFAULT_GAMMA=1;Ri.DEFAULT_SPLIT=Vr.NONE;Ri.DEFAULT_MINIFICATION_FILTER=Vt.LINEAR;Ri.DEFAULT_MAGNIFICATION_FILTER=ti.LINEAR;Ri.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ri.fromProviderAsync=function(e,t){let n=new Ri(void 0,t);return I$e(n,Promise.resolve(e)),n};Ri.fromWorldImagery=function(e){return e=e??G.EMPTY_OBJECT,Ri.fromProviderAsync(Q_({style:e.style}),e)};Ri.prototype.isBaseLayer=function(){return this._isBaseLayer};Ri.prototype.isDestroyed=function(){return!1};Ri.prototype.destroy=function(){return fe(this)};var tme=new oe,Zhe=new oe,XX=new oe,nme=new oe;Ri.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return oe.intersection(e.rectangle,t)};Ri.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 di&&e.rectangle.north<di.MaximumLatitude&&e.rectangle.south>-di.MaximumLatitude,a=oe.intersection(o.rectangle,this._rectangle,tme),s=oe.intersection(e.rectangle,a,Zhe);if(!l(s)){if(!this.isBaseLayer())return!1;let v=a,I=e.rectangle;s=Zhe,I.south>=v.north?s.north=s.south=v.north:I.north<=v.south?s.north=s.south=v.south:(s.south=Math.max(I.south,v.south),s.north=Math.min(I.north,v.north)),I.west>=v.east?s.west=s.east=v.east:I.east<=v.west?s.west=s.east=v.west:(s.west=Math.max(I.west,v.west),s.east=Math.min(I.east,v.east))}let c=0;s.south>0?c=s.south:s.north<0&&(c=s.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=S$e(this,f,c);d=Math.max(0,d);let p=o.maximumLevel;if(d>p&&(d=p),l(o.minimumLevel)){let v=o.minimumLevel;d<v&&(d=v)}let g=o.tilingScheme,m=g.positionToTileXY(oe.northwest(s),d),A=g.positionToTileXY(oe.southeast(s),d),y=e.rectangle.width/512,x=e.rectangle.height/512,b=g.tileXYToRectangle(m.x,m.y,d);Math.abs(b.south-e.rectangle.north)<x&&m.y<A.y&&++m.y,Math.abs(b.east-e.rectangle.west)<y&&m.x<A.x&&++m.x;let T=g.tileXYToRectangle(A.x,A.y,d);Math.abs(T.north-e.rectangle.south)<x&&A.y>m.y&&--A.y,Math.abs(T.west-e.rectangle.east)<y&&A.x>m.x&&--A.x;let E=oe.clone(e.rectangle,nme),S=g.tileXYToRectangle(m.x,m.y,d),w=oe.intersection(S,a,XX),P;r?(g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(w,w),g.rectangleToNativeRectangle(a,a),P=g.tileXYToNativeRectangle.bind(g),y=E.width/512,x=E.height/512):P=g.tileXYToRectangle.bind(g);let O,B=0,L=1,_;!this.isBaseLayer()&&Math.abs(w.west-E.west)>=y&&(B=Math.min(1,(w.west-E.west)/E.width)),!this.isBaseLayer()&&Math.abs(w.north-E.north)>=x&&(L=Math.max(0,(w.north-E.south)/E.height));let C=L;for(let v=m.x;v<=A.x;v++)if(O=B,S=P(v,m.y,d),w=oe.simpleIntersection(S,a,XX),!!l(w)){B=Math.min(1,(w.east-E.west)/E.width),v===A.x&&(this.isBaseLayer()||Math.abs(w.east-E.east)<y)&&(B=1),L=C;for(let I=m.y;I<=A.y;I++){if(_=L,S=P(v,I,d),w=oe.simpleIntersection(S,a,XX),!l(w))continue;L=Math.max(0,(w.south-E.south)/E.height),I===A.y&&(this.isBaseLayer()||Math.abs(w.south-E.south)<x)&&(L=0);let M=new se(O,L,B,_),N=this.getImageryFromCache(v,I,d);i.imagery.splice(n,0,new DD(N,M,r)),++n}}return!0};Ri.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,tme),i=c.rectangleToNativeRectangle(i,nme)}let o=i.width,r=i.height,a=o/n.width,s=r/n.height;return new se(a*(i.west-n.west)/o,s*(i.south-n.south)/r,a,s)};Ri.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(a){if(!l(a))return o();e.image=a,e.state=Vn.RECEIVED,e.request=void 0,Qo.reportSuccess(n._requestImageError)}function o(a){if(e.request.state===Ai.CANCELLED){e.state=Vn.UNLOADED,e.request=void 0;return}e.state=Vn.FAILED,e.request=void 0;let s=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Qo.reportError(n._requestImageError,t,t.errorEvent,s,e.x,e.y,e.level,a),n._requestImageError.retry&&r()}function r(){let a=new Cr({throttle:!1,throttleByServer:!0,type:ts.IMAGERY});e.request=a,e.state=Vn.TRANSITIONING;let s=t.requestImage(e.x,e.y,e.level,a);if(!l(s)){e.state=Vn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),s.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Ri.prototype._createTextureWebGL=function(e,t){let n=new jt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?Xe.RGBA:Xe.RGB,sampler:n})};Ri.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=Vn.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=Vn.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof di?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=Vn.TEXTURE_LOADED};function eme(e,t,n){return`${e}:${t}:${n}`}Ri.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Vt.LINEAR&&i===ti.LINEAR&&!Xe.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=Vt.LINEAR_MIPMAP_LINEAR;let r=Mt.maximumTextureFilterAnisotropy,a=Math.min(r,this._maximumAnisotropy??r),s=eme(n,i,a),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[s];l(u)||(u=c[s]=new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:a})),t.generateMipmap(rh.NICEST),t.sampler=u}else{let r=eme(n,i,0),a=e.cache.imageryLayerNonMipmapSamplers;l(a)||(a={},e.cache.imageryLayerNonMipmapSamplers=a);let s=a[r];l(s)||(s=a[r]=new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=s}};Ri.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Hi)&&o.width/i.width>1e-5){let a=this;t.addReference();let s=new Kl({persists:!0,owner:this,preExecute:function(c){v$e(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,a._finalizeReprojectTexture(r,c),t.state=Vn.READY,t.releaseReference()},canceled:function(){t.state=Vn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(s)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=Vn.READY};Ri.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};Ri.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ri.prototype.getImageryFromCache=function(e,t,n,i){let o=ime(e,t,n),r=this._imageryCache[o];return l(r)||(r=new ID(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ri.prototype.removeImageryFromCache=function(e){let t=ime(e.x,e.y,e.level);delete this._imageryCache[t]};function ime(e,t,n){return JSON.stringify([e,t,n])}var P3={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new z,texture:void 0},E$e=cn.supportsTypedArrays()?new Float32Array(128):void 0;function v$e(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 y=new Float32Array(256),x=0;for(let w=0;w<64;++w){let P=w/63;y[x++]=0,y[x++]=P,y[x++]=1,y[x++]=P}let b={position:0,webMercatorT:1},T=zo.getRegularGridIndices(2,64),E=Ke.createIndexBuffer({context:t,typedArray:T,usage:Oe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});o.vertexArray=new Fn({context:t,attributes:[{index:b.position,vertexBuffer:Ke.createVertexBuffer({context:t,typedArray:y,usage:Oe.STATIC_DRAW}),componentsPerAttribute:2},{index:b.webMercatorT,vertexBuffer:Ke.createVertexBuffer({context:t,sizeInBytes:512,usage:Oe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let S=new He({sources:[D3]});o.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:S,fragmentShaderSource:I3,attributeLocations:b}),o.sampler=new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.LINEAR,magnificationFilter:ti.LINEAR})}n.sampler=o.sampler;let r=n.width,a=n.height;P3.textureDimensions.x=r,P3.textureDimensions.y=a,P3.texture=n;let s=Math.sin(i.south),c=.5*Math.log((1+s)/(1-s));s=Math.sin(i.north);let f=1/(.5*Math.log((1+s)/(1-s))-c),d=new Dt({context:t,width:r,height:a,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(r)&&D.isPowerOfTwo(a)&&d.generateMipmap(rh.NICEST);let p=i.south,g=i.north,m=E$e,A=0;for(let y=0;y<64;++y){let x=y/63,b=D.lerp(p,g,x);s=Math.sin(b);let E=(.5*Math.log((1+s)/(1-s))-c)*f;m[A++]=E,m[A++]=E}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=d,e.uniformMap=P3,e.vertexArray=o.vertexArray}function S$e(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,a=e._imageryProvider.tilingScheme.projection instanceof Hi?1:Math.cos(n),s=o.rectangle,u=r.maximumRadius*s.width*a/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function w$e(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function I$e(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){w$e(e._errorEvent,i)}}var va=Ri;var KX=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},R3=KX;var QX=class{constructor(t,n,i,o){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=o??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},PD=QX;var D$e=new oe,ome=new oe,P$e=new oe,R$e=new oe,O$e=new oe,M$e=new oe,$X=class e{constructor(t,n,i,o,r){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=o,this._imagery=r}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let o=n.imageryProvider,r=e._clampImageryLevel(o,i),a=oe.intersection(o.rectangle,n.rectangle,D$e),s=o.tilingScheme,c=e._computeImageryRange(t,a,s,r),u=R$e;s.rectangleToNativeRectangle(t,u);let f=O$e;s.rectangleToNativeRectangle(a,f);let d=(g,m,A)=>{let y=s.tileXYToRectangle(g,m,A),x=oe.intersection(y,a,P$e);if(!l(x))return;let b=M$e;return s.rectangleToNativeRectangle(x,b),b};return e._computeImageryCoverages(n,c,r,u,d)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,o=t.maximumLevel??Number.POSITIVE_INFINITY,r=Math.min(o-1,Math.max(i,n));return Math.floor(r)}static _computeImageryRange(t,n,i,o){let r=e._computeOverlappedRectangle(t,n),a=i.positionToTileXY(oe.northwest(r),o),s=i.positionToTileXY(oe.southeast(r),o),c=new PD;c.minX=a.x,c.minY=a.y,c.maxX=s.x,c.maxY=s.y;let u=t.width/512,f=t.height/512,d=i.tileXYToRectangle(c.minX,c.minY,o);Math.abs(d.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(d.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,o);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new oe),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=oe.intersection(t,n,ome);return l(i)?i:e._clampRectangle(t,n,ome)}static _computeImageryCoverages(t,n,i,o,r){let a=[];for(let s=n.minX;s<=n.maxX;s++){let c=r(s,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=r(s,u,i);if(!l(f))continue;let d=e._localizeToCartesianRectangle(f,o,void 0),p=t.getImageryFromCache(s,u,i),g=new e(s,u,i,d,p);a.push(g)}}return a}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new PD);let o=1/n.width,r=1/n.height;return i.minX=(t.west-n.west)*o,i.minY=(t.south-n.south)*r,i.maxX=(t.east-n.west)*o,i.maxY=(t.north-n.south)*r,i}},RD=$X;var JX=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,o=t.cartographicBoundingRectangle,r=t.numPositions;return e._createTextureCoordinates(i,r,o,n)}static _createTextureCoordinates(t,n,i,o){let r=new Je;Je.fromRectangle(i,o,r);let a=e.createProjectedPositions(t,o),s=e.computeTexCoords(a,r);return e.createTypedArrayFromCartesians2(n,s)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let o=Is.readAttributeAsTypedArray(t),r=t.type,a=Ft.getNumberOfComponents(r),s=e.createIterableCartesian3FromTypedArray(o,a),c=e.transformCartesians3(s,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,o=t.length/n;return{[Symbol.iterator]:function*(){for(let a=0;a<o;a++)i.x=t[a*n+0],i.y=t[a*n+1],i.z=t[a*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let o of t)yield n(o)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new oe);let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(let s of t)i=Math.max(i,s.latitude),o=Math.min(o,s.latitude),r=Math.max(r,s.longitude),a=Math.min(a,s.longitude);return n.north=i,n.south=o,n.east=r,n.west=a,n}static transformCartesians3(t,n){let i=new h;return e.map(t,r=>(R.multiplyByPoint(n,r,i),i))}static transformToCartographic(t,n){let i=new de;return e.map(t,r=>(n.cartesianToCartographic(r,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,r=>(n.project(r,i),i))}static computeTexCoords(t,n){let i=new z,o=1/n.width,r=1/n.height;return e.map(t,s=>{let c=(s.x-n.x)*o,u=(s.y-n.y)*r,f=Math.min(Math.max(c,0),1),d=Math.min(Math.max(u,0),1);return i.x=f,i.y=d,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),o=0;for(let r of n)i[o*2+0]=r.x,i[o*2+1]=r.y,o++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:it.TEXCOORD,setIndex:0,componentDatatype:Y.FLOAT,type:Ft.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new z(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},RE=JX;var ZX=class{constructor(t,n,i,o){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=o}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},O3=ZX;var eK=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new R,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let o=this._model.imageryLayers.indexOf(t);if(o===-1)throw new _e("Imagery layer is not part of the model");let r=this._coveragesPerLayer;if(!l(r))throw new _e("The coveragesPerLayer have not been computed yet");return r[o]}update(t){let n=this._model,r=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==r&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=r),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=t[o];this._deleteCoverages(r,a)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let o=0;o<i;o++)n[o].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let r=n[o],a=Ke.createVertexBuffer({context:t,typedArray:r.typedArray,usage:Oe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let o=t[i];l(o)&&(l(o.buffer)&&(o.buffer.isDestroyed()||o.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!R.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,o=e._obtainPrimitivePositionAttribute(i.primitive),r=o.count,a=e._computePrimitivePositionTransform(t,n,void 0),s=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=RE.createCartographicPositions(o,a,d),g=RE.computeCartographicBoundingRectangle(p),m=new O3(p,r,g,d);s.push(m)}return R.clone(t.modelMatrix,this._mappedPositionsModelMatrix),s}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let o=0;o<i;o++){let r=t.get(o),a=e._getEllipsoid(r);n.add(a)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),o=[...new Set(i)];return this._createImageryTexCoordAttributes(o)}static _extractProjections(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t.get(o),a=e._getProjection(r);n.push(a)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t[o],a=r.ellipsoid,s=this.mappedPositionsForEllipsoid(a),c=RE.createTextureCoordinatesAttributeForMappedPositions(s,r);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],o=this._model.imageryLayers,r=o.length;for(let a=0;a<r;a++){let s=o.get(a),c=this._computeCoverage(s);t.push(c),n.push(s)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,o=this._computeImageryLevel(t,i);return RD.createImageryCoverages(i,t,o)}_computeImageryLevel(t,n){let i=t.imageryProvider,r=i.tilingScheme.rectangle,a=1,s=n.width,c=r.width;n.height>n.width&&(s=n.height,c=r.height);let u=Math.log2(a*c/s);return RD._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,o=i.length,r=!0;for(let a=0;a<o;a++){let s=i[a],c=s.length;for(let u=0;u<c;u++){let d=s[u].imagery;d.state===Vn.READY||d.state===Vn.FAILED||d.state===Vn.INVALID||(r=!1,d.processStateMachine(t,!1,!1))}}r&&n.resetDrawCommands(),this._allImageriesReady=r}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new _e("The mappedPositions have not been computed yet");let i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.ellipsoid===t)return r}throw new _e(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new _e("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),fe(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new R);let o=t.sceneGraph;return R.clone(R.IDENTITY,i),R.multiply(i,t.modelMatrix,i),R.multiply(i,o.components.transform,i),R.multiply(i,o.axisCorrectionMatrix,i),R.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=mt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new _e("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},OE=eK;var tK=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},M3=tK;var B$e=!1,L$e=new oe,N$e=new oe,nK=class e{static process(t,n,i){let o=t.model,r=n.modelPrimitiveImagery;if(!l(r)||!r.ready)return;let a=o.imageryLayers,s=OE._extractProjections(a),c=[...new Set(s)],u=e._computeIndexMapping(s,c),f=e._createImageryInputs(a,r,u);if(f.length===0)return;f.length>10&&(_t("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(r,t);let d=[];for(let p=0;p<a.length;p++)d.push(a.get(p));e._processImageryInputs(d,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let o of i)e._addImageryTexCoordAttributeToRenderResources(o,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Ft.getNumberOfComponents(t.type),o={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(o)}static _processImageryInputs(t,n,i,o){let r=n.shaderBuilder,a=e._computeImageryFlags(t),s=i.length;r.addDefine("HAS_IMAGERY"),r.addDefine(`IMAGERY_TEXTURE_UNITS ${s}`),e._addAttributes(r,o),e._defineUniforms(r,a),e._buildSampleAndBlendFunction(r,a),e._createMainImageryShader(r,i,a);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let r=0;r<n;r++)t.addAttribute("vec2",`a_imagery_texCoord_${r}`),t.addVarying("vec2",`v_imagery_texCoord_${r}`);let i="initializeImageryAttributes",o=`void ${i}()`;t.addFunction(i,o,he.VERTEX);for(let r=0;r<n;r++)t.addFunctionLines(i,[`v_imagery_texCoord_${r} = a_imagery_texCoord_${r};`])}static _computeImageryFlags(t){let n=new R3;for(let i=0;i<t.length;i++){let o=t[i];n.alpha|=o.alpha!==1,n.brightness|=o.brightness!==va.DEFAULT_BRIGHTNESS,n.contrast|=o.contrast!==va.DEFAULT_CONTRAST,n.hue|=o.hue!==va.DEFAULT_HUE,n.saturation|=o.saturation!==va.DEFAULT_SATURATION,n.gamma|=o.gamma!==va.DEFAULT_GAMMA;let r=l(o.colorToAlpha)&&o.colorToAlphaThreshold>0;n.colorToAlpha|=r}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let o=i.join(", ");return`vec4 ${n}(${o})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",o=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,o,he.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),B$e&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let o=`v_imagery_texCoord_${n}`,r=[];return r.push("blendedBaseColor"),r.push(`u_imageryTextures[${i}]`),r.push(`${o}`),r.push(`u_imageryTextureCoordinateRectangle[${i}]`),r.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&r.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&r.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&r.push(`u_imageryTextureContrast[${i}]`),t.hue&&r.push(`u_imageryTextureHue[${i}]`),t.saturation&&r.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&r.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&r.push(`u_imageryTextureColorToAlpha[${i}]`),r.join(", ")}static _createMainImageryShader(t,n,i){let o="blendBaseColorWithImagery";t.addFunction(o,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",he.FRAGMENT),t.addFunctionLines(o,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let r=0;r<n.length;r++){let s=n[r].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,s,r);t.addFunctionLines(o,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(o,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let o=0;o<n;o++){let r=t[o],a=r.imageryLayer,s=r.texture,c=r.textureCoordinateRectangle,u=r.textureTranslationAndScale;i.imageryTextures[o]=s,i.imageryTextureTranslationAndScale[o]=u,i.imageryTextureCoordinateRectangle[o]=c,i.imageryTextureAlpha[o]=a.alpha,i.imageryTextureBrightness[o]=a.brightness,i.imageryTextureContrast[o]=a.contrast,i.imageryTextureHue[o]=a.hue,i.imageryTextureSaturation[o]=a.saturation,i.imageryTextureOneOverGamma[o]=1/a.gamma;let f=i.imageryTextureColorToAlpha[o];if(l(f)||(f=new se,i.imageryTextureColorToAlpha[o]=f),l(a.colorToAlpha)&&a.colorToAlphaThreshold>0){let p=a.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=a.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let o=`u_${i}`;t[o]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let o=[];for(let r=0;r<t.length;r++){let a=t.get(r);if(!a.show)continue;let s=i[r],u=n.mappedPositionsForImageryLayer(a).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(a);for(let d=0;d<f.length;d++){let p=f[d],g=e._createImageryInput(a,p,u,s);l(g)&&o.push(g)}}return o}static _createImageryInput(t,n,i,o){let r=n.imagery;if(r.state===Vn.FAILED||r.state===Vn.INVALID)return;let a=r.textureWebMercator;if(!l(a)&&(a=r.texture,!l(a))){r.state===Vn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${r.state}`);return}let s=e._computeTextureTranslationAndScale(t,i,r.rectangle),c=n.textureCoordinateRectangle,u=new se(c.minX,c.minY,c.maxX,c.maxY);return new M3(t,a,s,u,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,L$e),a=o.rectangleToNativeRectangle(i,N$e);return e._computeTextureTranslationAndScaleFromNative(r,a)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,o=1/n.height,r=t.west-n.west,a=t.south-n.south,s=r*i,c=a*o,u=t.width*i,f=t.height*o;return new se(s,c,u,f)}static _computeIndexMapping(t,n){let i=[],o=t.length;for(let r=0;r<o;r++){let a=t[r],s=n.indexOf(a);i.push(s)}return i}},B3=nK;var L3=`#ifdef USE_IBL_LIGHTING
  8035. vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
  8036. {
  8037. #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
  8038. // Environment maps were provided, use them for IBL
  8039. vec3 viewDirection = -normalize(position);
  8040. vec3 iblColor = textureIBL(viewDirection, normal, material);
  8041. return iblColor;
  8042. #endif
  8043. return vec3(0.0);
  8044. }
  8045. #endif
  8046. #ifdef USE_CLEARCOAT
  8047. vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
  8048. {
  8049. vec3 viewDirection = -normalize(position);
  8050. vec3 halfwayDirection = normalize(viewDirection + lightDirection);
  8051. vec3 normal = material.clearcoatNormal;
  8052. float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0);
  8053. // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5.
  8054. vec3 f0 = vec3(0.04);
  8055. vec3 f90 = vec3(1.0);
  8056. // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h).
  8057. // This is to make it energy conserving with a simple layering function.
  8058. float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
  8059. vec3 F = fresnelSchlick2(f0, f90, NdotV);
  8060. // compute specular reflection from direct lighting
  8061. float roughness = material.clearcoatRoughness;
  8062. float alphaRoughness = roughness * roughness;
  8063. float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);
  8064. vec3 directReflection = F * directStrength * NdotL;
  8065. vec3 color = lightColorHdr * directReflection;
  8066. #ifdef SPECULAR_IBL
  8067. // Find the direction in which to sample the environment map
  8068. vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
  8069. vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
  8070. color += iblColor * material.occlusion;
  8071. #endif
  8072. float clearcoatFactor = material.clearcoatFactor;
  8073. vec3 clearcoatColor = color * clearcoatFactor;
  8074. // Dim base layer based on transmission loss through clearcoat
  8075. return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor;
  8076. }
  8077. #endif
  8078. #if defined(LIGHTING_PBR) && defined(HAS_NORMALS)
  8079. vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position)
  8080. {
  8081. #ifdef USE_CUSTOM_LIGHT_COLOR
  8082. vec3 lightColorHdr = model_lightColorHdr;
  8083. #else
  8084. vec3 lightColorHdr = czm_lightColorHdr;
  8085. #endif
  8086. vec3 viewDirection = -normalize(position);
  8087. vec3 normal = material.normalEC;
  8088. vec3 lightDirection = normalize(czm_lightDirectionEC);
  8089. vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material);
  8090. vec3 directColor = lightColorHdr * directLighting;
  8091. // Accumulate colors from base layer
  8092. vec3 color = directColor + material.emissive;
  8093. #ifdef USE_IBL_LIGHTING
  8094. color += computeIBL(position, normal, lightDirection, lightColorHdr, material);
  8095. #endif
  8096. #ifdef USE_CLEARCOAT
  8097. color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material);
  8098. #endif
  8099. return color;
  8100. }
  8101. #endif
  8102. /**
  8103. * Compute the material color under the current lighting conditions.
  8104. * All other material properties are passed through so further stages
  8105. * have access to them.
  8106. *
  8107. * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS}
  8108. * @param {ProcessedAttributes} attributes
  8109. */
  8110. void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
  8111. {
  8112. #ifdef LIGHTING_PBR
  8113. #ifdef HAS_NORMALS
  8114. vec3 color = computePbrLighting(material, attributes.positionEC);
  8115. #else
  8116. vec3 color = material.diffuse * material.occlusion + material.emissive;
  8117. #endif
  8118. // In HDR mode, the frame buffer is in linear color space. The
  8119. // post-processing stages (see PostProcessStageCollection) will handle
  8120. // tonemapping. However, if HDR is not enabled, we must tonemap else large
  8121. // values may be clamped to 1.0
  8122. #ifndef HDR
  8123. color = czm_pbrNeutralTonemapping(color);
  8124. #endif
  8125. #else // unlit
  8126. vec3 color = material.diffuse;
  8127. #endif
  8128. #ifdef HAS_POINT_CLOUD_COLOR_STYLE
  8129. // The colors resulting from point cloud styles are adjusted differently.
  8130. color = czm_gammaCorrect(color);
  8131. #elif !defined(HDR)
  8132. // If HDR is not enabled, the frame buffer stores sRGB colors rather than
  8133. // linear colors so the linear value must be converted.
  8134. color = czm_linearToSrgb(color);
  8135. #endif
  8136. material.diffuse = color;
  8137. }
  8138. `;var rme={UNLIT:0,PBR:1};Object.freeze(rme);var N0=rme;var ame={name:"LightingPipelineStage"};ame.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,he.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",he.FRAGMENT);let a=e.uniformMap;a.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===N0.PBR?o.addDefine("LIGHTING_PBR",void 0,he.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,he.FRAGMENT),o.addFragmentLines(L3)};var N3=ame;var F3=`// If the style color is white, it implies the feature has not been styled.
  8139. bool isDefaultStyleColor(vec3 color)
  8140. {
  8141. return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
  8142. }
  8143. vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
  8144. {
  8145. vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
  8146. vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
  8147. return color;
  8148. }
  8149. #ifdef HAS_NORMAL_TEXTURE
  8150. vec2 getNormalTexCoords()
  8151. {
  8152. vec2 texCoord = TEXCOORD_NORMAL;
  8153. #ifdef HAS_NORMAL_TEXTURE_TRANSFORM
  8154. texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform);
  8155. #endif
  8156. return texCoord;
  8157. }
  8158. #endif
  8159. #if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE)
  8160. vec3 computeTangent(in vec3 position, in vec2 normalTexCoords)
  8161. {
  8162. vec2 tex_dx = dFdx(normalTexCoords);
  8163. vec2 tex_dy = dFdy(normalTexCoords);
  8164. float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y;
  8165. vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position);
  8166. return tangent / determinant;
  8167. }
  8168. #endif
  8169. #ifdef USE_ANISOTROPY
  8170. struct NormalInfo {
  8171. vec3 tangent;
  8172. vec3 bitangent;
  8173. vec3 normal;
  8174. vec3 geometryNormal;
  8175. };
  8176. NormalInfo getNormalInfo(ProcessedAttributes attributes)
  8177. {
  8178. vec3 geometryNormal = attributes.normalEC;
  8179. #ifdef HAS_NORMAL_TEXTURE
  8180. vec2 normalTexCoords = getNormalTexCoords();
  8181. #endif
  8182. #ifdef HAS_BITANGENTS
  8183. vec3 tangent = attributes.tangentEC;
  8184. vec3 bitangent = attributes.bitangentEC;
  8185. #else // Assume HAS_NORMAL_TEXTURE
  8186. vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords);
  8187. tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent));
  8188. vec3 bitangent = normalize(cross(geometryNormal, tangent));
  8189. #endif
  8190. #ifdef HAS_NORMAL_TEXTURE
  8191. mat3 tbn = mat3(tangent, bitangent, geometryNormal);
  8192. vec3 normalSample;
  8193. #if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
  8194. #ifdef HAS_NORMAL_TEXTURE_TRANSFORM
  8195. normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb;
  8196. #else
  8197. normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb;
  8198. #endif
  8199. #else
  8200. normalSample = texture(u_normalTexture, normalTexCoords).rgb;
  8201. #endif
  8202. normalSample = 2.0 * normalSample - 1.0;
  8203. #ifdef HAS_NORMAL_TEXTURE_SCALE
  8204. normalSample.xy *= u_normalTextureScale;
  8205. #endif
  8206. vec3 normal = normalize(tbn * normalSample);
  8207. #else
  8208. vec3 normal = geometryNormal;
  8209. #endif
  8210. #ifdef HAS_DOUBLE_SIDED_MATERIAL
  8211. if (czm_backFacing()) {
  8212. tangent *= -1.0;
  8213. bitangent *= -1.0;
  8214. normal *= -1.0;
  8215. geometryNormal *= -1.0;
  8216. }
  8217. #endif
  8218. NormalInfo normalInfo;
  8219. normalInfo.tangent = tangent;
  8220. normalInfo.bitangent = bitangent;
  8221. normalInfo.normal = normal;
  8222. normalInfo.geometryNormal = geometryNormal;
  8223. return normalInfo;
  8224. }
  8225. #endif
  8226. #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
  8227. vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
  8228. {
  8229. vec2 normalTexCoords = getNormalTexCoords();
  8230. // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
  8231. #ifdef HAS_BITANGENTS
  8232. vec3 t = attributes.tangentEC;
  8233. vec3 b = attributes.bitangentEC;
  8234. #else
  8235. vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
  8236. t = normalize(t - geometryNormal * dot(geometryNormal, t));
  8237. vec3 b = normalize(cross(geometryNormal, t));
  8238. #endif
  8239. mat3 tbn = mat3(t, b, geometryNormal);
  8240. vec3 normalSample;
  8241. #if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
  8242. #ifdef HAS_NORMAL_TEXTURE_TRANSFORM
  8243. normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb;
  8244. #else
  8245. normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb;
  8246. #endif
  8247. #else
  8248. normalSample = texture(u_normalTexture, normalTexCoords).rgb;
  8249. #endif
  8250. normalSample = 2.0 * normalSample - 1.0;
  8251. #ifdef HAS_NORMAL_TEXTURE_SCALE
  8252. normalSample.xy *= u_normalTextureScale;
  8253. #endif
  8254. return normalize(tbn * normalSample);
  8255. }
  8256. #endif
  8257. #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
  8258. vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
  8259. {
  8260. vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;
  8261. #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM
  8262. normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));
  8263. #endif
  8264. // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
  8265. #ifdef HAS_BITANGENTS
  8266. vec3 t = attributes.tangentEC;
  8267. vec3 b = attributes.bitangentEC;
  8268. #else
  8269. vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
  8270. t = normalize(t - geometryNormal * dot(geometryNormal, t));
  8271. vec3 b = normalize(cross(geometryNormal, t));
  8272. #endif
  8273. mat3 tbn = mat3(t, b, geometryNormal);
  8274. vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;
  8275. normalSample = 2.0 * normalSample - 1.0;
  8276. #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE
  8277. normalSample.xy *= u_clearcoatNormalTextureScale;
  8278. #endif
  8279. return normalize(tbn * normalSample);
  8280. }
  8281. #endif
  8282. #ifdef HAS_NORMALS
  8283. vec3 computeNormal(ProcessedAttributes attributes)
  8284. {
  8285. // Geometry normal. This is already normalized
  8286. vec3 normal = attributes.normalEC;
  8287. #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
  8288. normal = getNormalFromTexture(attributes, normal);
  8289. #endif
  8290. #ifdef HAS_DOUBLE_SIDED_MATERIAL
  8291. if (czm_backFacing()) {
  8292. normal = -normal;
  8293. }
  8294. #endif
  8295. return normal;
  8296. }
  8297. #endif
  8298. #ifdef HAS_BASE_COLOR_TEXTURE
  8299. vec4 getBaseColorFromTexture()
  8300. {
  8301. vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
  8302. #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
  8303. baseColorTexCoords = czm_computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
  8304. #endif
  8305. vec4 baseColorWithAlpha;
  8306. #if defined(HAS_BASE_COLOR_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
  8307. #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
  8308. baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams, u_baseColorTextureTransform));
  8309. #else
  8310. baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams));
  8311. #endif
  8312. #else
  8313. baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));
  8314. #endif
  8315. #ifdef HAS_BASE_COLOR_FACTOR
  8316. baseColorWithAlpha *= u_baseColorFactor;
  8317. #endif
  8318. return baseColorWithAlpha;
  8319. }
  8320. #endif
  8321. #ifdef HAS_EMISSIVE_TEXTURE
  8322. vec3 getEmissiveFromTexture()
  8323. {
  8324. vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
  8325. #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
  8326. emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
  8327. #endif
  8328. vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
  8329. #ifdef HAS_EMISSIVE_FACTOR
  8330. emissive *= u_emissiveFactor;
  8331. #endif
  8332. return emissive;
  8333. }
  8334. #endif
  8335. #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
  8336. void setSpecularGlossiness(inout czm_modelMaterial material)
  8337. {
  8338. #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
  8339. vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
  8340. #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
  8341. specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
  8342. #endif
  8343. vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
  8344. vec3 specular = specularGlossiness.rgb;
  8345. float glossiness = specularGlossiness.a;
  8346. #ifdef HAS_LEGACY_SPECULAR_FACTOR
  8347. specular *= u_legacySpecularFactor;
  8348. #endif
  8349. #ifdef HAS_GLOSSINESS_FACTOR
  8350. glossiness *= u_glossinessFactor;
  8351. #endif
  8352. #else
  8353. #ifdef HAS_LEGACY_SPECULAR_FACTOR
  8354. vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0));
  8355. #else
  8356. vec3 specular = vec3(1.0);
  8357. #endif
  8358. #ifdef HAS_GLOSSINESS_FACTOR
  8359. float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
  8360. #else
  8361. float glossiness = 1.0;
  8362. #endif
  8363. #endif
  8364. #ifdef HAS_DIFFUSE_TEXTURE
  8365. vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
  8366. #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
  8367. diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
  8368. #endif
  8369. vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
  8370. #ifdef HAS_DIFFUSE_FACTOR
  8371. diffuse *= u_diffuseFactor;
  8372. #endif
  8373. #elif defined(HAS_DIFFUSE_FACTOR)
  8374. vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
  8375. #else
  8376. vec4 diffuse = vec4(1.0);
  8377. #endif
  8378. material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));
  8379. // the specular glossiness extension's alpha overrides anything set
  8380. // by the base material.
  8381. material.alpha = diffuse.a;
  8382. material.specular = specular;
  8383. // glossiness is the opposite of roughness, but easier for artists to use.
  8384. material.roughness = 1.0 - glossiness;
  8385. }
  8386. #elif defined(LIGHTING_PBR)
  8387. float setMetallicRoughness(inout czm_modelMaterial material)
  8388. {
  8389. #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
  8390. vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
  8391. #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
  8392. metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
  8393. #endif
  8394. vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
  8395. float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
  8396. float roughness = clamp(metallicRoughness.g, 0.0, 1.0);
  8397. #ifdef HAS_METALLIC_FACTOR
  8398. metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
  8399. #endif
  8400. #ifdef HAS_ROUGHNESS_FACTOR
  8401. roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);
  8402. #endif
  8403. #else
  8404. #ifdef HAS_METALLIC_FACTOR
  8405. float metalness = clamp(u_metallicFactor, 0.0, 1.0);
  8406. #else
  8407. float metalness = 1.0;
  8408. #endif
  8409. #ifdef HAS_ROUGHNESS_FACTOR
  8410. float roughness = clamp(u_roughnessFactor, 0.0, 1.0);
  8411. #else
  8412. float roughness = 1.0;
  8413. #endif
  8414. #endif
  8415. // dielectrics use f0 = 0.04, metals use albedo as f0
  8416. const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
  8417. vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);
  8418. material.specular = f0;
  8419. // diffuse only applies to dielectrics.
  8420. material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);
  8421. // This is perceptual roughness. The square of this value is used for direct lighting
  8422. material.roughness = roughness;
  8423. return metalness;
  8424. }
  8425. #ifdef USE_SPECULAR
  8426. void setSpecular(inout czm_modelMaterial material, in float metalness)
  8427. {
  8428. #ifdef HAS_SPECULAR_TEXTURE
  8429. vec2 specularTexCoords = TEXCOORD_SPECULAR;
  8430. #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM
  8431. specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform);
  8432. #endif
  8433. float specularWeight = texture(u_specularTexture, specularTexCoords).a;
  8434. #ifdef HAS_SPECULAR_FACTOR
  8435. specularWeight *= u_specularFactor;
  8436. #endif
  8437. #else
  8438. #ifdef HAS_SPECULAR_FACTOR
  8439. float specularWeight = u_specularFactor;
  8440. #else
  8441. float specularWeight = 1.0;
  8442. #endif
  8443. #endif
  8444. #ifdef HAS_SPECULAR_COLOR_TEXTURE
  8445. vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR;
  8446. #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM
  8447. specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform);
  8448. #endif
  8449. vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb;
  8450. vec3 specularColorFactor = czm_srgbToLinear(specularColorSample);
  8451. #ifdef HAS_SPECULAR_COLOR_FACTOR
  8452. specularColorFactor *= u_specularColorFactor;
  8453. #endif
  8454. #else
  8455. #ifdef HAS_SPECULAR_COLOR_FACTOR
  8456. vec3 specularColorFactor = u_specularColorFactor;
  8457. #else
  8458. vec3 specularColorFactor = vec3(1.0);
  8459. #endif
  8460. #endif
  8461. material.specularWeight = specularWeight;
  8462. vec3 f0 = material.specular;
  8463. vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0));
  8464. material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness);
  8465. }
  8466. #endif
  8467. #ifdef USE_ANISOTROPY
  8468. void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo)
  8469. {
  8470. mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x);
  8471. float anisotropyStrength = u_anisotropy.z;
  8472. vec2 direction = vec2(1.0, 0.0);
  8473. #ifdef HAS_ANISOTROPY_TEXTURE
  8474. vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY;
  8475. #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM
  8476. anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform);
  8477. #endif
  8478. vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb;
  8479. direction = anisotropySample.rg * 2.0 - vec2(1.0);
  8480. anisotropyStrength *= anisotropySample.b;
  8481. #endif
  8482. direction = rotation * direction;
  8483. mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal);
  8484. vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0));
  8485. vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT);
  8486. material.anisotropicT = anisotropicT;
  8487. material.anisotropicB = anisotropicB;
  8488. material.anisotropyStrength = anisotropyStrength;
  8489. }
  8490. #endif
  8491. #ifdef USE_CLEARCOAT
  8492. void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes)
  8493. {
  8494. #ifdef HAS_CLEARCOAT_TEXTURE
  8495. vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT;
  8496. #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM
  8497. clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);
  8498. #endif
  8499. float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;
  8500. #ifdef HAS_CLEARCOAT_FACTOR
  8501. clearcoatFactor *= u_clearcoatFactor;
  8502. #endif
  8503. #else
  8504. #ifdef HAS_CLEARCOAT_FACTOR
  8505. float clearcoatFactor = u_clearcoatFactor;
  8506. #else
  8507. // PERFORMANCE_IDEA: this case should turn the whole extension off
  8508. float clearcoatFactor = 0.0;
  8509. #endif
  8510. #endif
  8511. #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE
  8512. vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;
  8513. #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM
  8514. clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);
  8515. #endif
  8516. float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;
  8517. #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
  8518. clearcoatRoughness *= u_clearcoatRoughnessFactor;
  8519. #endif
  8520. #else
  8521. #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
  8522. float clearcoatRoughness = u_clearcoatRoughnessFactor;
  8523. #else
  8524. float clearcoatRoughness = 0.0;
  8525. #endif
  8526. #endif
  8527. material.clearcoatFactor = clearcoatFactor;
  8528. // This is perceptual roughness. The square of this value is used for direct lighting
  8529. material.clearcoatRoughness = clearcoatRoughness;
  8530. #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
  8531. material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
  8532. #else
  8533. material.clearcoatNormal = attributes.normalEC;
  8534. #endif
  8535. }
  8536. #endif
  8537. #endif
  8538. void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
  8539. {
  8540. #ifdef USE_ANISOTROPY
  8541. NormalInfo normalInfo = getNormalInfo(attributes);
  8542. material.normalEC = normalInfo.normal;
  8543. #elif defined(HAS_NORMALS)
  8544. material.normalEC = computeNormal(attributes);
  8545. #endif
  8546. vec4 baseColorWithAlpha = vec4(1.0);
  8547. // Regardless of whether we use PBR, set a base color
  8548. #ifdef HAS_BASE_COLOR_TEXTURE
  8549. baseColorWithAlpha = getBaseColorFromTexture();
  8550. #elif defined(HAS_BASE_COLOR_FACTOR)
  8551. baseColorWithAlpha = u_baseColorFactor;
  8552. #endif
  8553. #ifdef HAS_IMAGERY
  8554. baseColorWithAlpha = blendBaseColorWithImagery(baseColorWithAlpha);
  8555. #endif // HAS_IMAGERY
  8556. #ifdef HAS_POINT_CLOUD_COLOR_STYLE
  8557. baseColorWithAlpha = v_pointCloudColor;
  8558. #elif defined(HAS_COLOR_0)
  8559. vec4 color = attributes.color_0;
  8560. // .pnts files store colors in the sRGB color space
  8561. #ifdef HAS_SRGB_COLOR
  8562. color = czm_srgbToLinear(color);
  8563. #endif
  8564. baseColorWithAlpha *= color;
  8565. #endif
  8566. #ifdef USE_CPU_STYLING
  8567. baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
  8568. #endif
  8569. material.baseColor = baseColorWithAlpha;
  8570. material.diffuse = baseColorWithAlpha.rgb;
  8571. material.alpha = baseColorWithAlpha.a;
  8572. #ifdef HAS_OCCLUSION_TEXTURE
  8573. vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
  8574. #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
  8575. occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
  8576. #endif
  8577. material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
  8578. #endif
  8579. #ifdef HAS_EMISSIVE_TEXTURE
  8580. material.emissive = getEmissiveFromTexture();
  8581. #elif defined(HAS_EMISSIVE_FACTOR)
  8582. material.emissive = u_emissiveFactor;
  8583. #endif
  8584. #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
  8585. setSpecularGlossiness(material);
  8586. #elif defined(LIGHTING_PBR)
  8587. float metalness = setMetallicRoughness(material);
  8588. #ifdef USE_SPECULAR
  8589. setSpecular(material, metalness);
  8590. #endif
  8591. #ifdef USE_ANISOTROPY
  8592. setAnisotropy(material, normalInfo);
  8593. #endif
  8594. #ifdef USE_CLEARCOAT
  8595. setClearcoat(material, attributes);
  8596. #endif
  8597. #endif
  8598. }
  8599. `;var k3=`#ifdef HAS_CONSTANT_LOD
  8600. // Extract model scale to compensate for minimumPixelSize scaling
  8601. float modelScaleX = length(czm_model[0].xyz);
  8602. float modelScaleY = length(czm_model[1].xyz);
  8603. float modelScaleZ = length(czm_model[2].xyz);
  8604. float modelScale = (modelScaleX + modelScaleY + modelScaleZ) / 3.0;
  8605. // Transform model position through ENU but as direction only (w=0) to avoid position-dependent rotation
  8606. vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xyz;
  8607. v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale;
  8608. v_constantLodUvCustom.z = u_constantLodDistance / modelScale;
  8609. #endif`;var z3=`#ifdef HAS_CONSTANT_LOD
  8610. vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) {
  8611. bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y;
  8612. bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x;
  8613. bool atClampBoundary = atMaxClamp || atMinClamp;
  8614. float effectiveDistance = atMaxClamp ? constantLodParams.y :
  8615. (atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z);
  8616. float logDepth = log2(effectiveDistance);
  8617. logDepth = clamp(logDepth, -10.0, 20.0);
  8618. float f = fract(logDepth);
  8619. float p = floor(logDepth);
  8620. if (atClampBoundary) {
  8621. float clampedP = ceil(logDepth);
  8622. vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z;
  8623. return texture(textureSampler, tc);
  8624. }
  8625. vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z;
  8626. vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z;
  8627. return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f);
  8628. }
  8629. vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams, mat3 textureTransform) {
  8630. bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y;
  8631. bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x;
  8632. bool atClampBoundary = atMaxClamp || atMinClamp;
  8633. float effectiveDistance = atMaxClamp ? constantLodParams.y :
  8634. (atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z);
  8635. float logDepth = log2(effectiveDistance);
  8636. logDepth = clamp(logDepth, -10.0, 20.0);
  8637. float f = fract(logDepth);
  8638. float p = floor(logDepth);
  8639. if (atClampBoundary) {
  8640. float clampedP = ceil(logDepth);
  8641. vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z;
  8642. // Apply texture transform to the final texture coordinates
  8643. tc = czm_computeTextureTransform(tc, textureTransform);
  8644. return texture(textureSampler, tc);
  8645. }
  8646. vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z;
  8647. vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z;
  8648. // Apply texture transform to both LOD texture coordinates before mixing
  8649. tc1 = czm_computeTextureTransform(tc1, textureTransform);
  8650. tc2 = czm_computeTextureTransform(tc2, textureTransform);
  8651. return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f);
  8652. }
  8653. #endif
  8654. `;var{Material:F$e,MetallicRoughness:iK,SpecularGlossiness:oK,Specular:sme,Clearcoat:cme}=yn,lme={name:"MaterialPipelineStage",_processTexture:yu,_processTextureTransform:ume};lme.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:a}=e;l(r.u_constantLodDistance)||(r.u_constantLodDistance=function(){let x=o.boundingSphere,b=n.camera;if(l(x)&&l(b)){let T=h.distance(b.positionWC,x.center);return Math.max(T,.1)}return 1});let s=l(o.classificationType),c=s,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;V$e(i,r,a,u,f,d,c,e),l(i.specularGlossiness)?j$e(i.specularGlossiness,r,a,u,c,e):(l(i.specular)&&mt.supportedExtensions.KHR_materials_specular&&G$e(i.specular,r,a,u,c),l(i.anisotropy)&&mt.supportedExtensions.KHR_materials_anisotropy&&W$e(i.anisotropy,r,a,u,c),l(i.clearcoat)&&mt.supportedExtensions.KHR_materials_clearcoat&&q$e(i.clearcoat,r,a,u,c),Y$e(i.metallicRoughness,r,a,u,c,e));let p=mt.getAttributeBySemantic(t,it.NORMAL),g=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading,m=e.lightingOptions;i.unlit||!p||s||g?m.lightingModel=N0.UNLIT:m.lightingModel=N0.PBR;let A=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let y=e.alphaOptions;i.alphaMode===S0.BLEND?y.pass=Ie.TRANSLUCENT:i.alphaMode===S0.MASK&&(y.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(a.addDefine("HAS_POINT_DIAMETER",void 0,he.BOTH),a.addUniform("float","u_pointDiameter",he.VERTEX),r.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&z$e(i.lineStyle,t,n,r,a),a.addFragmentLines(F3),i.doubleSided&&a.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,he.BOTH)};function k$e(e,t,n,i,o,r){let a=n.constantLod;if(!l(a)||!l(r))return;let s=`HAS_${o}_CONSTANT_LOD`;if(e.addDefine(s,void 0,he.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,he.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",he.VERTEX),e.addUniform("float","u_constantLodDistance",he.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",he.VERTEX),e.addFragmentLines(z3);let u=k3.split(`
  8655. `).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,he.FRAGMENT),t[c]=function(){return new h(a.minClampDistance,a.maxClampDistance,a.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return a.offset};let u=R.clone(R.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let d=r.model.boundingSphere;if(l(d)){let p=d.center,g=pt.eastNorthUpToFixedFrame(p);R.inverse(g,u),f=!0}}return f?u:R.IDENTITY}}}function z$e(e,t,n,i,o){let{width:r,pattern:a}=e;l(r)&&(o.addUniform("float","u_lineWidth",he.VERTEX),i.u_lineWidth=function(){return r*n.pixelRatio}),l(a)&&(o.addDefine("HAS_LINE_PATTERN",void 0,he.BOTH),o.addUniform("float","u_linePattern",he.FRAGMENT),o.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return a});let s=mt.getAttributeBySemantic(t,it.CUMULATIVE_DISTANCE);if(l(a)&&l(s)&&(t.primitiveType===Re.LINES||t.primitiveType===Re.TRIANGLE_STRIP)){o.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,he.VERTEX),s.normalized&&o.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,he.VERTEX),o.addUniform("float","u_cumulativeDistanceMax",he.VERTEX),o.addUniform("float","u_pixelsPerWorld",he.VERTEX);let c=l(s.max)?s.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,d=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(d=n.context.drawingBufferWidth/p),d};let u=mt.getAttributeInfo(s).variableName;o.addVertexLines(`
  8656. #ifdef HAS_LINE_CUMULATIVE_DISTANCE
  8657. void lineStyleStageVS(in ProcessedAttributes attributes)
  8658. {
  8659. float cumDist = attributes.${u};
  8660. #ifdef LINE_CUM_DIST_NORMALIZED
  8661. cumDist *= u_cumulativeDistanceMax;
  8662. #endif
  8663. const float textureCoordinateBase = 8192.0;
  8664. v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld;
  8665. }
  8666. #endif
  8667. `)}else l(a)&&o.addVertexLines(`
  8668. #ifdef HAS_LINE_PATTERN
  8669. void lineStyleStageVS(in ProcessedAttributes attributes)
  8670. {
  8671. vec4 posClip = gl_Position;
  8672. vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw;
  8673. const float textureCoordinateBase = 8192.0;
  8674. if (czm_viewport.z > czm_viewport.w) {
  8675. v_lineCoord = textureCoordinateBase + screenPos.x;
  8676. } else {
  8677. v_lineCoord = textureCoordinateBase + screenPos.y;
  8678. }
  8679. }
  8680. #endif
  8681. `)}function ume(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,he.FRAGMENT);let a=`${i}Transform`;e.addUniform("mat3",a,he.FRAGMENT),t[a]=function(){return n.transform}}function U$e(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,he.FRAGMENT);let a=`${i}Scale`;e.addUniform("float",a,he.FRAGMENT),t[a]=function(){return n.scale}}function yu(e,t,n,i,o,r,a){e.addUniform("sampler2D",i,he.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,he.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${o}`;e.addDefine(f,u,he.FRAGMENT);let d=n.transform;l(d)&&!$.equals(d,$.IDENTITY)&&ume(e,t,n,i,o);let{scale:p}=n;l(p)&&p!==1&&U$e(e,t,n,i,o),k$e(e,t,n,i,o,a)}function V$e(e,t,n,i,o,r,a,s){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,F$e.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",he.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,he.FRAGMENT),l(u)&&!a&&yu(n,t,u,"u_emissiveTexture","EMISSIVE",r));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!a){let g=f;l(f.constantLod)&&l(p)&&(g=Object.create(Object.getPrototypeOf(f)),Object.assign(g,f),g.constantLod=p),yu(n,t,g,"u_normalTexture","NORMAL",o,s)}l(d)&&!a&&yu(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function j$e(e,t,n,i,o,r){let{diffuseTexture:a,diffuseFactor:s,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,he.FRAGMENT),l(a)&&!o&&yu(n,t,a,"u_diffuseTexture","DIFFUSE",i,r),l(s)&&!se.equals(s,oK.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",he.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,he.FRAGMENT)),l(c)&&!o&&yu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,oK.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",he.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,he.FRAGMENT)),l(f)&&f!==oK.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",he.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,he.FRAGMENT))}function G$e(e,t,n,i,o){let{specularTexture:r,specularFactor:a,specularColorTexture:s,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,he.FRAGMENT),l(r)&&!o&&yu(n,t,r,"u_specularTexture","SPECULAR",i),l(a)&&a!==sme.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",he.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,he.FRAGMENT)),l(s)&&!o&&yu(n,t,s,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,sme.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",he.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,he.FRAGMENT))}var H$e=new h;function W$e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:a,anisotropyTexture:s}=e;n.addDefine("USE_ANISOTROPY",void 0,he.FRAGMENT),l(s)&&!o&&yu(n,t,s,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(a),u=Math.sin(a);n.addUniform("vec3","u_anisotropy",he.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,r,H$e)}}function q$e(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:a,clearcoatRoughnessFactor:s,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,he.FRAGMENT),l(r)&&r!==cme.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",he.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,he.FRAGMENT)),l(a)&&!o&&yu(n,t,a,"u_clearcoatTexture","CLEARCOAT",i),l(s)&&r!==cme.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",he.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,he.FRAGMENT)),l(c)&&!o&&yu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&yu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Y$e(e,t,n,i,o,r){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,he.FRAGMENT);let a=e.baseColorTexture;l(a)&&!o&&yu(n,t,a,"u_baseColorTexture","BASE_COLOR",i,r);let s=e.baseColorFactor;l(s)&&!se.equals(s,iK.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",he.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,he.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!o&&yu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==iK.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",he.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,he.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==iK.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",he.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,he.FRAGMENT))}var U3=lme;var Ml={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"};Ml.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Ml.METADATA_PICKING_VALUE_TYPE,"float",he.FRAGMENT),i.addDefine(Ml.METADATA_PICKING_VALUE_STRING,"0.0",he.FRAGMENT),i.addDefine(Ml.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",he.FRAGMENT),i.addDefine(Ml.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",he.FRAGMENT),i.addDefine(Ml.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",he.FRAGMENT),i.addDefine(Ml.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",he.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",he.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Ml.METADATA_PICKING_VALUE_TYPE} value = ${Ml.METADATA_PICKING_VALUE_TYPE}(${Ml.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Ml.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Ml.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Ml.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Ml.METADATA_PICKING_VALUE_COMPONENT_W};`],he.FRAGMENT)};var sd=Ml;var V3=`void morphTargetsStage(inout ProcessedAttributes attributes)
  8682. {
  8683. vec3 positionMC = attributes.positionMC;
  8684. attributes.positionMC = getMorphedPosition(positionMC);
  8685. #ifdef HAS_NORMALS
  8686. vec3 normalMC = attributes.normalMC;
  8687. attributes.normalMC = getMorphedNormal(normalMC);
  8688. #endif
  8689. #ifdef HAS_TANGENTS
  8690. vec3 tangentMC = attributes.tangentMC;
  8691. attributes.tangentMC = getMorphedTangent(tangentMC);
  8692. #endif
  8693. }`;var Ac={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)"};Ac.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,he.VERTEX),Z$e(n);let i=t.morphTargets.length;for(let s=0;s<i;s++){let c=t.morphTargets[s].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==it.POSITION&&p!==it.NORMAL&&p!==it.TANGENT||(K$e(e,d,e.attributeIndex,s),e.attributeIndex++)}}eJe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,he.VERTEX),n.addVertexLines(V3);let a={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=It(a,e.uniformMap)};var X$e={attributeString:void 0,functionId:void 0};function K$e(e,t,n,i){let o=e.shaderBuilder;Q$e(e,t,n);let r=$$e(t,X$e);J$e(o,r,i)}function Q$e(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Ft.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function $$e(e,t){switch(e.semantic){case it.POSITION:t.attributeString="Position",t.functionId=Ac.FUNCTION_ID_GET_MORPHED_POSITION;break;case it.NORMAL:t.attributeString="Normal",t.functionId=Ac.FUNCTION_ID_GET_MORPHED_NORMAL;break;case it.TANGENT:t.attributeString="Tangent",t.functionId=Ac.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function J$e(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 Z$e(e){e.addFunction(Ac.FUNCTION_ID_GET_MORPHED_POSITION,Ac.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,he.VERTEX),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Ac.FUNCTION_ID_GET_MORPHED_NORMAL,Ac.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,he.VERTEX),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Ac.FUNCTION_ID_GET_MORPHED_TANGENT,Ac.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,he.VERTEX),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function eJe(e){e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var j3=Ac;var fme={name:"PickingPipelineStage"};fme.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,a=e.model,s=o.node.instances;if(e.hasPropertyTable)tJe(e,t,s,i);else if(l(s))nJe(e,i);else{let c=dme(e),u=i.createPickId(c);a._pipelineResources.push(u),a._pickIds.push(u),r.addUniform("vec4","czm_pickColor",he.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function dme(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(qr.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 tJe(e,t,n){let i=e.model,o,r,a=i.featureIdLabel,s=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=mt.getFeatureIdsByLabel(n.featureIds,s),o=r.propertyTableId):(r=mt.getFeatureIdsByLabel(t.featureIds,a),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",he.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function nJe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,a=r._pipelineResources;for(let d=0;d<n;d++){let p=dme(e,d),g=t.createPickId(p);a.push(g),i[d]=g;let m=g.color;o[d*4+0]=U.floatToByte(m.red),o[d*4+1]=U.floatToByte(m.green),o[d*4+2]=U.floatToByte(m.blue),o[d*4+3]=U.floatToByte(m.alpha)}r._pickIds=i;let s=Ke.createVertexBuffer({context:t,typedArray:o,usage:Oe.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.statistics.addBuffer(s,!1),a.push(s);let u={index:e.attributeIndex++,vertexBuffer:s,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,he.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var G3=fme;var hme={ADD:0,REPLACE:1};Object.freeze(hme);var pr=hme;var H3=`float getPointSizeFromAttenuation(vec3 positionEC) {
  8694. // Variables are packed into a single vector to minimize gl.uniformXXX() calls
  8695. float pointSize = model_pointCloudParameters.x;
  8696. float geometricError = model_pointCloudParameters.y;
  8697. float depthMultiplier = model_pointCloudParameters.z;
  8698. float depth = -positionEC.z;
  8699. return min((geometricError / depth) * depthMultiplier, pointSize);
  8700. }
  8701. #ifdef HAS_POINT_CLOUD_SHOW_STYLE
  8702. float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  8703. float tiles3d_tileset_time = model_pointCloudParameters.w;
  8704. return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
  8705. }
  8706. #endif
  8707. #ifdef HAS_POINT_CLOUD_COLOR_STYLE
  8708. vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  8709. float tiles3d_tileset_time = model_pointCloudParameters.w;
  8710. return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
  8711. }
  8712. #endif
  8713. #ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
  8714. float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  8715. float tiles3d_tileset_time = model_pointCloudParameters.w;
  8716. return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
  8717. }
  8718. #elif defined(HAS_POINT_CLOUD_ATTENUATION)
  8719. float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  8720. return getPointSizeFromAttenuation(v_positionEC);
  8721. }
  8722. #endif
  8723. #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
  8724. float pointCloudBackFaceCullingStage() {
  8725. #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)
  8726. // This needs to be computed in eye coordinates so we can't use attributes.normalMC
  8727. return step(-v_normalEC.z, 0.0);
  8728. #else
  8729. return 1.0;
  8730. #endif
  8731. }
  8732. #endif
  8733. `;var iJe=new se,pme={name:"PointCloudStylingPipelineStage"};pme.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,a=o.structuralMetadata,s=l(a)?a.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(s)&&c;if(l(r)&&!u){let A=sJe(s),y=cJe(r,A);lJe(i,y);let b=uJe(y).indexOf("normalMC")>=0,T=mt.getAttributeBySemantic(t,it.NORMAL);if(b&&!T)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,he.VERTEX),y.styleTranslucent&&(e.alphaOptions.pass=Ie.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,he.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,he.VERTEX);let d,p,g;qr.is3DTiles(o.type)&&(p=!0,d=o.content,g=d.tile.refine===pr.ADD),i.addUniform("vec4","model_pointCloudParameters",he.VERTEX),i.addVertexLines(H3);let m=e.uniformMap;m.model_pointCloudParameters=function(){let A=iJe,y=1;p&&(y=g?5:d.tileset.memoryAdjustedScreenSpaceError),A.x=f.maximumAttenuation??y,A.x*=n.pixelRatio;let x=oJe(e,t,f,d);A.y=x*f.geometricErrorScale;let b=n.context,T=n.camera.frustum,E;return n.mode===ie.SCENE2D||T instanceof fn?E=Number.POSITIVE_INFINITY:E=b.drawingBufferHeight/n.camera.frustum.sseDenominator,A.z=E,p&&(A.w=d.tileset.timeSinceLoad),A}};var mme=new h;function oJe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=mt.getAttributeBySemantic(t,it.POSITION),r=o.count,a=e.runtimeNode.transform,s=h.subtract(o.max,o.min,mme);s=R.multiplyByPointAsVector(a,s,mme);let c=s.x*s.y*s.z;return D.cbrt(c/r)}var rJe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},aJe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function sJe(e){let t=qe(aJe);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 rK="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function cJe(e,t){let n=rJe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${rK})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${rK})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${rK})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function lJe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,he.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,he.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,he.VERTEX),e.addVertexLines(o))}function aK(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 uJe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&aK(t,o),l(n)&&aK(n,o),l(i)&&aK(i,o),o}var W3=pme;var q3=`void primitiveOutlineStage() {
  8734. v_outlineCoordinates = a_outlineCoordinates;
  8735. }
  8736. `;var Y3=`void primitiveOutlineStage(inout czm_modelMaterial material) {
  8737. if (!model_showOutline) {
  8738. return;
  8739. }
  8740. float outlineX =
  8741. texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
  8742. float outlineY =
  8743. texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
  8744. float outlineZ =
  8745. texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
  8746. float outlineness = max(outlineX, max(outlineY, outlineZ));
  8747. material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
  8748. }
  8749. `;var gme={name:"PrimitiveOutlinePipelineStage"};gme.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,he.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,a={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:Ft.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(a),i.addUniform("sampler2D","model_outlineTexture",he.FRAGMENT);let s=rE.createTexture(n.context);o.model_outlineTexture=function(){return s};let c=e.model;i.addUniform("vec4","model_outlineColor",he.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",he.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(q3),i.addFragmentLines(Y3)};var X3=gme;var _me={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Ame,_count2DPositions:yme,_countMorphTargetAttributes:xme,_countMaterialTextures:bme,_countFeatureIdTextures:Tme,_countBinaryMetadata:Cme};_me.process=function(e,t,n){let i=e.model,o=i.statistics;Ame(o,t),yme(o,e.runtimePrimitive),xme(o,t),bme(o,t.material),Tme(o,t.featureIds),Cme(o,i)};function Ame(e,t){let n=l(t.indices)?t.indices.count:mt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Re.POINTS?e.pointsLength+=n:Re.isTriangles(i)&&(e.trianglesLength+=fJe(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let a=t.outlineCoordinates;l(a)&&l(a.buffer)&&e.addBuffer(a.buffer,!1);let s=t.indices;if(l(s)&&l(s.buffer)){let c=l(s.typedArray);e.addBuffer(s.buffer,c)}}function fJe(e,t){switch(e){case Re.TRIANGLES:return t/3;case Re.TRIANGLE_STRIP:case Re.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function yme(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function xme(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let a=n[r].attributes,s=a.length;for(let c=0;c<s;c++){let u=a[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function bme(e,t){let n=dJe(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 dJe(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 Tme(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof yn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Cme(e,t){let n=t.structuralMetadata;l(n)&&(hJe(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 a=i[r];e.addBatchTexture(a.batchTexture)}}function hJe(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let a=n[o].properties;for(let s in a)if(a.hasOwnProperty(s)){let u=a[s].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var K3=_me;var mJe=new R,pJe=new R,Eme={name:"SceneMode2DPipelineStage"};Eme.process=function(e,t,n){let i=mt.getAttributeBySemantic(t,it.POSITION),o=e.shaderBuilder,r=e.model,a=r.sceneGraph.computedModelMatrix,s=e.runtimeNode.computedTransform,c=R.multiplyTransformation(a,s,mJe),u=AJe(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let A=bJe(i,c,u,n);f.positionBuffer2D=A,r._modelResources.push(A),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,he.VERTEX),o.addUniform("mat4","u_modelView2D",he.VERTEX);let p=R.fromTranslation(u.center,new R),g=n.context,m={u_modelView2D:function(){return R.multiplyTransformation(g.uniformState.view,p,pJe)}};e.uniformMap=It(m,e.uniformMap)};var gJe=new h,_Je=new h;function AJe(e,t,n){let i=R.multiplyByPoint(t,e.positionMin,gJe),o=io.computeActualEllipsoidPosition(n,i,i),r=R.multiplyByPoint(t,e.positionMax,_Je),a=io.computeActualEllipsoidPosition(n,r,r);return ce.fromCornerPoints(o,a,new ce)}var vme=new h;function yJe(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let a=0;a<n;a+=3){let s=h.fromArray(e,a,vme),c=h.multiplyComponents(s,r,s),u=h.add(c,o,c);i[a]=u.x,i[a+1]=u.y,i[a+2]=u.z}return i}function xJe(e,t,n,i){let o;l(e.quantization)?o=yJe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,a=o.length,s=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<a;c+=s){let u=h.fromArray(o,c,vme);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=R.multiplyByPoint(t,u,u),d=io.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function bJe(e,t,n,i){let o=qe(i);o.mode=ie.COLUMBUS_VIEW;let r=n.center,a=xJe(e,t,r,o),s=Ke.createVertexBuffer({context:i.context,typedArray:a,usage:Oe.STATIC_DRAW});return s.vertexArrayDestroyable=!1,s}var Q3=Eme;var $3=`void skinningStage(inout ProcessedAttributes attributes)
  8750. {
  8751. mat4 skinningMatrix = getSkinningMatrix();
  8752. mat3 skinningMatrixMat3 = mat3(skinningMatrix);
  8753. vec4 positionMC = vec4(attributes.positionMC, 1.0);
  8754. attributes.positionMC = vec3(skinningMatrix * positionMC);
  8755. #ifdef HAS_NORMALS
  8756. vec3 normalMC = attributes.normalMC;
  8757. attributes.normalMC = skinningMatrixMat3 * normalMC;
  8758. #endif
  8759. #ifdef HAS_TANGENTS
  8760. vec3 tangentMC = attributes.tangentMC;
  8761. attributes.tangentMC = skinningMatrixMat3 * tangentMC;
  8762. #endif
  8763. }`;var wx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};wx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,he.VERTEX),CJe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,he.VERTEX),n.addVertexLines($3);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=It(r,e.uniformMap)};function TJe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===it.JOINTS||r.semantic===it.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function CJe(e,t){e.addFunction(wx.FUNCTION_ID_GET_SKINNING_MATRIX,wx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,he.VERTEX),e.addFunctionLines(wx.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],a=TJe(t);for(i=0;i<=a;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(wx.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(wx.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var J3=wx;var Z3=`void verticalExaggerationStage(
  8764. inout ProcessedAttributes attributes
  8765. ) {
  8766. // Compute the distance from the camera to the local center of curvature.
  8767. vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);
  8768. vec2 vertexAzimuth = normalize(vertexPositionENU.xy);
  8769. // Curvature = 1 / radius of curvature.
  8770. float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);
  8771. float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;
  8772. // Compute the approximate ellipsoid normal at the vertex position.
  8773. // Uses a circular approximation for the Earth curvature along the geodesic.
  8774. vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
  8775. vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
  8776. vec3 vertexNormal = normalize(centerToVertex);
  8777. // Estimate the (sine of the) angle between the camera direction and the vertex normal
  8778. float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);
  8779. float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);
  8780. float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);
  8781. bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;
  8782. // Approximate the change in height above the ellipsoid, from camera to vertex position.
  8783. float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);
  8784. float smallAngleVersine = 0.5 * sinTheta * sinTheta;
  8785. float versine = isSmallAngle ? smallAngleVersine : exactVersine;
  8786. float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;
  8787. float vertexHeight = czm_eyeHeight + dHeight;
  8788. // Transform the approximate vertex normal to model coordinates.
  8789. vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;
  8790. vertexNormalMC = normalize(vertexNormalMC);
  8791. // Compute the exaggeration and apply it along the approximate vertex normal.
  8792. float stretch = u_verticalExaggerationAndRelativeHeight.x;
  8793. float shift = u_verticalExaggerationAndRelativeHeight.y;
  8794. float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
  8795. attributes.positionMC += exaggeration * vertexNormalMC;
  8796. }
  8797. `;var Sme={name:"VerticalExaggerationPipelineStage"},EJe=new z;Sme.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(Z3),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,he.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",he.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return z.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,EJe)}};var ez=Sme;var sK={};function vJe(e){let t=Ue.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 SJe(e,t){let n=t.length,i=Ue.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let a=t[r],s=t[r+1],c=t[r+2];i[o++]=a,i[o++]=s,i[o++]=s,i[o++]=c,i[o++]=c,i[o++]=a}return i}function wJe(e){let t=e-2,n=2+t*4,i=Ue.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 IJe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),a=0;r[a++]=t[0],r[a++]=t[1];for(let s=0;s<i;s++){let c=t[s],u=t[s+1],f=t[s+2];r[a++]=u,r[a++]=f,r[a++]=f,r[a++]=c}return r}function DJe(e){let t=e-2,n=2+t*4,i=Ue.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 PJe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),a=0,s=t[0];r[a++]=s,r[a++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[a++]=u,r[a++]=f,r[a++]=f,r[a++]=s}return r}sK.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Re.TRIANGLES)return i?SJe(t,n):vJe(t);if(e===Re.TRIANGLE_STRIP)return i?IJe(t,n):wJe(t);if(e===Re.TRIANGLE_FAN)return i?PJe(t,n):DJe(t)};sK.getWireframeIndicesCount=function(e,t){return e===Re.TRIANGLES?t*2:e===Re.TRIANGLE_STRIP||e===Re.TRIANGLE_FAN?2+(t-2)*4:t};var OD=sK;var wme={name:"WireframePipelineStage"};wme.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,he.FRAGMENT);let o=e.model,r=RJe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let s=e.primitiveType,c=e.count;e.primitiveType=Re.LINES,e.count=OD.getWireframeIndicesCount(s,c)};function RJe(e,t,n){let o=mt.getAttributeBySemantic(e,it.POSITION).count,r=n.context.webgl2,a;if(l(t)){let f=t.buffer,d=t.count;l(f)&&r?(a=f.sizeInBytes===d?new Uint8Array(d):Ue.createTypedArray(o,d),f.getBufferData(a)):a=t.typedArray}let s=e.primitiveType,c=OD.createWireframeIndices(s,o,a),u=Ue.fromSizeInBytes(c.BYTES_PER_ELEMENT);return Ke.createIndexBuffer({context:n.context,typedArray:c,usage:Oe.STATIC_DRAW,indexDatatype:u})}var tz=wme;function Ime(e){e=e??G.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=[]}Ime.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,a=o.style,s=e.context.webgl2,u=e.mode!==ie.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(o.imageryLayers)&&o.imageryLayers.length>0,m=l(r),y=!(m&&l(r.fragmentShaderText))||r.mode!==Y_.REPLACE_MATERIAL,x=mt.hasQuantizedAttributes(n.attributes),b=o.debugWireframe&&Re.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||s),T=o.pointCloudShading,E=l(T)&&T.attenuation,S=l(T)&&T.backFaceCulling,w=n.primitiveType===Re.POINTS&&(l(a)||E||S),P=o._enableShowOutline&&l(n.outlineCoordinates),O=l(n.edgeVisibility),B=OJe(o,i,n),L=l(o.classificationType);u&&t.push(Q3),t.push(l3),b&&t.push(tz),L&&t.push(Hk),d&&t.push(j3),p&&t.push(J3),w&&t.push(W3),x&&t.push(t3),g&&(P?_t("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(B3)),y&&t.push(U3),t.push(Tx),t.push(Ah),t.push(sd),B.hasPropertyTable&&(t.push(Ex),t.push(Gk),t.push(Yk)),f&&t.push(ez),m&&t.push(e3),t.push(N3),o.allowPicking&&t.push(G3),P&&t.push(X3),O&&(e.edgeVisibilityRequested=!0,t.push(a3),t.push(i3)),t.push(jk),t.push(K3)};function OJe(e,t,n){let i;return l(t.instances)&&(i=mt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=mt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var nz=Ime;function cK(e){e=e??G.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],MJe(this)}Object.defineProperties(cK.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 MJe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,a=e.joints,s=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];a.push(f);let d=n[c],p=Dme(f,d,new R);s.push(p)}}function Dme(e,t,n){let i=R.multiplyTransformation(e.transformToRoot,e.transform,n);return n=R.multiplyTransformation(i,t,n),n}cK.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]=Dme(i,o,e[n])}};var iz=cK;function BJe(){this.pass=void 0,this.alphaCutoff=void 0}var ME=BJe;function LJe(e){this.shaderBuilder=new i_,this.model=e,this.uniformMap={},this.alphaOptions=new ME,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var oz=LJe;var rz=`void silhouetteStage(inout vec4 color) {
  8798. if(model_silhouettePass) {
  8799. color = czm_gammaCorrect(model_silhouetteColor);
  8800. }
  8801. }`;var az=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
  8802. #ifdef HAS_NORMALS
  8803. if(model_silhouettePass) {
  8804. vec3 normal = normalize(czm_normal3D * attributes.normalMC);
  8805. normal.x *= czm_projection[0][0];
  8806. normal.y *= czm_projection[1][1];
  8807. positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
  8808. }
  8809. #endif
  8810. }
  8811. `;var sz={name:"ModelSilhouettePipelineStage"};sz.silhouettesLength=0;sz.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++sz.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,he.BOTH),i.addVertexLines(az),i.addFragmentLines(rz),i.addUniform("vec4","model_silhouetteColor",he.FRAGMENT),i.addUniform("float","model_silhouetteSize",he.VERTEX),i.addUniform("bool","model_silhouettePass",he.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=It(o,e.uniformMap),e.hasSilhouette=!0};var cz=sz;var lz=`void modelSplitterStage()
  8812. {
  8813. // Don't split when rendering the shadow map, because it is rendered from
  8814. // the perspective of a totally different camera.
  8815. #ifndef SHADOW_MAP
  8816. if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
  8817. if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
  8818. #endif
  8819. }
  8820. `;var uz={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};uz.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,he.FRAGMENT),i.addFragmentLines(lz);let o={};i.addUniform("float",uz.SPLIT_DIRECTION_UNIFORM_NAME,he.FRAGMENT),o[uz.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=It(o,e.uniformMap)};var fz=uz;function NJe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=qe(e.uniformMap),this.alphaOptions=qe(e.alphaOptions),this.renderStateOptions=qe(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,this.primitiveRenderResources=[]}var dz=NJe;function FJe(e){e=e??G.EMPTY_OBJECT,this.lightingModel=e.lightingModel??N0.UNLIT}var hz=FJe;function kJe(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=qe(e.uniformMap),this.alphaOptions=qe(e.alphaOptions),this.renderStateOptions=qe(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:mt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=mt.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 hz,this.pickId=void 0}var mz=kJe;function uK(e){e=e??G.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!==Yn.CESIUM_3D_TILE,this._classifies3DTiles=o!==Yn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],jJe(this)}function zJe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:vt.KEEP,zFail:vt.DECREMENT_WRAP,zPass:vt.KEEP},backFunction:e,backOperation:{fail:vt.KEEP,zFail:vt.INCREMENT_WRAP,zPass:vt.KEEP},reference:Ht.CESIUM_3D_TILE_MASK,mask:Ht.CESIUM_3D_TILE_MASK},stencilMask:Ht.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},depthMask:!1}}var UJe={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},reference:0,mask:Ht.CLASSIFICATION_MASK},stencilMask:Ht.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:Jt.PRE_MULTIPLIED_ALPHA_BLEND},VJe={stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},backFunction:Xn.NOT_EQUAL,backOperation:{fail:vt.ZERO,zFail:vt.ZERO,zPass:vt.ZERO},reference:0,mask:Ht.CLASSIFICATION_MASK},stencilMask:Ht.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Ome=[];function jJe(e){let t=e._command,n=Ome;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=MD(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,a=r.length;for(let s=0;s<a;s++){let c=r[s];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Ie.TERRAIN_CLASSIFICATION,a=lK(t,r),s=Pme(t,r);n.length=0,n.push(a,s),e._commandListTerrain=MD(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Rme(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION,a=lK(t,r),s=Pme(t,r);n.length=0,n.push(a,s),e._commandList3DTiles=MD(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Rme(e,n,e._commandList3DTilesPicking))}}function MD(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,a=o.length,s=t.length;for(let c=0;c<a;c++){let u=o[c],f=r[c];for(let d=0;d<s;d++){let p=t[d],g=tt.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function lK(e,t){let n=tt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?Xn.ALWAYS:Xn.EQUAL,o=zJe(i);return n.renderState=Ve.fromCache(o),n}function Pme(e,t){let n=tt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache(UJe),n}var GJe=[];function Rme(e,t,n){let i=Ve.fromCache(VJe),o=t[0],r=t[1],a=tt.shallowClone(o);a.cull=!0,a.pickOnly=!0;let s=tt.shallowClone(r);s.cull=!0,s.pickOnly=!0,s.renderState=i,s.pickId=e._pickId;let c=GJe;return c.length=0,c.push(a,s),MD(e,c,n)}Object.defineProperties(uK.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=R.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}}});uK.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Jn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Jn(t,this._commandListTerrain),this._classifies3DTiles&&Jn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=lK(this._command,o),a=Ome;a.length=0,a.push(r),this._commandListIgnoreShow=MD(this,a,this._commandListIgnoreShow)}Jn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Jn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Jn(t,this._commandList3DTilesPicking)),t};var pz=uK;function BD(e){e=e??G.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o,this._primitiveRenderResources=n;let r=t.pass===Ie.TRANSLUCENT,s=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,d=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=R.clone(t.modelMatrix),this._boundingVolume=ce.clone(t.boundingVolume),this._modelMatrix2D=new R,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=s,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._needsEdgeCommands=p,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._edgeCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,HJe(this)}function ip(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}ip.clone=function(e){return new ip({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function HJe(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;if(e._originalCommand=new ip({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new ip({command:$Je(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new ip({command:oZe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new ip({command:rZe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new ip({command:JJe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new ip({command:ZJe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let r=e._primitiveRenderResources;e._edgeCommand=new ip({command:eZe(t,r,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand)}}Object.defineProperties(BD.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=R.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,qJe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,YJe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,XJe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,KJe(this))}}});function WJe(e,t){let n=e._modelMatrix;e._modelMatrix2D=R.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ce.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function qJe(e){let t=e.shadows,n=vn.castShadows(t),i=vn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let a=o[r];if(a.updateShadows){let s=a.command;s.castShadows=n,s.receiveShadows=i}}}function YJe(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,a=qe(r.renderState,!0);a.cull.enabled=t,r.renderState=Ve.fromCache(a)}}}function XJe(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,a=qe(r.renderState,!0);a.cull.face=t,r.renderState=Ve.fromCache(a)}}}function KJe(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}}}BD.prototype.pushCommands=function(e,t){let n=fK(this,e);n&&!this._has2DCommands&&(QJe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(WJe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==$m.ALL_OPAQUE&&$_(t,this._translucentCommand,n),i===$m.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||$_(o._backfaceCommands,this._skipLodBackfaceCommand,n),tZe(this,r,n),$_(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){$_(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===_h.EDGES_ONLY&&this._needsEdgeCommands||($_(t,this._originalCommand,n),this._needsEdgeCommands&&this._model.edgeDisplayMode!==_h.SURFACES_ONLY&&$_(t,this._edgeCommand,n)),t}};BD.prototype.pushSilhouetteCommands=function(e,t){let n=fK(this,e);return $_(t,this._silhouetteColorCommand,n),t};BD.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand)||this._model.edgeDisplayMode===_h.SURFACES_ONLY)return t;let n=this._model.edgeDisplayMode===_h.EDGES_ONLY?Ie.CESIUM_3D_TILE_EDGES_DIRECT:Ie.CESIUM_3D_TILE_EDGES;this._edgeCommand.command.pass=n,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=n);let i=fK(this,e);return $_(t,this._edgeCommand,i),t};function $_(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function fK(e,t){if(t.mode!==ie.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,a=t.mapProjection.ellipsoid.maximumRadius*D.PI;return o<a&&r>a||o<-a&&r>-a}function Ix(e,t){if(!l(t))return;let n=ip.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 QJe(e){Ix(e,e._originalCommand),Ix(e,e._translucentCommand),Ix(e,e._skipLodBackfaceCommand),Ix(e,e._skipLodStencilCommand),Ix(e,e._silhouetteModelCommand),Ix(e,e._silhouetteColorCommand),Ix(e,e._edgeCommand)}function $Je(e){let t=tt.shallowClone(e);t.pass=Ie.TRANSLUCENT;let n=qe(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=Jt.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function JJe(e,t){let n=t._silhouetteId%255,i=tt.shallowClone(e),o=qe(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ee.ALWAYS,backFunction:ee.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function ZJe(e,t){let n=t._silhouetteId%255,i=tt.shallowClone(e),o=qe(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ie.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ie.TRANSLUCENT,o.depthMask=!1,o.blending=Jt.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ee.NOTEQUAL,backFunction:ee.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP}};let a=qe(e.uniformMap);return a.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=a,i.castShadows=!1,i.receiveShadows=!1,i}function eZe(e,t){let n=t.edgeGeometry,i=tt.shallowClone(e);i.vertexArray=n.vertexArray,i.primitiveType=n.primitiveType,i.count=n.indexCount,l(n.shaderProgram)&&(i.shaderProgram=n.shaderProgram),i.pass=n.pass;let o=qe(e.uniformMap);return o.u_isEdgePass=function(){return!0},i.uniformMap=o,i.castShadows=!1,i.receiveShadows=!1,i}function tZe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,a=nZe(o);if(r!==a){let s=iZe(r),c=qe(o.renderState,!0);c.stencilTest.reference=s,o.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function nZe(e){return(e.renderState.stencilTest.reference&Ht.SKIP_LOD_MASK)>>>Ht.SKIP_LOD_BIT_SHIFT}function iZe(e){return Ht.CESIUM_3D_TILE_MASK|e<<Ht.SKIP_LOD_BIT_SHIFT}function oZe(e){let t=tt.shallowClone(e),n=qe(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Li.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=qe(t.uniformMap),o=new z(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function rZe(e){let t=tt.shallowClone(e),n=qe(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Ht.SKIP_LOD_MASK,i.reference=Ht.CESIUM_3D_TILE_MASK,i.frontFunction=Xn.GREATER_OR_EQUAL,i.frontOperation.zPass=vt.REPLACE,i.backFunction=Xn.GREATER_OR_EQUAL,i.backOperation.zPass=vt.REPLACE,n.stencilMask=Ht.CESIUM_3D_TILE_MASK|Ht.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var gz=BD;var _z=`precision highp float;
  8821. czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
  8822. czm_modelVertexOutput vsOutput;
  8823. vsOutput.positionMC = positionMC;
  8824. vsOutput.pointSize = 1.0;
  8825. return vsOutput;
  8826. }
  8827. void main()
  8828. {
  8829. // Initialize the attributes struct with all
  8830. // attributes except quantized ones.
  8831. ProcessedAttributes attributes;
  8832. initializeAttributes(attributes);
  8833. #ifdef HAS_IMAGERY
  8834. initializeImageryAttributes();
  8835. #endif
  8836. // Dequantize the quantized ones and add them to the
  8837. // attributes struct.
  8838. #ifdef USE_DEQUANTIZATION
  8839. dequantizationStage(attributes);
  8840. #endif
  8841. #ifdef HAS_MORPH_TARGETS
  8842. morphTargetsStage(attributes);
  8843. #endif
  8844. #ifdef HAS_SKINNING
  8845. skinningStage(attributes);
  8846. #endif
  8847. #ifdef HAS_PRIMITIVE_OUTLINE
  8848. primitiveOutlineStage();
  8849. #endif
  8850. // Compute the bitangent according to the formula in the glTF spec.
  8851. // Normal and tangents can be affected by morphing and skinning, so
  8852. // the bitangent should not be computed until their values are finalized.
  8853. #ifdef HAS_BITANGENTS
  8854. attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
  8855. #endif
  8856. FeatureIds featureIds;
  8857. featureIdStage(featureIds, attributes);
  8858. #ifdef HAS_SELECTED_FEATURE_ID
  8859. SelectedFeature feature;
  8860. selectedFeatureIdStage(feature, featureIds);
  8861. // Handle any show properties that come from the style.
  8862. cpuStylingStage(attributes.positionMC, feature);
  8863. #endif
  8864. #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
  8865. // The scene mode 2D pipeline stage and instancing stage add a different
  8866. // model view matrix to accurately project the model to 2D. However, the
  8867. // output positions and normals should be transformed by the 3D matrices
  8868. // to keep the data the same for the fragment shader.
  8869. mat4 modelView = czm_modelView3D;
  8870. mat3 normal = czm_normal3D;
  8871. #else
  8872. // These are used for individual model projection because they will
  8873. // automatically change based on the scene mode.
  8874. mat4 modelView = czm_modelView;
  8875. mat3 normal = czm_normal;
  8876. #endif
  8877. // Update the position for this instance in place
  8878. #ifdef HAS_INSTANCING
  8879. // The legacy instance stage is used when rendering i3dm models that
  8880. // encode instances transforms in world space, as opposed to glTF models
  8881. // that use EXT_mesh_gpu_instancing, where instance transforms are encoded
  8882. // in object space.
  8883. #ifdef USE_LEGACY_INSTANCING
  8884. mat4 instanceModelView;
  8885. mat3 instanceModelViewInverseTranspose;
  8886. legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);
  8887. modelView = instanceModelView;
  8888. normal = instanceModelViewInverseTranspose;
  8889. #else
  8890. instancingStage(attributes);
  8891. #endif
  8892. #ifdef USE_PICKING
  8893. v_pickColor = a_pickColor;
  8894. #endif
  8895. #endif
  8896. Metadata metadata;
  8897. MetadataClass metadataClass;
  8898. MetadataStatistics metadataStatistics;
  8899. metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes);
  8900. #ifdef HAS_VERTICAL_EXAGGERATION
  8901. verticalExaggerationStage(attributes);
  8902. #endif
  8903. #ifdef HAS_CUSTOM_VERTEX_SHADER
  8904. czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
  8905. customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
  8906. #endif
  8907. // Compute the final position in each coordinate system needed.
  8908. // This returns the value that will be assigned to gl_Position.
  8909. vec4 positionClip = geometryStage(attributes, modelView, normal);
  8910. #if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN)
  8911. lineStyleStageVS(attributes);
  8912. #endif
  8913. // This must go after the geometry stage as it needs v_positionWC
  8914. #ifdef HAS_ATMOSPHERE
  8915. atmosphereStage(attributes);
  8916. #endif
  8917. #ifdef ENABLE_CLIPPING_POLYGONS
  8918. modelClippingPolygonsStage(attributes);
  8919. #endif
  8920. #ifdef HAS_SILHOUETTE
  8921. silhouetteStage(attributes, positionClip);
  8922. #endif
  8923. #ifdef HAS_POINT_CLOUD_SHOW_STYLE
  8924. float show = pointCloudShowStylingStage(attributes, metadata);
  8925. #else
  8926. float show = 1.0;
  8927. #endif
  8928. #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
  8929. show *= pointCloudBackFaceCullingStage();
  8930. #endif
  8931. #ifdef HAS_POINT_CLOUD_COLOR_STYLE
  8932. v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
  8933. #endif
  8934. #ifdef PRIMITIVE_TYPE_POINTS
  8935. #ifdef HAS_CUSTOM_VERTEX_SHADER
  8936. gl_PointSize = vsOutput.pointSize;
  8937. #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
  8938. gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
  8939. #elif defined(HAS_POINT_DIAMETER)
  8940. gl_PointSize = u_pointDiameter;
  8941. #else
  8942. gl_PointSize = 1.0;
  8943. #endif
  8944. gl_PointSize *= show;
  8945. #endif
  8946. // Important NOT to compute gl_Position = show * positionClip or we hit:
  8947. // https://github.com/CesiumGS/cesium/issues/11270
  8948. //
  8949. // We will discard points with v_pointCloudShow == 0 in the fragment shader.
  8950. gl_Position = positionClip;
  8951. #ifdef HAS_EDGE_VISIBILITY
  8952. edgeVisibilityStageVS();
  8953. #endif
  8954. #ifdef HAS_POINT_CLOUD_SHOW_STYLE
  8955. v_pointCloudShow = show;
  8956. #endif
  8957. }
  8958. `;var Az=`
  8959. precision highp float;
  8960. czm_modelMaterial defaultModelMaterial()
  8961. {
  8962. czm_modelMaterial material;
  8963. material.diffuse = vec3(0.0);
  8964. material.specular = vec3(1.0);
  8965. material.roughness = 1.0;
  8966. material.occlusion = 1.0;
  8967. material.normalEC = vec3(0.0, 0.0, 1.0);
  8968. material.emissive = vec3(0.0);
  8969. material.alpha = 1.0;
  8970. return material;
  8971. }
  8972. vec4 handleAlpha(vec3 color, float alpha)
  8973. {
  8974. #ifdef ALPHA_MODE_MASK
  8975. if (alpha < u_alphaCutoff) {
  8976. discard;
  8977. }
  8978. #endif
  8979. return vec4(color, alpha);
  8980. }
  8981. void lineStyleStage()
  8982. {
  8983. #if defined(HAS_LINE_PATTERN) && !defined(HAS_EDGE_VISIBILITY)
  8984. const float maskLength = 16.0;
  8985. float dashPosition = fract(v_lineCoord / maskLength);
  8986. float maskIndex = floor(dashPosition * maskLength);
  8987. float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
  8988. if (mod(maskTest, 2.0) < 1.0) {
  8989. discard;
  8990. }
  8991. #endif
  8992. }
  8993. SelectedFeature selectedFeature;
  8994. void main()
  8995. {
  8996. #if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER)
  8997. // Render points as circles
  8998. float distanceToCenter = length(gl_PointCoord - vec2(0.5));
  8999. if (distanceToCenter > 0.5) {
  9000. discard;
  9001. }
  9002. #endif
  9003. #ifdef HAS_POINT_CLOUD_SHOW_STYLE
  9004. if (v_pointCloudShow == 0.0)
  9005. {
  9006. discard;
  9007. }
  9008. #endif
  9009. #ifdef HAS_MODEL_SPLITTER
  9010. modelSplitterStage();
  9011. #endif
  9012. czm_modelMaterial material = defaultModelMaterial();
  9013. ProcessedAttributes attributes;
  9014. geometryStage(attributes);
  9015. FeatureIds featureIds;
  9016. featureIdStage(featureIds, attributes);
  9017. Metadata metadata;
  9018. MetadataClass metadataClass;
  9019. MetadataStatistics metadataStatistics;
  9020. metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes);
  9021. //========================================================================
  9022. // When not picking metadata START
  9023. #ifndef METADATA_PICKING_ENABLED
  9024. #ifdef HAS_SELECTED_FEATURE_ID
  9025. selectedFeatureIdStage(selectedFeature, featureIds);
  9026. #endif
  9027. #ifndef CUSTOM_SHADER_REPLACE_MATERIAL
  9028. materialStage(material, attributes, selectedFeature);
  9029. #endif
  9030. #ifdef HAS_CUSTOM_FRAGMENT_SHADER
  9031. customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
  9032. #endif
  9033. lightingStage(material, attributes);
  9034. #ifdef HAS_SELECTED_FEATURE_ID
  9035. cpuStylingStage(material, selectedFeature);
  9036. #endif
  9037. #ifdef HAS_MODEL_COLOR
  9038. modelColorStage(material);
  9039. #endif
  9040. #ifdef HAS_PRIMITIVE_OUTLINE
  9041. primitiveOutlineStage(material);
  9042. #endif
  9043. vec4 color = handleAlpha(material.diffuse, material.alpha);
  9044. // When not picking metadata END
  9045. //========================================================================
  9046. #else
  9047. //========================================================================
  9048. // When picking metadata START
  9049. vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
  9050. metadataPickingStage(metadata, metadataClass, metadataValues);
  9051. vec4 color = metadataValues;
  9052. #endif
  9053. // When picking metadata END
  9054. //========================================================================
  9055. lineStyleStage();
  9056. #ifdef HAS_CLIPPING_PLANES
  9057. modelClippingPlanesStage(color);
  9058. #endif
  9059. #ifdef ENABLE_CLIPPING_POLYGONS
  9060. modelClippingPolygonsStage();
  9061. #endif
  9062. //========================================================================
  9063. // When not picking metadata START
  9064. #ifndef METADATA_PICKING_ENABLED
  9065. #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
  9066. silhouetteStage(color);
  9067. #endif
  9068. #ifdef HAS_ATMOSPHERE
  9069. atmosphereStage(color, attributes);
  9070. #endif
  9071. #ifdef HAS_EDGE_VISIBILITY
  9072. edgeVisibilityStage(color, featureIds);
  9073. edgeDetectionStage(color, featureIds);
  9074. #endif
  9075. #endif
  9076. // When not picking metadata END
  9077. //========================================================================
  9078. out_FragColor = color;
  9079. }
  9080. `;function Mme(){}Mme.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=aZe(e,n,t),o=sZe(e,i,t),r=e.model;return l(r.classificationType)?new pz({primitiveRenderResources:e,command:o}):new gz({primitiveRenderResources:e,command:o})};function aZe(e,t,n){t.addVertexLines(_z),t.addFragmentLines(Az);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function sZe(e,t,n){let i=cZe(e),o=new Fn({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let a=e.alphaOptions.pass,s=r.sceneGraph,c=n.mode===ie.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=R.multiplyTransformation(s._computedModelMatrix,e.runtimeNode.computedTransform,new R),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?s._computedModelMatrix:s._computedModelMatrix2D;u=R.multiplyTransformation(x,e.runtimeNode.computedTransform,new R),f=ce.transform(e.boundingSphere,u)}let d=qe(Ve.fromCache(e.renderStateOptions),!0);d.cull.face=mt.getCullFace(u,e.primitiveType),d=Ve.fromCache(d);let p=l(r.classificationType),g=p?!1:vn.castShadows(r.shadows),m=p?!1:vn.receiveShadows(r.shadows),A=p?void 0:e.pickId;return new tt({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:o,shaderProgram:t,cull:r.cull,pass:a,count:e.count,owner:r,pickId:A,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function cZe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var yz=Mme;function $c(e){e=e??G.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=R.clone(R.IDENTITY),this._computedModelMatrix2D=R.clone(R.IDENTITY),this._axisCorrectionMatrix=mt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new R),this._runtimeArticulations={},lZe(this)}Object.defineProperties($c.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 lZe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Bme(e,o);let r=t.articulations,a=r.length,s=e._runtimeArticulations;for(let b=0;b<a;b++){let T=r[b],E=new Sk({articulation:T,sceneGraph:e}),S=E.name;s[S]=E}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=R.IDENTITY;for(let b=0;b<d;b++){let T=n.nodes[b],E=Lme(e,T,p);e._rootNodes.push(E)}let g=t.skins,m=e._runtimeSkins,A=g.length;for(let b=0;b<A;b++){let T=g[b];m.push(new iz({skin:T,sceneGraph:e}))}let y=e._skinnedNodes,x=y.length;for(let b=0;b<x;b++){let T=y[b],E=e._runtimeNodes[T],w=c[T].skin.index;E._runtimeSkin=m[w],E.updateJointMatrices()}e.applyArticulations()}function Bme(e,t){let n=e._components,i=e._model;e._computedModelMatrix=R.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=R.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=R.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var uZe=new h;function fZe(e,t){let n=e._computedModelMatrix,i=R.getTranslation(n,uZe);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=pt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=pt.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=R.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ce.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Lme(e,t,n){let i=[],o=mt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let d=t.children[f],p=R.multiplyTransformation(n,o,new R),g=Lme(e,d,p);i.push(g)}let a=new Vk({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),s=t.primitives.length;for(let f=0;f<s;f++)a.runtimePrimitives.push(new nz({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=a,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new Mk(f,a);f._nodesByName[u]=d}return c}var dZe=new h,hZe=new h,mZe=new h,pZe=new h;$c.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};$c.prototype.buildRenderResources=function(e){let t=this._model,n=new oz(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let o=0;o<i.length;o++)i[o].process(n,t,e);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;r.configurePipeline();let a=r.pipelineStages,s=new dz(n,r);n.nodeRenderResources[o]=s;for(let c=0;c<a.length;c++)a[c].process(s,r.node,e);for(let c=0;c<r.runtimePrimitives.length;c++){let u=r.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,d=new mz(s,u);s.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};$c.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,dZe),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,hZe);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;let a=e.nodeRenderResources[o],s=r.computedTransform;for(let c=0;c<r.runtimePrimitives.length;c++){let u=r.runtimePrimitives[c],f=a.primitiveRenderResources[c];u.boundingSphere=ce.clone(f.boundingSphere,new ce);let d=R.multiplyByPoint(s,f.positionMin,mZe),p=R.multiplyByPoint(s,f.positionMax,pZe);h.minimumByComponent(n,d,n),h.maximumByComponent(i,p,i)}}this._boundingSphere=ce.fromCornerPoints(n,i,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};$c.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let o=e.nodeRenderResources[n];for(let r=0;r<i.runtimePrimitives.length;r++){let a=i.runtimePrimitives[r],s=o.primitiveRenderResources[r],c=yz.buildModelDrawCommand(s,t);a.drawCommand=c}}};$c.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(bx),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(Ck),n.isClippingEnabled()&&t.push(Dk),n.isClippingPolygonsEnabled()&&t.push(Ok),n.hasSilhouette(e)&&t.push(cz),l(n.splitDirection)&&n.splitDirection!==Vr.NONE&&t.push(fz),qr.is3DTiles(n.type)&&t.push(Ak),i&&t.push(bk))};$c.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 a=e.mode!==ie.SCENE3D&&this._model._projectTo2D;for(t&&!a&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let s=r.runtimePrimitives[i];for(o=0;o<s.updateStages.length;o++)s.updateStages[o].update(s,this)}}};$c.prototype.updateModelMatrix=function(e,t){Bme(this,e),t.mode!==ie.SCENE3D&&fZe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};$c.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 Nme(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);Nme(e,u,n,i,o)}let a=t.runtimePrimitives,s=a.length;for(let c=0;c<s;c++){let u=a[c];i(u,o)}}function xz(e,t,n,i){let o=e._rootNodes,r=o.length;for(let a=0;a<r;a++){let s=o[a],c=e._runtimeNodes[s];Nme(e,c,t,n,i)}}var gZe={backFaceCulling:void 0};$c.prototype.updateBackFaceCulling=function(e){let t=gZe;t.backFaceCulling=e,xz(this,!1,_Ze,t)};function _Ze(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var AZe={shadowMode:void 0};$c.prototype.updateShadows=function(e){let t=AZe;t.shadowMode=e,xz(this,!1,yZe,t)};function yZe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var xZe={debugShowBoundingVolume:void 0};$c.prototype.updateShowBoundingVolume=function(e){let t=xZe;t.debugShowBoundingVolume=e,xz(this,!1,bZe,t)};function bZe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Fme=[],kme=[],TZe={frameState:void 0,hasSilhouette:void 0};$c.prototype.pushDrawCommands=function(e){let t=Fme;t.length=0;let n=kme;n.length=0;let i=TZe;i.hasSilhouette=this._model.hasSilhouette(e),i.frameState=e,xz(this,!0,CZe,i),Jn(e.commandList,t),Jn(e.commandList,n)};function CZe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Fme,a=kme,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r),l(s.pushEdgeCommands)&&s.pushEdgeCommands(n,a)}$c.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)};$c.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var bz=$c;function J_(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Nt}Object.defineProperties(J_.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}}});J_.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};J_.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};J_.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};J_.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};J_.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};J_.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var Tz=J_;var jme=Na(PO(),1);var zme={},Dx=Uint32Array.BYTES_PER_ELEMENT;zme.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=Dx;let o=i.getUint32(t,!0);if(o!==1)throw new re(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=Dx,t+=Dx;let r=i.getUint32(t,!0);if(r===0)throw new re("Feature table must have a byte length greater than zero");t+=Dx;let a=i.getUint32(t,!0);t+=Dx;let s=i.getUint32(t,!0);t+=Dx;let c=i.getUint32(t,!0);t+=Dx;let u=Sr(n,t,r);t+=r;let f=new Uint8Array(e,t,a);t+=a;let d,p;s>0&&(d=Sr(n,t,s),Object.keys(d).length===0&&(d=void 0),t+=s,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p),t+=c));let g=new Km(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new re("Feature table global property: POINTS_LENGTH must be defined");let A=g.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(A)&&(A=h.unpack(A));let y=vZe(g,d);if(y.rtcCenter=A,y.pointsLength=m,!y.hasPositions){let x=SZe(g);y.positions=x,y.hasPositions=y.hasPositions||l(x)}if(!y.hasPositions)throw new re("Either POSITION or POSITION_QUANTIZED must be defined.");if(!y.hasNormals){let x=IZe(g);y.normals=x,y.hasNormals=y.hasNormals||l(x)}if(!y.hasColors){let x=wZe(g);y.colors=x,y.hasColors=y.hasColors||l(x),y.hasConstantColor=l(y.constantColor),y.isTranslucent=l(x)&&x.isTranslucent}if(!y.hasBatchIds){let x=DZe(g);y.batchIds=x,y.hasBatchIds=y.hasBatchIds||l(x)}if(y.hasBatchIds){let x=g.getGlobalProperty("BATCH_LENGTH");if(!l(x))throw new re("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");y.batchLength=x}return(l(d)||l(p))&&(y.batchTableJson=d,y.batchTableBinary=p),EZe(y),y};function EZe(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),o=[];for(let r of Object.keys(t)){let s=t[r].byteOffset;l(s)&&(i.includes(r)||o.push(r))}for(let r of o)_t("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${r} that could not be resolved - skipping`),delete t[r]}function vZe(e,t){let n=e.json,i,o,r,a=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,s=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(s)&&(r=s.properties);let c,u,f,d,p;if(l(a)){o=a.properties;let m=a.byteOffset,A=a.byteLength;if(!l(o)||!l(m)||!l(A))throw new re("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+A),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),d=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:It(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function SZe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Y.FLOAT,3),{name:it.POSITION,semantic:it.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Y.FLOAT,type:Ft.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(r))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:it.POSITION,semantic:it.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Y.FLOAT,type:Ft.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Y.UNSIGNED_SHORT,quantizedType:Ft.VEC3}}}function wZe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Y.UNSIGNED_BYTE,4),{name:it.COLOR,semantic:it.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Ft.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Y.UNSIGNED_BYTE,3),{name:"COLOR",semantic:it.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Ft.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Y.UNSIGNED_SHORT,1),{name:"COLOR",semantic:it.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.FLOAT,type:Ft.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Y.UNSIGNED_BYTE,4),o=i[3],r=U.fromBytes(i[0],i[1],i[2],o),a=o<255;return{name:it.COLOR,semantic:it.COLOR,setIndex:0,constantColor:r,componentDatatype:Y.FLOAT,type:Ft.VEC4,isQuantized:!1,isTranslucent:a}}}function IZe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Y.FLOAT,3),{name:it.NORMAL,semantic:it.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Y.FLOAT,type:Ft.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Y.UNSIGNED_BYTE,2),{name:it.NORMAL,semantic:it.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Ft.VEC2,quantizedComponentDatatype:Y.UNSIGNED_BYTE,componentDatatype:Y.FLOAT,type:Ft.VEC3}}function DZe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Y.UNSIGNED_SHORT,1);return{name:it.FEATURE_ID,semantic:it.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Y.fromTypedArray(n),type:Ft.SCALAR}}}var BE=zme;var PZe=yn.Components,RZe=yn.Scene,OZe=yn.Node,MZe=yn.Primitive,BZe=yn.Attribute,Ume=yn.Quantization,LZe=yn.FeatureIdAttribute,NZe=yn.Material,FZe=yn.MetallicRoughness,dK=class extends Ki{constructor(t){super(),t=t??G.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=R.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=BE.parse(this._arrayBuffer,this._byteOffset),this._state=gt.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===gt.READY)return!0;if(this._state===gt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=kZe(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function kZe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=w_.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&zZe(e,i,r),QZe(e,t),e._state=gt.READY,e}).catch(function(r){e.unload(),e._state=gt.FAILED;let a="Failed to load Draco pnts";e._error=e.getError(a,r)})}function zZe(e,t,n){e._state=gt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:it.POSITION,typedArray:n.POSITION.array,componentDatatype:Y.FLOAT,type:Ft.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let s=n.POSITION.data.quantization,c=s.range,u=h.fromElements(c,c,c),f=h.unpack(s.minValues),d=(1<<s.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=d,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=d<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT,o.quantizedType=Ft.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:it.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Y.FLOAT,type:Ft.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let s=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=s,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=Y.UNSIGNED_BYTE,o.quantizedType=Ft.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:it.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Y.UNSIGNED_BYTE,type:Ft.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:it.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Y.UNSIGNED_BYTE,type:Ft.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let s=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:it.FEATURE_ID,setIndex:0,typedArray:s,componentDatatype:Y.fromTypedArray(s),type:Ft.SCALAR}}let r=i.batchTableJson,a=t.batchTableProperties;for(let s in a)if(a.hasOwnProperty(s)){let c=n[s];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[s]={byteOffset:u.byteOffset,type:UZe(u.componentsPerAttribute),componentType:VZe(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function UZe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function VZe(e){switch(e){case ee.BYTE:return"BYTE";case ee.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ee.SHORT:return"SHORT";case ee.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ee.INT:return"INT";case ee.UNSIGNED_INT:return"UNSIGNED_INT";case ee.DOUBLE:return"DOUBLE";case ee.FLOAT:return"FLOAT"}}function LD(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Ume,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Ume;let s=t.quantizedRange;o.normalizationRange=s,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,s,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new BZe;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=on.decodeRGB565(i)),l(t.constantColor)){let s=new Array(4);r.constant=U.pack(t.constantColor,s)}else{let s=Ke.createVertexBuffer({typedArray:i,context:n,usage:Oe.STATIC_DRAW});s.vertexArrayDestroyable=!1,e._buffers.push(s),r.buffer=s}let a=e._loadAttributesFor2D;return r.semantic===it.POSITION&&a&&(r.typedArray=i),r}var Vme,Cz;function jZe(e){if(!l(Cz)){Vme=new jme.default(0),Cz=new Array(e);for(let t=0;t<e;++t)Cz[t]=Vme.random()}return Cz}var GZe=new h,HZe=new h,WZe=new h;function qZe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=jZe(n),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=h.fromElements(a,a,a,GZe),u=h.fromElements(s,s,s,HZe),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)d=Math.floor(r[f]*i),p=h.unpack(t,d*3,WZe),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var YZe={name:it.COLOR,semantic:it.COLOR,setIndex:0,constantColor:U.DARKGRAY,componentDatatype:Y.FLOAT,type:Ft.VEC4,isQuantized:!1,isTranslucent:!1};function XZe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(qZe(r),o=LD(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=LD(e,t.normals,n),o.count=t.pointsLength,i.push(o)),l(t.colors)?(o=LD(e,t.colors,n),o.count=t.pointsLength,i.push(o)):(o=LD(e,YZe,n),o.count=t.pointsLength,i.push(o)),l(t.batchIds)&&(o=LD(e,t.batchIds,n),o.count=t.pointsLength,i.push(o)),i}function KZe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableJson,r=e.batchTableBinary,a=!l(e.batchIds);return l(r)||l(o)||e.hasDracoBatchTable?W_({count:n??i,batchTable:o,binaryBody:r,parseAsPropertyAttributes:a,customAttributeOutput:t}):new Ys({schema:{},propertyTables:[]})}function QZe(e,t){let n=e._parsedContent,i=new FZe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new NZe;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=S0.BLEND);let a=!l(n.normals);o.unlit=a;let s=new MZe;if(s.attributes=XZe(e,n,t),s.primitiveType=Re.POINTS,s.material=o,l(n.batchIds)){let g=new LZe;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",s.featureIds.push(g)}let c=new OZe;c.index=0,c.primitives=[s];let u=new RZe;u.nodes=[c],u.upAxis=Fi.Z,u.forwardAxis=Fi.X;let f=new PZe;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=KZe(n,d),d.length>0&&$Ze(e,s,d,t),l(n.rtcCenter)&&(f.transform=R.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=R.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function $Ze(e,t,n,i){let o=t.attributes,r=n.length;for(let a=0;a<r;a++){let s=n[a],c=Ke.createVertexBuffer({typedArray:s.typedArray,context:i,usage:Oe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),s.buffer=c,s.typedArray=void 0,o.push(s)}t.propertyAttributeIds=[0]}var Ez=dK;var Gme=new h,Hme=new h,Wme=new h,JZe=new h,ZZe=new h,eet=new h,tet=new de,net=new ce;function hK(e,t,n,i){let o=t*n;return i.x=e[o],i.y=e[o+1],i.z=e[o+2],i}function ND(e,t,n,i,o,r,a){if(!e._ready||n.mode===ie.MORPHING)return;let s=Number.MAX_VALUE;r=r??te.default,i=i??1,o=o??0;let c=n.mode!==ie.SCENE3D?n.mapProjection:void 0;if(Is.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let b=ce.transform(u.boundingSphere,p,net),T=ui.raySphere(t,b);if(!l(T))return}if(!l(f.indices))return;let g,m,A=mt.getAttributeBySemantic(f,it.POSITION);l(A)&&(m=Ft.getNumberOfComponents(A.type),g=Is.readAttributeAsTypedArray(A));let y;if(l(f.indices)&&(y=Is.readIndicesAsTypedArray(f.indices)),!l(y)||!l(g))return;let x=y.length;for(let b=0;b<x;b+=3){let T=y[b],E=y[b+1],S=y[b+2];hK(g,T,m,Gme),hK(g,E,m,Hme),hK(g,S,m,Wme);for(let w of d){let P=R.multiplyByPoint(w.transform,Gme,JZe),O=R.multiplyByPoint(w.transform,Hme,ZZe),B=R.multiplyByPoint(w.transform,Wme,eet);i!==1&&(ho.getPosition(P,r,i,o,P),ho.getPosition(O,r,i,o,O),ho.getPosition(B,r,i,o,B));let L=ui.rayTriangleParametric(t,P,O,B,e.backFaceCulling??!0);l(L)&&L<s&&L>=0&&(s=L)}}}),s!==Number.MAX_VALUE){if(a=An.getPoint(t,s,a),n.mode!==ie.SCENE3D){h.fromElements(a.y,a.z,a.x,a);let u=n.mapProjection,f=u.ellipsoid,d=u.unproject(a,tet);f.cartographicToCartesian(d,a)}return a}}var mK=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},vz=mK;var pK=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],o=n.length;for(let r=0;r<o;r++){let a=n[r],s=a.runtimeNode,c=a.runtimePrimitive,u=new OE(t,s,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,o=[];for(let r=0;r<i.length;r++){let a=i[r];if(l(a))for(let s=0;s<a.runtimePrimitives.length;s++){let c=a.runtimePrimitives[s];o.push({runtimeNode:a,runtimePrimitive:c})}}return o}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new _e("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let o=0;o<i;o++)n[o].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let o=0;o<n.length;o++){let r=n.get(o),a=i[o];if(r.show!==a.show||r.alpha!==a.alpha||r.brightness!==a.brightness||r.contrast!==a.contrast||r.hue!==a.hue||r.saturation!==a.saturation||r.gamma!==a.gamma||r.colorToAlpha!==a.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let o=0;o<n.length;o++){let r=n.get(o);i[o]=new vz(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),fe(this)}},Sz=pK;function Co(e){e=e??G.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??qr.GLTF,this.modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this._modelMatrix=R.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=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 pk(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=U.clone(e.color),this._colorBlendMode=e.colorBlendMode??Pl.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??U.RED;this._silhouetteColor=U.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=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=e.heightReference??nt.NONE,this._heightDirty=this._heightReference!==nt.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=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 I0(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let a=e.clippingPlanes;l(a)&&a.owner===void 0?ba.setOwner(a,this,"_clippingPlanes"):this._clippingPlanes=a,this._clippingPlanesState=0,this._clippingPlanesMatrix=R.clone(R.IDENTITY);let s=e.clippingPolygons;l(s)&&s.owner===void 0?qm.setOwner(s,this,"_clippingPolygons"):this._clippingPolygons=s,this._clippingPolygonsState=0,this._modelImagery=new Sz(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new OC,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new z_(e.environmentMapOptions);z_.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??vn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??_h.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===qr.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new xt(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Vr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this._classificationType=e.classificationType,this._statistics=new Tz,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new ye,this._readyEvent=new ye,this._texturesReadyEvent=new ye,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function gK(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function iet(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let a=i[r],s=new _k({model:e,propertyTable:a});n.push(s)}return n}function oet(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,a,s;for(o=0;o<e.nodes.length;o++)if(s=e.nodes[o],l(s.instances)&&(a=mt.getFeatureIdsByLabel(s.instances.featureIds,i),l(a)&&l(a.propertyTableId)))return a.propertyTableId;for(o=0;o<e.nodes.length;o++)for(s=e.nodes[o],r=0;r<s.primitives.length;r++){let c=s.primitives[r],u=mt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function yK(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(Co.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return 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=kt.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){yK(e,this._color)&&this.resetDrawCommands(),this._color=U.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(!U.equals(e,this._silhouetteColor)){let t=yK(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=U.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 Xme(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===qr.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},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&&(ba.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(qm.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}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},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&&(z_.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}}});Co.prototype.getNode=function(e){return this._nodesByName[e]};Co.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Co.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Co.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Co.prototype.makeStyleDirty=function(){this._styleDirty=!0};Co.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var ret=new R,aet=new $,set=new R;Co.prototype.update=function(e){let t=!1;try{t=cet(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")gK(this,i);else{let o=mt.getError("model",this._resource,i);gK(this,o)}}if(uet(this,e),fet(this,e),det(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let a=mt.getError("model",this._resource,new re("Failed to load model."));gK(a),this._rejectLoad=this._rejectLoad&&this._rejectLoad(a)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&iet(this,o);let r=new bz({model:this,modelComponents:i});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!this._resourcesLoaded||e.mode===ie.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(het(this),met(this),pet(this,e),get(this),_et(this,e),Aet(this,e),yet(this,e),xet(this,e),bet(this,e),Tet(this,e),Cet(this,e),this._defaultTexture=e.context.defaultTexture,Eet(this,e),vet(this,e),wet(this),Iet(this,e),Oet(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)),Pet(this),Met(this,e),Bet(this),Let(this,e)}};function cet(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function uet(e,t){l(e._customShader)&&e._customShader.update(t)}function fet(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 det(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function het(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=oet(t,e),e._styleDirty=!0,e.resetDrawCommands())}function met(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function pet(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&&Yme(e)}function Yme(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=$m.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function get(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 _et(e,t){e._silhouetteDirty&&(Kme(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function Aet(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function yet(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 xet(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 bet(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Tet(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Cet(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 Eet(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function vet(e,t){R.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=R.clone(e.modelMatrix,e._modelMatrix))}var Z_=new h,_K=new de;function wet(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===nt.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??te.default,i=e.modelMatrix;Z_.x=i[12],Z_.y=i[13],Z_.z=i[14];let o=n.cartesianToCartographic(Z_);l(e._clampedModelMatrix)||(e._clampedModelMatrix=R.clone(i,new R)),e._removeUpdateHeightCallback=t.updateHeight(o,qme(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let a=qme(e,n,o);de.clone(o,_K),_K.height=r,a(_K)}e._heightDirty=!1,e._updateModelMatrix=!0}function Iet(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Xme(e,n),Det(e,n,t)}function Xme(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 Det(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);R.getTranslation(t,Z_),e._sceneMode!==ie.SCENE3D&&io.computeActualEllipsoidPosition(n,Z_,Z_);let a=e._boundingSphere.radius,s=Net(Z_,a,n),c=1/s;Math.min(c*(2*a),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*s/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function Pet(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 Ret=new $(1,0,0,0,0,1,0,-1,0);function Oet(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=aet,a=ret;if(a=R.multiply(o.uniformState.view3D,i,a),r=R.getRotation(a,r),r=$.transpose(r,r),e._iblReferenceFrameMatrix=$.multiply(Ret,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let s=set;s=R.multiply(o.uniformState.view3D,i,s),s=R.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=R.inverseTranspose(s,e._clippingPlanesMatrix)}}function Met(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 Bet(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let a=xt.clone(e._credit);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let n=e._resourceCredits,i=n.length;for(let a=0;a<i;a++){let s=xt.clone(n[a]);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let o=e._gltfCredits,r=o.length;for(let a=0;a<r;a++){let s=xt.clone(o[a]);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}}function Let(e,t){let n=ket(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),a=t.passes,s=a.render||a.pick&&e.allowPicking;r&&!e._ignoreCommands&&s&&(zet(e,t),e._sceneGraph.pushDrawCommands(t))}var AK=new ce;function Net(e,t,n){return AK.center=e,AK.radius=t,n.camera.getPixelSize(AK,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var wz=new h;function qme(e,t,n){return function(i){eC(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,wz);let o=e._clampedModelMatrix;R.clone(e.modelMatrix,o),o[12]=wz.x,o[13]=wz.y,o[14]=wz.z,e._heightDirty=!0}}var Fet=new h;function ket(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===ie.SCENE2D){let s=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=s*s}else{let a=R.getTranslation(e.modelMatrix,Fet);io.computeActualEllipsoidPosition(t,a,a),r=h.distanceSquared(a,t.camera.positionWC)}return r>=i&&r<=o}function zet(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}Co.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Co.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Kme(e){return e.context.stencilBuffer}Co.prototype.hasSilhouette=function(e){return Kme(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Co.prototype.hasSkipLevelOfDetail=function(e){if(!qr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Co.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Co.prototype.pick=function(e,t,n,i,o){return ND(this,e,t,n,i,o)};Co.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Co.prototype.isDestroyed=function(){return!1};Co.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let a=0;a<r;a++)t[a].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,fe(this)};Co.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};Co.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Co.fromGltfAsync=async function(e){e=e??G.EMPTY_OBJECT;let t=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=e.basePath??"",o=De.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=De.createIfNeeded(t);let r=new id(n),s=l(e.content)?qr.TILE_GLTF:qr.GLTF,c=n.gltfResource,u=FD(r,s,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),mt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let d=new Co(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(xt.clone(p[m]))}return d};Co.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 tk(t);try{await n.load();let i=FD(n,qr.TILE_B3DM,e);return new Co(i)}catch(i){throw n.destroy(),i}};Co.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new Ez(t);try{await n.load();let i=FD(n,qr.TILE_PNTS,e);return new Co(i)}catch(i){throw n.destroy(),i}};Co.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 ck(t);try{await n.load();let i=FD(n,qr.TILE_I3DM,e);return new Co(i)}catch(i){throw n.destroy(),i}};Co.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new ik(t),i=FD(n,qr.TILE_GEOJSON,e);return new Co(i)};var Uet=new U;Co.prototype.applyColorAndShow=function(e){let t=U.clone(this._color,Uet),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):U.clone(U.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,yK(t,this._color)&&this.resetDrawCommands()};Co.prototype.applyStyle=function(e){let t=this.type===qr.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),Yme(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function FD(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,edgeDisplayMode:n.edgeDisplayMode,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 cd=Co;var xK=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,o=i.featureTableId;return l(o)?i.featureTables[o].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:U.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,o=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=o.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let r=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(r)&&o.clippingPlanesDirty&&(i._clippingPlanes=r.enabled&&o._isClipped?r:void 0);let a=t.environmentMapManager;i.environmentMapManager!==r&&(i._environmentMapManager=a),l(r)&&l(i._clippingPlanes)&&i._clippingPlanes!==r&&(i._clippingPlanes=r,i._clippingPlanesState=0);let s=t.clippingPolygons;l(s)&&o.clippingPolygonsDirty&&(i._clippingPolygons=s.enabled&&o._isClippedByPolygon?s:void 0),l(s)&&l(i._clippingPolygons)&&i._clippingPolygons!==s&&(i._clippingPolygons=s,i._clippingPolygonsState=0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:ef.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),fe(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),s=kD(t,n,r,{gltf:o,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;s.classificationType=c;let u=await cd.fromGltfAsync(s);return r._model=u,r}static async fromB3dm(t,n,i,o,r){let a=new e(t,n,i),c=kD(t,n,a,{arrayBuffer:o,byteOffset:r,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await cd.fromB3dm(c);return a._model=f,a}static async fromI3dm(t,n,i,o,r){let a=new e(t,n,i),c=kD(t,n,a,{arrayBuffer:o,byteOffset:r,resource:i}),u=await cd.fromI3dm(c);return a._model=u,a}static async fromPnts(t,n,i,o,r){let a=new e(t,n,i),c=kD(t,n,a,{arrayBuffer:o,byteOffset:r,resource:i}),u=await cd.fromPnts(c);return a._model=u,a}static async fromGeoJson(t,n,i,o){let r=new e(t,n,i),s=kD(t,n,r,{geoJson:o,resource:i}),c=await cd.fromGeoJson(s);return r._model=c,r}pick(t,n,i){if(!l(this._model)||!this._ready)return;let o=n.verticalExaggeration,r=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,o,r,te.WGS84,i)}};function kD(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ie.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 It(i,o)}var ld=xK;var bK=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,o){let r=new e(t,n,i);return r._tileset.loadTileset(r._resource,o,r._tile),r._ready=!0,r}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return fe(this)}},Iz=bK;var Dz=`uniform sampler2D u_atlas;
  9081. uniform float u_coarseDepthTestDistance;
  9082. uniform float u_threePointDepthTestDistance;
  9083. #ifdef VECTOR_TILE
  9084. uniform vec4 u_highlightColor;
  9085. #endif
  9086. in vec2 v_textureCoordinates;
  9087. in vec4 v_pickColor;
  9088. in vec4 v_color;
  9089. flat in vec2 v_splitDirectionAndEllipsoidDepthEC;
  9090. #ifdef SDF
  9091. in vec4 v_outlineColor;
  9092. in float v_outlineWidth;
  9093. #endif
  9094. in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
  9095. const float SHIFT_LEFT1 = 2.0;
  9096. const float SHIFT_RIGHT1 = 1.0 / 2.0;
  9097. float getGlobeDepthAtCoords(vec2 st)
  9098. {
  9099. float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
  9100. if (logDepthOrDepth == 0.0)
  9101. {
  9102. return 0.0; // not on the globe
  9103. }
  9104. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  9105. return eyeCoordinate.z / eyeCoordinate.w;
  9106. }
  9107. #ifdef SDF
  9108. // Get the distance from the edge of a glyph at a given position sampling an SDF texture.
  9109. float getDistance(vec2 position)
  9110. {
  9111. return texture(u_atlas, position).r;
  9112. }
  9113. // Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
  9114. vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
  9115. {
  9116. float distance = getDistance(position);
  9117. if (outlineWidth > 0.0)
  9118. {
  9119. // Don't get the outline edge exceed the SDF_EDGE
  9120. float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
  9121. float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
  9122. vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
  9123. float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
  9124. return vec4(sdfColor.rgb, sdfColor.a * alpha);
  9125. }
  9126. else
  9127. {
  9128. float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
  9129. return vec4(v_color.rgb, v_color.a * alpha);
  9130. }
  9131. }
  9132. #endif
  9133. bool getDepthTestEnabled() {
  9134. float temp = v_compressed.y;
  9135. temp = temp * SHIFT_RIGHT1;
  9136. float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
  9137. return temp2 != 0.0;
  9138. }
  9139. float getRelativeEyeDepth(float eyeDepth, float distanceToEllipsoid, float epsilon) {
  9140. float depthDifferential = eyeDepth - distanceToEllipsoid;
  9141. float depthRatio = abs(depthDifferential / distanceToEllipsoid);
  9142. if (depthRatio < epsilon) {
  9143. // The approximations are imprecise, so use an epsilon check for small value differences and assume a value of 0.0
  9144. return 0.0;
  9145. }
  9146. return depthDifferential;
  9147. }
  9148. // Extra manual depth testing is done to allow more control over how a billboard is occluded
  9149. // by the globe when near and far from the camera.
  9150. void doDepthTest(float eyeDepth, float globeDepth) {
  9151. #ifdef VS_THREE_POINT_DEPTH_CHECK
  9152. // Since discarding vertices is not possible, the vertex shader sets eyeDepth to 0 to indicate the depth test failed. Apply the discard here.
  9153. if (eyeDepth > -u_threePointDepthTestDistance) {
  9154. if (eyeDepth == 0.0) {
  9155. discard;
  9156. }
  9157. return;
  9158. }
  9159. #endif
  9160. bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance;
  9161. if (useGlobeDepth && globeDepth == 0.0) {
  9162. // Pixel is not on the globe, so there is no distance to compare against. Pass.
  9163. return;
  9164. }
  9165. // If the camera is close, compare against the globe depth texture that includes depth from the 3D tile pass.
  9166. if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) {
  9167. discard;
  9168. }
  9169. }
  9170. #ifdef LOG_DEPTH
  9171. void writeDepth(float eyeDepth, float globeDepth, float distanceToEllipsoid) {
  9172. // If we've made it here, the manual depth test above determined that this fragment should be visible.
  9173. // But the automatic depth test must still run in order to write the result to the depth buffer, and its results may
  9174. // disagree with our manual depth test's results. To prefer our manual results when in front of the globe, apply an offset towards the camera.
  9175. float depthArg = v_depthFromNearPlusOne;
  9176. if (globeDepth != 0.0 && getRelativeEyeDepth(eyeDepth, distanceToEllipsoid, czm_epsilon3) > 0.0) {
  9177. float globeDepthFromNearPlusOne = (-globeDepth - czm_currentFrustum.x) + 1.0;
  9178. float nudge = max(globeDepthFromNearPlusOne * 5e-6, czm_epsilon7);
  9179. float globeOnTop = max(1.0, globeDepthFromNearPlusOne - nudge);
  9180. depthArg = min(depthArg, globeOnTop);
  9181. }
  9182. czm_writeLogDepth(depthArg);
  9183. }
  9184. #endif
  9185. void main()
  9186. {
  9187. if (v_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) {
  9188. discard;
  9189. }
  9190. if (v_splitDirectionAndEllipsoidDepthEC.x > 0.0 && gl_FragCoord.x < czm_splitPosition) {
  9191. discard;
  9192. }
  9193. if (getDepthTestEnabled()) {
  9194. vec2 fragSt = gl_FragCoord.xy / czm_viewport.zw;
  9195. float eyeDepth = v_compressed.x;
  9196. float globeDepth = getGlobeDepthAtCoords(fragSt);
  9197. float distanceToEllipsoid = -v_splitDirectionAndEllipsoidDepthEC.y;
  9198. doDepthTest(eyeDepth, globeDepth);
  9199. #ifdef LOG_DEPTH
  9200. writeDepth(eyeDepth, globeDepth, distanceToEllipsoid);
  9201. #endif
  9202. }
  9203. vec4 color = texture(u_atlas, v_textureCoordinates);
  9204. #ifdef SDF
  9205. float outlineWidth = v_outlineWidth;
  9206. vec4 outlineColor = v_outlineColor;
  9207. // Get the current distance
  9208. float distance = getDistance(v_textureCoordinates);
  9209. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  9210. float smoothing = fwidth(distance);
  9211. // Get an offset that is approximately half the distance to the neighbor pixels
  9212. // 0.354 is approximately half of 1/sqrt(2)
  9213. vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
  9214. // Sample the center point
  9215. vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
  9216. // Sample the 4 neighbors
  9217. vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
  9218. vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
  9219. vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
  9220. vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
  9221. // Equally weight the center sample and the 4 neighboring samples
  9222. color = (center + color1 + color2 + color3 + color4)/5.0;
  9223. #else
  9224. // If no derivatives available (IE 10?), just do a single sample
  9225. float smoothing = 1.0/32.0;
  9226. color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
  9227. #endif
  9228. color = czm_gammaCorrect(color);
  9229. #else
  9230. color = czm_gammaCorrect(color);
  9231. color *= czm_gammaCorrect(v_color);
  9232. #endif
  9233. // Fully transparent parts of the billboard are not pickable.
  9234. #if !defined(OPAQUE) && !defined(TRANSLUCENT)
  9235. if (color.a < 0.005) // matches 0/255 and 1/255
  9236. {
  9237. discard;
  9238. }
  9239. #else
  9240. // The billboard is rendered twice. The opaque pass discards translucent fragments
  9241. // and the translucent pass discards opaque fragments.
  9242. #ifdef OPAQUE
  9243. if (color.a < 0.995) // matches < 254/255
  9244. {
  9245. discard;
  9246. }
  9247. #else
  9248. if (color.a >= 0.995) // matches 254/255 and 255/255
  9249. {
  9250. discard;
  9251. }
  9252. #endif
  9253. #endif
  9254. #ifdef VECTOR_TILE
  9255. color *= u_highlightColor;
  9256. #endif
  9257. out_FragColor = color;
  9258. }
  9259. `;var Pz=`uniform float u_threePointDepthTestDistance;
  9260. in vec2 direction;
  9261. in vec4 positionHighAndScale;
  9262. in vec4 positionLowAndRotation;
  9263. in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
  9264. in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width
  9265. in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
  9266. in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range)
  9267. in vec4 scaleByDistance; // near, nearScale, far, farScale
  9268. in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale
  9269. in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistanceSq, dimensions
  9270. in vec2 sdf; // sdf outline color (rgb) and width (w)
  9271. in float splitDirection; // splitDirection
  9272. #ifdef VS_THREE_POINT_DEPTH_CHECK
  9273. in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates
  9274. #endif
  9275. #ifdef VECTOR_TILE
  9276. in float a_batchId;
  9277. #endif
  9278. out vec2 v_textureCoordinates;
  9279. out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
  9280. out vec4 v_pickColor;
  9281. out vec4 v_color;
  9282. flat out vec2 v_splitDirectionAndEllipsoidDepthEC; // x: splitDirection, y: ellipsoid depth in eye coordinates
  9283. #ifdef SDF
  9284. out vec4 v_outlineColor;
  9285. out float v_outlineWidth;
  9286. #endif
  9287. const float UPPER_BOUND = 32768.0;
  9288. const float SHIFT_LEFT16 = 65536.0;
  9289. const float SHIFT_LEFT12 = 4096.0;
  9290. const float SHIFT_LEFT8 = 256.0;
  9291. const float SHIFT_LEFT7 = 128.0;
  9292. const float SHIFT_LEFT5 = 32.0;
  9293. const float SHIFT_LEFT3 = 8.0;
  9294. const float SHIFT_LEFT2 = 4.0;
  9295. const float SHIFT_LEFT1 = 2.0;
  9296. const float SHIFT_RIGHT12 = 1.0 / 4096.0;
  9297. const float SHIFT_RIGHT8 = 1.0 / 256.0;
  9298. const float SHIFT_RIGHT7 = 1.0 / 128.0;
  9299. const float SHIFT_RIGHT5 = 1.0 / 32.0;
  9300. const float SHIFT_RIGHT3 = 1.0 / 8.0;
  9301. const float SHIFT_RIGHT2 = 1.0 / 4.0;
  9302. const float SHIFT_RIGHT1 = 1.0 / 2.0;
  9303. 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)
  9304. {
  9305. // Note the halfSize cannot be computed in JavaScript because it is sent via
  9306. // compressed vertex attributes that coerce it to an integer.
  9307. vec2 halfSize = imageSize * scale * 0.5;
  9308. halfSize *= ((direction * 2.0) - 1.0);
  9309. vec2 originTranslate = origin * abs(halfSize);
  9310. #if defined(ROTATION) || defined(ALIGNED_AXIS)
  9311. if (validAlignedAxis || rotation != 0.0)
  9312. {
  9313. float angle = rotation;
  9314. if (validAlignedAxis)
  9315. {
  9316. vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);
  9317. angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
  9318. (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
  9319. }
  9320. float cosTheta = cos(angle);
  9321. float sinTheta = sin(angle);
  9322. rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
  9323. halfSize = rotationMatrix * halfSize;
  9324. }
  9325. else
  9326. {
  9327. rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
  9328. }
  9329. #endif
  9330. mpp = czm_metersPerPixel(positionEC);
  9331. positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
  9332. positionEC.xy += (translate + pixelOffset) * mpp;
  9333. return positionEC;
  9334. }
  9335. #ifdef VS_THREE_POINT_DEPTH_CHECK
  9336. float getGlobeDepth(vec4 positionEC)
  9337. {
  9338. vec4 posWC = czm_eyeToWindowCoordinates(positionEC);
  9339. float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));
  9340. if (globeDepth == 0.0)
  9341. {
  9342. return 0.0; // not on the globe
  9343. }
  9344. vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
  9345. return eyeCoordinate.z / eyeCoordinate.w;
  9346. }
  9347. #endif
  9348. void main()
  9349. {
  9350. // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition
  9351. // unpack attributes
  9352. vec3 positionHigh = positionHighAndScale.xyz;
  9353. vec3 positionLow = positionLowAndRotation.xyz;
  9354. float scale = positionHighAndScale.w;
  9355. #if defined(ROTATION) || defined(ALIGNED_AXIS)
  9356. float rotation = positionLowAndRotation.w;
  9357. #else
  9358. float rotation = 0.0;
  9359. #endif
  9360. float compressed = compressedAttribute0.x;
  9361. vec2 pixelOffset;
  9362. pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
  9363. compressed -= pixelOffset.x * SHIFT_LEFT7;
  9364. pixelOffset.x -= UPPER_BOUND;
  9365. vec2 origin;
  9366. origin.x = floor(compressed * SHIFT_RIGHT5);
  9367. compressed -= origin.x * SHIFT_LEFT5;
  9368. origin.y = floor(compressed * SHIFT_RIGHT3);
  9369. compressed -= origin.y * SHIFT_LEFT3;
  9370. origin -= vec2(1.0);
  9371. float show = floor(compressed * SHIFT_RIGHT2);
  9372. compressed -= show * SHIFT_LEFT2;
  9373. vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
  9374. vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
  9375. vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
  9376. float temp = compressedAttribute0.y * SHIFT_RIGHT8;
  9377. pixelOffset.y = -(floor(temp) - UPPER_BOUND);
  9378. vec2 translate;
  9379. translate.y = (temp - floor(temp)) * SHIFT_LEFT16;
  9380. temp = compressedAttribute0.z * SHIFT_RIGHT8;
  9381. translate.x = floor(temp) - UPPER_BOUND;
  9382. translate.x *= SHIFT_RIGHT2; // undo translateX scaling (helps preserve subpixel precision, see BillboardCollection.js attribute writer for more info)
  9383. translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
  9384. translate.y -= UPPER_BOUND;
  9385. translate.y *= SHIFT_RIGHT2;
  9386. temp = compressedAttribute1.x * SHIFT_RIGHT8;
  9387. float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
  9388. vec2 imageSize = vec2(floor(temp), temp2);
  9389. #ifdef EYE_DISTANCE_TRANSLUCENCY
  9390. vec4 translucencyByDistance;
  9391. translucencyByDistance.x = compressedAttribute1.z;
  9392. translucencyByDistance.z = compressedAttribute1.w;
  9393. translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
  9394. temp = compressedAttribute1.y * SHIFT_RIGHT8;
  9395. translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
  9396. #endif
  9397. #ifdef VS_THREE_POINT_DEPTH_CHECK
  9398. temp = compressedAttribute3.w;
  9399. temp = temp * SHIFT_RIGHT12;
  9400. vec2 dimensions;
  9401. dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
  9402. dimensions.x = floor(temp);
  9403. #endif
  9404. #ifdef ALIGNED_AXIS
  9405. vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
  9406. temp = compressedAttribute2.z * SHIFT_RIGHT5;
  9407. bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
  9408. #else
  9409. vec3 alignedAxis = vec3(0.0);
  9410. bool validAlignedAxis = false;
  9411. #endif
  9412. vec4 color = czm_decodeRGB8(compressedAttribute2.x);
  9413. vec4 pickColor = czm_decodeRGB8(compressedAttribute2.y);
  9414. temp = compressedAttribute2.z * SHIFT_RIGHT8;
  9415. bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
  9416. temp = floor(temp) * SHIFT_RIGHT8;
  9417. pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
  9418. pickColor.a /= 255.0;
  9419. color.a = floor(temp);
  9420. color.a /= 255.0;
  9421. ///////////////////////////////////////////////////////////////////////////
  9422. vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  9423. vec4 positionEC = czm_modelViewRelativeToEye * p;
  9424. positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
  9425. positionEC.xyz *= show;
  9426. ///////////////////////////////////////////////////////////////////////////
  9427. #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
  9428. float lengthSq;
  9429. if (czm_sceneMode == czm_sceneMode2D)
  9430. {
  9431. // 2D camera distance is a special case
  9432. // treat all billboards as flattened to the z=0.0 plane
  9433. lengthSq = czm_eyeHeight2D.y;
  9434. }
  9435. else
  9436. {
  9437. lengthSq = dot(positionEC.xyz, positionEC.xyz);
  9438. }
  9439. #endif
  9440. #ifdef EYE_DISTANCE_SCALING
  9441. float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
  9442. scale *= distanceScale;
  9443. translate *= distanceScale;
  9444. // push vertex behind near plane for clipping
  9445. if (scale == 0.0)
  9446. {
  9447. positionEC.xyz = vec3(0.0);
  9448. }
  9449. #endif
  9450. float translucency = 1.0;
  9451. #ifdef EYE_DISTANCE_TRANSLUCENCY
  9452. translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
  9453. // push vertex behind near plane for clipping
  9454. if (translucency == 0.0)
  9455. {
  9456. positionEC.xyz = vec3(0.0);
  9457. }
  9458. #endif
  9459. #ifdef EYE_DISTANCE_PIXEL_OFFSET
  9460. float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
  9461. pixelOffset *= pixelOffsetScale;
  9462. #endif
  9463. #ifdef DISTANCE_DISPLAY_CONDITION
  9464. float nearSq = compressedAttribute3.x;
  9465. float farSq = compressedAttribute3.y;
  9466. if (lengthSq < nearSq || lengthSq > farSq)
  9467. {
  9468. positionEC.xyz = vec3(0.0);
  9469. }
  9470. #endif
  9471. mat2 rotationMatrix;
  9472. float mpp;
  9473. float enableDepthCheck = 1.0;
  9474. #ifdef DISABLE_DEPTH_DISTANCE
  9475. float disableDepthTestDistanceSq = compressedAttribute3.z;
  9476. if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
  9477. {
  9478. disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance;
  9479. }
  9480. if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0)
  9481. {
  9482. enableDepthCheck = 0.0;
  9483. }
  9484. #endif
  9485. v_splitDirectionAndEllipsoidDepthEC.y = czm_infinity;
  9486. vec3 ellipsoidCenter = czm_view[3].xyz;
  9487. vec3 rayDirection = normalize(positionEC.xyz);
  9488. czm_ray ray = czm_ray(vec3(0.0), rayDirection);
  9489. vec3 ellipsoid_inverseRadii = czm_ellipsoidInverseRadii;
  9490. czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
  9491. if (!czm_isEmpty(intersection))
  9492. {
  9493. v_splitDirectionAndEllipsoidDepthEC.y = intersection.start;
  9494. }
  9495. v_compressed.y = enableDepthCheck;
  9496. #ifdef VS_THREE_POINT_DEPTH_CHECK
  9497. if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) {
  9498. float depthsilon = 10.0;
  9499. vec2 depthOrigin;
  9500. // Horizontal origin for labels comes from a special attribute. If that value is 0, this is a billboard - use the regular origin.
  9501. // Otherwise, transform the label origin to -1, 0, 1 (right, center, left).
  9502. depthOrigin.x = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
  9503. depthOrigin.x = czm_branchFreeTernary(depthOrigin.x == 0.0, origin.x, depthOrigin.x - 2.0);
  9504. depthOrigin.y = origin.y;
  9505. vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
  9506. float globeDepth1 = getGlobeDepth(pEC1);
  9507. if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
  9508. {
  9509. vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
  9510. float globeDepth2 = getGlobeDepth(pEC2);
  9511. if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
  9512. {
  9513. vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
  9514. float globeDepth3 = getGlobeDepth(pEC3);
  9515. if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
  9516. {
  9517. // "Discard" this vertex, as three key points fail depth test.
  9518. positionEC.xyz = vec3(0.0);
  9519. }
  9520. }
  9521. }
  9522. }
  9523. #endif
  9524. // Write out the eyespace depth before applying the screen space offset, but after potentially "discarding" the vertex
  9525. // by setting its eyespace position to zero, via the three-point depth test above.
  9526. v_compressed.x = positionEC.z;
  9527. positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
  9528. gl_Position = czm_projection * positionEC;
  9529. v_textureCoordinates = textureCoordinates;
  9530. #ifdef LOG_DEPTH
  9531. czm_vertexLogDepth();
  9532. #endif
  9533. #ifdef DISABLE_DEPTH_DISTANCE
  9534. if (disableDepthTestDistanceSq != 0.0)
  9535. {
  9536. // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
  9537. float zclip = gl_Position.z / gl_Position.w;
  9538. bool clipped = (zclip < -1.0 || zclip > 1.0);
  9539. // disableDepthTestDistanceSq can be less than zero if it's explicitly set to -1 in JS (as a sentinel value equivalent to infinity)
  9540. if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq)))
  9541. {
  9542. // Position z on the near plane.
  9543. gl_Position.z = -gl_Position.w;
  9544. #ifdef LOG_DEPTH
  9545. v_depthFromNearPlusOne = 1.0;
  9546. #endif
  9547. }
  9548. }
  9549. #endif
  9550. #ifdef SDF
  9551. vec4 outlineColor = czm_decodeRGB8(sdf.x);
  9552. float outlineWidth;
  9553. temp = sdf.y;
  9554. temp = temp * SHIFT_RIGHT8;
  9555. float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
  9556. temp = floor(temp) * SHIFT_RIGHT8;
  9557. outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
  9558. outlineColor.a = floor(temp);
  9559. outlineColor.a /= 255.0;
  9560. v_outlineWidth = outlineWidth / 255.0;
  9561. v_outlineColor = outlineColor;
  9562. v_outlineColor.a *= translucency;
  9563. #endif
  9564. v_pickColor = pickColor;
  9565. v_color = color;
  9566. v_color.a *= translucency;
  9567. v_splitDirectionAndEllipsoidDepthEC.x = splitDirection;
  9568. }
  9569. `;var Vet=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),ja=Vet;function xh(e){this._billboardCollection=e,this._id=void 0,this._loadState=ja.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(xh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===ja.LOADED}},hasImage:{get:function(){return this._loadState!==ja.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});xh.prototype.unload=async function(){this._loadState!==ja.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=ja.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};xh.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let o=this._billboardCollection,r=o.billboardTextureCache,a=r.get(e);if(l(a)&&t.loadState===ja.LOADING||t.loadState===ja.LOADED){xh.clone(a,this);return}l(a)||(a=new xh(o),r.set(e,a)),a._id=this._id=e,a._loadState=this._loadState=ja.LOADING,a._loadError=this._loadError=void 0;let s,c=this._billboardCollection.textureAtlas;try{s=c.addImage(e,t,n,i),s instanceof Promise&&(s=await s)}catch(f){if(a._loadState=ja.ERROR,a._loadError=f,this._id!==e)return;this._loadState=ja.ERROR,this._loadError=f;return}if(!l(s)||s===-1){if(a._loadState=ja.FAILED,a._index=-1,this._id!==e)return;this._loadState=ja.FAILED,this._index=-1;return}a._index=s,a._loadState=ja.LOADED;let u=c.rectangles[s];a._width=u.width,a._height=u.height,this._id===e&&(this._index=s,this._loadState=ja.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};xh.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};xh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=ja.LOADING,i=await n}catch(o){this._loadState=ja.ERROR,this._loadError=o;return}this._id===e&&(this._loadState=ja.LOADED,this.setImageSubRegion(i,t))};xh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=ja.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};xh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};xh.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var eA=xh;function Si(e,t){e=e??G.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=kt.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=z.clone(e.pixelOffset??z.ZERO),this._translate=new z(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??nt.NONE,this._verticalOrigin=e.verticalOrigin??zn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Bi.CENTER,this._scale=e.scale??1,this._color=U.clone(e.color??U.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new eA(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let a=e.image;l(a)&&(this._computeImageTextureProperties(e.imageId,a),this._imageTexture.loadImage(this._imageId,a,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ie.SCENE3D,this._clusterShow=!0,this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Vr.NONE,this._positionFromParent=!1}var Qme=Si.SHOW_INDEX=0,Oz=Si.POSITION_INDEX=1,npe=Si.PIXEL_OFFSET_INDEX=2,jet=Si.EYE_OFFSET_INDEX=3,Get=Si.HORIZONTAL_ORIGIN_INDEX=4,Het=Si.VERTICAL_ORIGIN_INDEX=5,Wet=Si.SCALE_INDEX=6,$me=Si.IMAGE_INDEX_INDEX=7,Jme=Si.COLOR_INDEX=8,qet=Si.ROTATION_INDEX=9,Yet=Si.ALIGNED_AXIS_INDEX=10,Xet=Si.SCALE_BY_DISTANCE_INDEX=11,Ket=Si.TRANSLUCENCY_BY_DISTANCE_INDEX=12,Qet=Si.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,$et=Si.DISTANCE_DISPLAY_CONDITION=14,Jet=Si.DISABLE_DEPTH_DISTANCE=15;Si.TEXTURE_COORDINATE_BOUNDS=16;var Zme=Si.SDF_INDEX=17,Zet=Si.SPLIT_DIRECTION_INDEX=18;Si.NUMBER_OF_PROPERTIES=19;function gr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Si.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,gr(this,Qme))}},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(),gr(this,Oz))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),gr(this,Oz))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;z.equals(t,e)||(z.clone(e,t),gr(this,npe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ut.equals(t,e)||(this._scaleByDistance=Ut.clone(e,t),gr(this,Xet))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ut.equals(t,e)||(this._translucencyByDistance=Ut.clone(e,t),gr(this,Ket))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Ut.equals(t,e)||(this._pixelOffsetScaleByDistance=Ut.clone(e,t),gr(this,Qet))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),gr(this,jet))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,gr(this,Get))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,gr(this,Het))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,gr(this,Wet))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),gr(this,Jme))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,gr(this,qet))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),gr(this,Yet))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,gr(this,$me))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,gr(this,$me))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,gr(this,Jme))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){kt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=kt.clone(e,this._distanceDisplayCondition),gr(this,$et))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,gr(this,Jet))}},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._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition),gr(this,Oz)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,gr(this,Qme))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),gr(this,Zme))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,gr(this,Zme))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,gr(this,Zet))}}});Si.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Si.prototype._updateClamping=function(){Si._updateClamping(this._billboardCollection,this)};var Mz=new de;Si._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??te.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===nt.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===nt.NONE||t._positionFromParent||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let a=i.cartesianToCartographic(t._position);if(!l(a)){t._actualClampedPosition=void 0;return}function s(u){let f=i.cartographicToCartesian(u,t._clampedPosition);eC(t._heightReference)&&(t._mode===ie.SCENE3D?(u.height+=a.height,i.cartographicToCartesian(u,f)):f.x+=a.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(a,s,t._heightReference),de.clone(a,Mz);let c=n.getHeight(a,t._heightReference);l(c)&&(Mz.height=c),s(Mz)};Si.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Si.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Si.prototype.setImageTexture=function(e){eA.clone(e,this._imageTexture)};var epe=512;Si.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Hn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Hn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&ett(n)&&(this._imageWidth=Math.min(this._width,epe),this._imageHeight=Math.min(this._height,epe))};function ett(e){return l(e)?gm(e)?e.startsWith("data:image/svg+xml"):Yg(e)==="svg":!1}Si.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Si.prototype._setTranslate=function(e){let t=this._translate;z.equals(t,e)||(z.clone(e,t),gr(this,npe))};Si.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Si.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),gr(this,Oz)};var tpe=new se;Si._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ie.SCENE3D?t:(R.multiplyByPoint(i,t,tpe),io.computeActualEllipsoidPosition(n,tpe))};var ipe=new h;Si._computeScreenSpacePosition=function(e,t,n,i,o,r){let a=R.multiplyByPoint(e,t,ipe),s=io.worldWithEyeOffsetToWindowCoordinates(o,a,n,r);if(l(s))return z.add(s,i,s),s};var Rz=new z(0,0);Si.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new z),z.clone(this._pixelOffset,Rz),z.add(Rz,this._translate,Rz);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ie.SCENE3D)){let a=e.mapProjection,s=a.ellipsoid,c=a.unproject(o,Mz);o=s.cartographicToCartesian(c,ipe),i=R.IDENTITY}return Si._computeScreenSpacePosition(i,o,this._eyeOffset,Rz,e,t)};Si.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let a=t.x;e.horizontalOrigin===Bi.RIGHT?a-=i:e.horizontalOrigin===Bi.CENTER&&(a-=i*.5);let s=t.y;return e.verticalOrigin===zn.BOTTOM||e.verticalOrigin===zn.BASELINE?s-=o:e.verticalOrigin===zn.CENTER&&(s-=o*.5),l(n)||(n=new Je),n.x=a,n.y=s,n.width=i,n.height=o,n};Si.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&U.equals(this._color,e._color)&&z.equals(this._pixelOffset,e._pixelOffset)&&z.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)&&kt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Si.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 wo=Si;var ope={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(ope);var Oi=ope;var ttt={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Xs=Object.freeze(ttt);var ntt=wo.SHOW_INDEX,zD=wo.POSITION_INDEX,ape=wo.PIXEL_OFFSET_INDEX,spe=wo.EYE_OFFSET_INDEX,itt=wo.HORIZONTAL_ORIGIN_INDEX,ott=wo.VERTICAL_ORIGIN_INDEX,rtt=wo.SCALE_INDEX,Px=wo.IMAGE_INDEX_INDEX,cpe=wo.COLOR_INDEX,att=wo.ROTATION_INDEX,stt=wo.ALIGNED_AXIS_INDEX,lpe=wo.SCALE_BY_DISTANCE_INDEX,upe=wo.TRANSLUCENCY_BY_DISTANCE_INDEX,fpe=wo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,dpe=wo.DISTANCE_DISPLAY_CONDITION,ctt=wo.DISABLE_DEPTH_DISTANCE,ltt=wo.TEXTURE_COORDINATE_BOUNDS,hpe=wo.SDF_INDEX,mpe=wo.SPLIT_DIRECTION_INDEX,wK=wo.NUMBER_OF_PROPERTIES,Io={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 fd(e){e=e??G.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new ZT),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,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(wK),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._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this._modelMatrix=R.clone(R.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Oi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=ie.SCENE3D,this._buffersUsage=[Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW],this._highlightColor=U.clone(U.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??te.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??te.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};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(fd.prototype,{length:{get:function(){return IK(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)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function ppe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}fd.prototype.add=function(e){let t=new wo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};fd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};fd.prototype.removeAll=function(){ppe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function IK(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 a=n[o];l(a)&&(a._index=r++,t.push(a))}e._billboards=t}}fd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};fd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};fd.prototype.get=function(e){return IK(this),this._billboards[e]};function rpe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=Ke.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Oe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function utt(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=Ke.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Oe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}fd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<wK;++i){let o=n[i]===0?Oe.STATIC_DRAW:Oe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function ftt(e,t,n,i,o){let r=[{index:Io.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[zD]},{index:Io.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[zD]},{index:Io.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[ape]},{index:Io.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[upe]},{index:Io.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[cpe]},{index:Io.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[spe]},{index:Io.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[lpe]},{index:Io.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[fpe]},{index:Io.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[dpe]},{index:Io.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[ltt]},{index:Io.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[mpe]},{index:Io.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:utt(e)}];return l(i)&&r.push({index:Io.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Oe.STATIC_DRAW}),o&&r.push({index:Io.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[hpe]}),new r_(e,r,t,!0)}var TK=new Tn;function gpe(e,t,n,i){let o=n[Io.positionHighAndScale],r=n[Io.positionLowAndRotation],a=i._getActualPosition();e._mode===ie.SCENE3D&&(ce.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Tn.fromCartesian(a,TK);let s=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,s);let u=TK.high,f=TK.low;o(i._index,u.x,u.y,u.z,s),r(i._index,f.x,f.y,f.z,c)}var tA=new z,ud=32768,DK=65536,CK=4096,Rx=256,dtt=128,htt=32,mtt=8,Bz=4,ptt=1/256,_pe=new Je;function Ape(e,t,n,i){let o=n[Io.compressedAttribute0],r=i.pixelOffset,a=r.x,s=r.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+u),Math.abs(-s+f));let d=i.horizontalOrigin,p=i._verticalOrigin,g=i.show&&i.clusterShow;i.color.alpha===0&&(g=!1),p===zn.BASELINE&&(p=zn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===Bi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===zn.CENTER;let m=0,A=0;if(i.ready){let P=i.computeTextureCoordinates(_pe);m=P.x,A=P.y}let y=Math.floor(D.clamp(a,-ud,ud)+ud)*dtt;y+=(d+1)*htt,y+=(p+1)*mtt,y+=(g?1:0)*Bz;let x=Math.floor(D.clamp(s,-ud,ud)+ud)*Rx,b=Math.floor(D.clamp(u*Bz,-ud,ud)+ud)*Rx,T=(D.clamp(f*Bz,-ud,ud)+ud)*ptt,E=Math.floor(T),S=Math.floor((T-E)*Rx);x+=E,b+=S,tA.x=m,tA.y=A;let w=on.compressTextureCoordinates(tA);o(i._index,y,x,b,w)}function ype(e,t,n,i){let o=n[Io.compressedAttribute1],r=i.alignedAxis;h.equals(r,h.ZERO)||(e._shaderAlignedAxis=!0);let a=0,s=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(a=f.near,s=f.nearValue,c=f.far,u=f.farValue,(s!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let d=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,d);let p=D.clamp(d,0,DK),g=0;Math.abs(h.magnitudeSquared(r)-1)<D.EPSILON6&&(g=on.octEncodeFloat(r)),s=D.clamp(s,0,1),s=s===1?255:s*255|0,p=p*Rx+s,u=D.clamp(u,0,1),u=u===1?255:u*255|0,g=g*Rx+u,o(i._index,p,g,a,c)}function vK(e,t,n,i){let o=n[Io.compressedAttribute2],r=i.color,a=l(e._batchTable)?U.WHITE:i.getPickId(t.context).color,s=i.sizeInMeters?1:0,c=Math.abs(h.magnitudeSquared(i.alignedAxis)-1)<D.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&s===1;let u=i.height??0;e._maxSize=Math.max(e._maxSize,u);let f=i._labelHorizontalOrigin??-2;f+=2;let d=on.encodeRGB8(r),p=on.encodeRGB8(a),g=U.floatToByte(r.alpha)*DK+U.floatToByte(a.alpha)*Rx+(s*2+c),m=u*Bz+f;o(i._index,d,p,g,m)}function SK(e,t,n,i){let o=n[Io.eyeOffset],r=i.eyeOffset,a=r.z;if(i._heightReference!==nt.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(r.x),Math.abs(r.y),Math.abs(a)),tA.x=0,tA.y=0,i.ready){let c=i.computeTextureCoordinates(_pe);tA.x=c.width,tA.y=c.height}let s=on.compressTextureCoordinates(tA);o(i._index,r.x,r.y,a,s)}function xpe(e,t,n,i){let o=n[Io.scaleByDistance],r=0,a=1,s=1,c=1,u=i.scaleByDistance;l(u)&&(r=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderScaleByDistance=!0)),o(i._index,r,a,s,c)}function bpe(e,t,n,i){let o=n[Io.pixelOffsetScaleByDistance],r=0,a=1,s=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(r=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),o(i._index,r,a,s,c)}function Tpe(e,t,n,i){let o=n[Io.compressedAttribute3],r=0,a=Number.MAX_VALUE,s=i.distanceDisplayCondition;l(s)&&(r=s.near,a=s.far,r*=r,a*=a,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=Yf(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,d;l(i._labelDimensions)?(d=i._labelDimensions.x,f=i._labelDimensions.y):(d=i.width??0,f=i.height??0);let p=Math.floor(D.clamp(d,0,CK)),g=Math.floor(D.clamp(f,0,CK)),m=p*CK+g;o(i._index,r,a,c,m)}function Cpe(e,t,n,i){if(Yf(i.heightReference)){let s=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(s.globe)&&s.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let o=n[Io.textureCoordinateBoundsOrLabelTranslate],r=0,a=0;l(i._labelTranslate)&&(r=i._labelTranslate.x,a=i._labelTranslate.y),o(i._index,r,a,0,0)}function gtt(e,t,n,i){if(!l(e._batchTable))return;let o=n[Io.a_batchId],r=i._batchIndex;o(i._index,r)}function Epe(e,t,n,i){if(!e._sdf)return;let o=n[Io.sdf],r=i.outlineColor,a=i.outlineWidth,s=on.encodeRGB8(r),c=a/Xs.RADIUS,u=U.floatToByte(r.alpha)*DK+U.floatToByte(c)*Rx;o(i._index,s,u)}function vpe(e,t,n,i){let o=n[Io.splitDirection],r=0,a=i.splitDirection;l(a)&&(r=a),o(i._index,r)}function _tt(e,t,n,i){gpe(e,t,n,i),Ape(e,t,n,i),ype(e,t,n,i),vK(e,t,n,i),SK(e,t,n,i),xpe(e,t,n,i),bpe(e,t,n,i),Tpe(e,t,n,i),Cpe(e,t,n,i),gtt(e,t,n,i),Epe(e,t,n,i),vpe(e,t,n,i)}function EK(e,t,n,i,o,r){let a;i.mode===ie.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=wo._computeActualPosition(u,f,i,o);l(d)&&(u._setActualPosition(d),r?s.push(d):ce.expand(a,d,a))}r&&ce.fromPoints(s,a)}function Att(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ie.SCENE3D&&!R.equals(r,e.modelMatrix)?(e._mode=n,R.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ie.SCENE3D||n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&EK(e,i,i.length,t,r,!0)):n===ie.MORPHING?EK(e,i,i.length,t,r,!0):(n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&EK(e,o,e._billboardsToUpdateIndex,t,r,!1)}function ytt(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 xtt(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
  9570. in vec2 v_textureCoordinates;
  9571. void main()
  9572. {
  9573. out_FragColor = texture(billboard_texture, v_textureCoordinates);
  9574. }
  9575. `,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ie.OVERLAY,i}var btt=[];fd.prototype.update=function(e){if(IK(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(Mt.maximumVertexTextureImageUnits>0))throw new _e("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,o=!0;for(let P=0;P<i;++P){let O=n[P];l(O.loadError)&&(console.error(`Error loading image for billboard: ${O.loadError}`),O.image=void 0),O.textureDirty&&this._updateBillboard(O,Px),O.show&&(o=o&&O.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;Att(this,e),n=this._billboards,i=n.length;let a=this._billboardsToUpdate,s=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<wK;++P)c[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=ftt(t,i,this._buffersUsage,this._batchTable,this._sdf),d=this._vaf.writers;for(let P=0;P<i;++P){let O=this._billboards[P];O._dirty=!1,O.textureDirty=!1,_tt(this,e,d,O)}this._vaf.commit(rpe(t))}this._billboardsToUpdateIndex=0}else if(s>0){let P=btt;P.length=0,(c[zD]||c[att]||c[rtt])&&P.push(gpe),(c[Px]||c[ape]||c[itt]||c[ott]||c[ntt])&&(P.push(Ape),P.push(SK)),(c[Px]||c[stt]||c[upe])&&(P.push(ype),P.push(vK)),(c[Px]||c[cpe])&&P.push(vK),(c[Px]||c[spe])&&P.push(SK),c[lpe]&&P.push(xpe),c[fpe]&&P.push(bpe),(c[dpe]||c[ctt]||c[Px]||c[zD])&&P.push(Tpe),(c[Px]||c[zD])&&P.push(Cpe),c[hpe]&&P.push(Epe),c[mpe]&&P.push(vpe);let O=P.length;if(d=this._vaf.writers,s/i>.1){for(let B=0;B<s;++B){let L=a[B];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<O;++_)P[_](this,e,d,L)}this._vaf.commit(rpe(t))}else{for(let B=0;B<s;++B){let L=a[B];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<O;++_)P[_](this,e,d,L);this._vaf.subCommit(L._index,1)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(s>i*1.5&&(a.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ce.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,A=R.IDENTITY;e.mode===ie.SCENE3D?(A=this.modelMatrix,m=ce.clone(this._baseVolumeWC,this._boundingVolume)):m=ce.clone(this._baseVolume2D,this._boundingVolume),ytt(this,e,m);let y=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,y){this._blendOption===Oi.OPAQUE||this._blendOption===Oi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Oi.TRANSLUCENT;this._blendOption===Oi.TRANSLUCENT||this._blendOption===Oi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:P?ee.LEQUAL:ee.LESS},depthMask:P,blending:Jt.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,b,T,E,S;if(y||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){x=Pz,b=Dz,S=["INSTANCED"],l(this._batchTable)&&(S.push("VECTOR_TILE"),x=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(x),b=this._batchTable.getFragmentShaderCallback(!1,void 0)(b)),T=new He({defines:S,sources:[x]}),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&T.defines.push("VS_THREE_POINT_DEPTH_CHECK");let P=1-Xs.CUTOFF;this._sdf&&T.defines.push("SDF");let O=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Oi.OPAQUE_AND_TRANSLUCENT&&(E=new He({defines:["OPAQUE",O],sources:[b]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${P}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Io}),E=new He({defines:["TRANSLUCENT",O],sources:[b]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Io})),this._blendOption===Oi.OPAQUE&&(E=new He({defines:[O],sources:[b]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${P}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Io})),this._blendOption===Oi.TRANSLUCENT&&(E=new He({defines:[O],sources:[b]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Io})),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 w=e.commandList;if(p.render||p.pick){let P=this._colorCommands,O=this._blendOption===Oi.OPAQUE,B=this._blendOption===Oi.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,_=L.length,C=this._uniforms,v;l(this._batchTable)?(C=this._batchTable.getUniformMapCallback()(C),v=this._batchTable.getPickId()):v="v_pickColor",P.length=_;let I=B?_*2:_;for(let M=0;M<I;++M){let N=P[M];l(N)||(N=P[M]=new tt);let j=O||B&&M%2===0;N.pass=j||!B?Ie.OPAQUE:Ie.TRANSLUCENT,N.owner=this;let k=B?Math.floor(M/2):M;N.boundingVolume=m,N.modelMatrix=A,N.count=L[k].indicesCount,N.shaderProgram=j?this._sp:this._spTranslucent,N.uniformMap=C,N.vertexArray=L[k].va,N.renderState=j?this._rsOpaque:this._rsTranslucent,N.debugShowBoundingVolume=this.debugShowBoundingVolume,N.pickId=v,N.count=6,N.instanceCount=i,w.push(N)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=xtt(this,e.context)),w.push(this.debugCommand))}this._allBillboardsReady=o};fd.prototype.isDestroyed=function(){return!1};fd.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(),ppe(this._billboards),fe(this)};var dd=fd;function Ttt(e,t,n,i,o){return function(){let r=document.createElement("canvas"),a=o+2*i;r.height=r.width=a;let s=r.getContext("2d");return s.clearRect(0,0,a,a),i!==0&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=n,s.fill(),e<1&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,o/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,o/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),r}}var LE=Ttt;var Ctt=new de,bh=class{constructor(t,n,i,o,r){this._content=t,this._billboard=i,this._label=o,this._polyline=r,this._batchId=n,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),NE(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=U.clone(t,this._color),NE(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,NE(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=U.clone(t,this._pointOutlineColor),NE(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,NE(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,o=i.cartesianToCartographic(this._billboard.position,Ctt);o.height=o.height-n+t;let r=i.cartographicToCartesian(o);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=U.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&NE(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return as.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};lt(bh,"defaultColor",U.WHITE),lt(bh,"defaultPointOutlineColor",U.BLACK),lt(bh,"defaultPointOutlineWidth",0),lt(bh,"defaultPointSize",8);function NE(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=e._color??bh.defaultColor,i=e._pointOutlineColor??bh.defaultPointOutlineColor,o=e._pointOutlineWidth??bh.defaultPointOutlineWidth,r=e._pointSize??bh.defaultPointSize,a=e._billboardColor,s=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(U.equals(n,a)&&U.equals(i,s)&&o===c&&r===u)return;e._billboardColor=U.clone(n,e._billboardColor),e._billboardOutlineColor=U.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,r,p,o]);t.setImage(g,LE(f,d,p,o,r))}var nA=bh;function Ett(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let o=Math.round(n.actualBoundingBoxAscent),r=Math.round(n.actualBoundingBoxDescent),a=Math.max(o+r,1);return{width:n.width,height:a,ascent:o,descent:r,minx:-Math.round(n.actualBoundingBoxLeft)}}var Ox;function vtt(e,t){if(e==="")return;t=t??G.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,a=t.backgroundColor??U.TRANSPARENT,s=t.padding??0,c=s*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(Ox)||(l(f.imageSmoothingEnabled)?Ox="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Ox="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Ox="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Ox="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[Ox]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=Ett(f,e);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),g=i&&!p?Math.ceil(r/2):0,m=g*2,A=-d.minx+g,y=Math.ceil(d.width)+A+c+g,x=d.height+c+m,b=d.ascent+s+g;if(u.width=y,u.height=x,f.font=n,f.lineJoin="round",f.lineWidth=r,f[Ox]=!1,a!==U.TRANSPARENT&&(f.fillStyle=a.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=t.strokeColor??U.BLACK;f.strokeStyle=T.toCssColorString(),f.strokeText(e,A+s,b)}if(o){let T=t.fillColor??U.WHITE;f.fillStyle=T.toCssColorString(),f.fillText(e,A+s,b)}return u}var FE=vtt;var kpe=Na(Dpe(),1);var Ppe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(Ppe);var _r=Ppe;var Rpe={},Ope=0,wtt=256,Itt=new U(.165,.165,.165,.8),Dtt=new z(7,5),Ga=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Mx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function VD(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function jD(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Bpe(e){let t=Rpe[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(jD(n,"line-height"));isNaN(i)&&(i=void 0),t={family:jD(n,"font-family"),size:jD(n,"font-size").replace("px",""),style:jD(n,"font-style"),weight:jD(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Ope<wtt&&(Rpe[e._font]=t,Ope++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Th(e,t){e=e??G.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=kt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=U.clone(e.fillColor??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=U.clone(e.backgroundColor??Itt),this._backgroundPadding=z.clone(e.backgroundPadding??Dtt),this._style=e.style??_r.FILL,this._verticalOrigin=e.verticalOrigin??zn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Bi.LEFT,this._pixelOffset=z.clone(e.pixelOffset??z.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??nt.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=e.text??"",this._relativeSize=1,Bpe(this),this._updateClamping()}Object.defineProperties(Th.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 a=n[o].billboard;l(a)&&(a.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),VD(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Th.filterUnsupportedCharacters(e);this._renderedText=Th.enableRightToLeftDetection?Ltt(t):t,Mx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,Mx(this),Bpe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;U.equals(t,e)||(U.clone(e,t),Mx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Mx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Mx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,Mx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!U.equals(t,e)){U.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;z.equals(t,e)||(z.clone(e,t),VD(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,Mx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!z.equals(t,e)){z.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.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 a=n[o];l(a.billboard)&&(a.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 a=n[o];l(a.billboard)&&(a.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 a=n[o];l(a.billboard)&&(a.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 a=n[o];l(a.billboard)&&(a.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,VD(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),VD(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),VD(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!kt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=kt.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)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});Th.prototype._updateClamping=function(){wo._updateClamping(this._labelCollection,this)};Th.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new z);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return wo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};Th.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,a=0,s=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*s,a=c.height*s,e.verticalOrigin===zn.BOTTOM||e.verticalOrigin===zn.BASELINE?o-=a:e.verticalOrigin===zn.CENTER&&(o-=a*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],A=m.billboard;if(!l(A))continue;let y=t.x+A._translate.x,x=t.y-A._translate.y,b=m.dimensions.width*s,T=m.dimensions.height*s;e.verticalOrigin===zn.BOTTOM||e.verticalOrigin===zn.BASELINE?x-=T:e.verticalOrigin===zn.CENTER&&(x-=T*.5),e._verticalOrigin===zn.TOP?x+=Xs.PADDING*s:(e._verticalOrigin===zn.BOTTOM||e._verticalOrigin===zn.BASELINE)&&(x-=Xs.PADDING*s),i=Math.min(i,y),o=Math.min(o,x),u=Math.max(u,y+b),f=Math.max(f,x+T)}r=u-i,a=f-o}return l(n)||(n=new Je),n.x=i,n.y=o,n.width=r,n.height=a,n};Th.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Th.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)&&U.equals(this._fillColor,e._fillColor)&&U.equals(this._outlineColor,e._outlineColor)&&U.equals(this._backgroundColor,e._backgroundColor)&&z.equals(this._backgroundPadding,e._backgroundPadding)&&z.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)&&kt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Th.prototype.isDestroyed=function(){return!1};Th.enableRightToLeftDetection=!1;function Ptt(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",a=Ga.LTR,s="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?s=Ga.RTL:n.test(f)?s=Ga.LTR:i.test(f)?s=Ga.BRACKETS:s=Ga.WEAK,u===0&&(a=s),a===s&&s!==Ga.BRACKETS?r+=f:(r!==""&&o.push({Type:a,Word:r}),a=s,r=f)}return o.push({Type:s,Word:r}),o}function Rtt(e){return e.split("").reverse().join("")}function GD(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Ott(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Mtt="\u05D0-\u05EA",Btt="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Mpe=new RegExp(`[${Mtt}${Btt}]`);function Ltt(e){let t=e.split(`
  9576. `),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Mpe.test(o.charAt(0)),a=Ptt(o,Mpe),s=0,c="";for(let u=0;u<a.length;++u){let f=a[u],d=f.Type===Ga.BRACKETS?Ott(f.Word):Rtt(f.Word);r?f.Type===Ga.RTL?(c=d+c,s=0):f.Type===Ga.LTR?(c=GD(c,s,f.Word),s+=f.Word.length):(f.Type===Ga.WEAK||f.Type===Ga.BRACKETS)&&(f.Type===Ga.WEAK&&a[u-1].Type===Ga.BRACKETS?c=d+c:a[u-1].Type===Ga.RTL?(c=d+c,s=0):a.length>u+1?a[u+1].Type===Ga.RTL?(c=d+c,s=0):(c=GD(c,s,f.Word),s+=f.Word.length):c=GD(c,0,d)):f.Type===Ga.RTL?c=GD(c,s,d):f.Type===Ga.LTR?(c+=f.Word,s=c.length):(f.Type===Ga.WEAK||f.Type===Ga.BRACKETS)&&(u>0&&a[u-1].Type===Ga.RTL?a.length>u+1?a[u+1].Type===Ga.RTL?c=GD(c,s,d):(c+=f.Word,s=c.length):c+=f.Word:(c+=f.Word,s=c.length))}n+=c,i<t.length-1&&(n+=`
  9577. `)}return n}var Bx=Th;var zpe=Na(Lpe(),1);function Ftt(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var ktt=1.2,Npe="ID_WHITE_PIXEL",PK=new z(4,4),ztt=new Je(1,1,1,1);function Utt(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=PK.x,o.height=PK.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(Npe,o),n.addImageSubRegion(Npe,ztt)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new z,i}var F0={};function Vtt(e,t,n,i,o,r){return F0.font=t,F0.fillColor=n,F0.strokeColor=i,F0.strokeWidth=o,F0.padding=Xs.PADDING,F0.fill=r===_r.FILL||r===_r.FILL_AND_OUTLINE,F0.stroke=r===_r.OUTLINE||r===_r.FILL_AND_OUTLINE,F0.backgroundColor=U.BLACK,FE(e,F0)}function RK(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var jtt=new zpe.default,Gtt=/\s/;function Htt(e,t){let n=t._renderedText,i=jtt.splitGraphemes(n),o=i.length,r=t._glyphs,a=r.length;if(t._relativeSize=t._fontSize/Xs.FONT_SIZE,o<a)for(let p=o;p<a;++p)RK(e,r[p]);r.length=o;let s=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(s)&&(s=Utt(c,e),t._backgroundBillboard=s),Wtt(c,t,s);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,d=e._textDimensionsCache;for(let p=0;p<o;++p){let g=i[p],m=t._verticalOrigin,A=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+m]),y=d[A],x=f.get(A);if(!l(x)||!l(y)){x=new eA(u),f.set(A,x);let S=`${t._fontStyle} ${t._fontWeight} ${Xs.FONT_SIZE}px ${t._fontFamily}`,w=Vtt(g,S,U.WHITE,U.WHITE,0,_r.FILL);if(y=w.dimensions,d[A]=y,w.width>0&&w.height>0&&!Gtt.test(g)){let P=(0,kpe.default)(w,{cutoff:Xs.CUTOFF,radius:Xs.RADIUS}),O=w.getContext("2d"),B=w.width,L=w.height,_=O.getImageData(0,0,B,L);for(let C=0;C<B;C++)for(let v=0;v<L;v++){let I=v*B+C,M=P[I]*255,N=I*4;_.data[N+0]=M,_.data[N+1]=M,_.data[N+2]=M,_.data[N+3]=M}O.putImageData(_,0,0),x.loadImage(A,w)}}let b=r[p];if(l(b)||(b=new Ftt,b.dimensions=y,b.billboardTexture=x,r[p]=b),b.billboardTexture.id!==A&&(b.billboardTexture=x,b.dimensions=y),!x.hasImage){RK(e,b);continue}let T=b.billboard,E=e._spareBillboards;l(T)||(E.length>0?T=E.pop():(T=u.add({collection:e}),T._labelDimensions=new z,T._labelTranslate=new z,T._positionFromParent=!0),b.billboard=T),T.setImageTexture(x),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=Bi.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,l(t._clampedPosition)&&(T._clampedPosition=t._clampedPosition),T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===_r.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===_r.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===_r.OUTLINE&&(T.color=U.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function Wtt(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(`
  9578. `).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=n=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Bi.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function Fpe(e,t,n){return t===Bi.CENTER?-e/2:t===Bi.RIGHT?-(e+n.x):n.x}var Dr=new z,qtt=new z;function Ytt(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],a=Number.NEGATIVE_INFINITY,s=0,c=1,u=t.length,f=e._backgroundBillboard,d=z.clone(l(f)?e._backgroundPadding:z.ZERO,qtt);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let B=0;B<u;++B){if(n.charAt(B)===`
  9579. `){r.push(i),++c,i=0;continue}let _=t[B].dimensions;l(_)&&(s=Math.max(s,_.height-_.descent),a=Math.max(a,_.descent),i+=_.width-_.minx,B<u-1&&(i+=t[B+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=s+a,g=e.totalScale,m=e._horizontalOrigin,A=e._verticalOrigin,y=0,x=r[y],b=Fpe(x,m,d),T=(l(e._lineHeight)?e._lineHeight:ktt*e._fontSize)/e._relativeSize,E=T*(c-1),S=o,w=p+E;l(f)&&(S+=d.x*2,w+=d.y*2,f._labelHorizontalOrigin=m),Dr.x=b*g,Dr.y=0;let P=!0,O=0;for(let B=0;B<u;++B){if(n.charAt(B)===`
  9580. `){++y,O+=T,x=r[y],b=Fpe(x,m,d),Dr.x=b*g,P=!0;continue}let L=t[B],_=L.dimensions;if(l(_)&&(A===zn.TOP?(Dr.y=_.height-s-d.y,Dr.y+=Xs.PADDING):A===zn.CENTER?Dr.y=(E+_.height-s)/2:A===zn.BASELINE?(Dr.y=E,Dr.y-=Xs.PADDING):(Dr.y=E+a+d.y,Dr.y-=Xs.PADDING),Dr.y=(Dr.y-_.descent-O)*g,P&&(Dr.x-=Xs.PADDING*g,P=!1),l(L.billboard)&&(L.billboard._setTranslate(Dr),L.billboard._labelDimensions.x=S,L.billboard._labelDimensions.y=w,L.billboard._labelHorizontalOrigin=m,Yf(e.heightReference)&&(L.billboard._labelTranslate=z.clone(Dr,L.billboard._labelTranslate))),B<u-1)){let C=t[B+1];Dr.x+=(_.width-_.minx+C.dimensions.minx)*g}}l(f)&&n.split(`
  9581. `).join("").length>0&&(m===Bi.CENTER?b=-o/2-d.x:m===Bi.RIGHT?b=-(o+d.x*2):b=0,Dr.x=b*g,A===zn.TOP?Dr.y=p-s-a:A===zn.CENTER?Dr.y=(p-s)/2-a:A===zn.BASELINE?Dr.y=-d.y-a:Dr.y=0,Dr.y=Dr.y*g,f.width=S,f.height=w,f._setTranslate(Dr),f._labelTranslate=z.clone(Dr,f._labelTranslate))}function Upe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)RK(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),fe(t)}function op(e){e=e??G.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new dd({scene:this._scene,textureAtlas:new ZT({initialSize:PK}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new eA(t),this._glyphBillboardCollection=new dd({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=U.clone(U.WHITE),this.show=e.show??!0,this.modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Oi.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(op.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});op.prototype.add=function(e){let t=new Bx(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};op.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),Upe(this,e),!0}return!1};op.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Upe(this,e[t]);e.length=0};op.prototype.contains=function(e){return l(e)&&e._labelCollection===this};op.prototype.get=function(e){return this._labels[e]};op.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let r=0;r<i;++r){let a=this._labelsToUpdate[r];if(a.isDestroyed())continue;let s=a._glyphs.length;a._rebindAllGlyphs&&(Htt(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(Ytt(a),a._repositionAllGlyphs=!1);let c=a._glyphs.length-s;this._totalGlyphCount+=c}let o=n.length>0?Oi.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};op.prototype.isDestroyed=function(){return!1};op.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),fe(this)};var k0=op;var Nz=`in vec3 position3DHigh;
  9582. in vec3 position3DLow;
  9583. in vec3 position2DHigh;
  9584. in vec3 position2DLow;
  9585. in vec3 prevPosition3DHigh;
  9586. in vec3 prevPosition3DLow;
  9587. in vec3 prevPosition2DHigh;
  9588. in vec3 prevPosition2DLow;
  9589. in vec3 nextPosition3DHigh;
  9590. in vec3 nextPosition3DLow;
  9591. in vec3 nextPosition2DHigh;
  9592. in vec3 nextPosition2DLow;
  9593. in vec4 texCoordExpandAndBatchIndex;
  9594. out vec2 v_st;
  9595. out float v_width;
  9596. out vec4 v_pickColor;
  9597. out float v_polylineAngle;
  9598. void main()
  9599. {
  9600. float texCoord = texCoordExpandAndBatchIndex.x;
  9601. float expandDir = texCoordExpandAndBatchIndex.y;
  9602. bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;
  9603. float batchTableIndex = texCoordExpandAndBatchIndex.w;
  9604. vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);
  9605. float width = widthAndShow.x + 0.5;
  9606. float show = widthAndShow.y;
  9607. if (width < 1.0)
  9608. {
  9609. show = 0.0;
  9610. }
  9611. vec4 pickColor = batchTable_getPickColor(batchTableIndex);
  9612. vec4 p, prev, next;
  9613. if (czm_morphTime == 1.0)
  9614. {
  9615. p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);
  9616. prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);
  9617. next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);
  9618. }
  9619. else if (czm_morphTime == 0.0)
  9620. {
  9621. p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
  9622. prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);
  9623. next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);
  9624. }
  9625. else
  9626. {
  9627. p = czm_columbusViewMorph(
  9628. czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),
  9629. czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),
  9630. czm_morphTime);
  9631. prev = czm_columbusViewMorph(
  9632. czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),
  9633. czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),
  9634. czm_morphTime);
  9635. next = czm_columbusViewMorph(
  9636. czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),
  9637. czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),
  9638. czm_morphTime);
  9639. }
  9640. #ifdef DISTANCE_DISPLAY_CONDITION
  9641. vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);
  9642. vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);
  9643. vec3 centerLow = centerLowAndRadius.xyz;
  9644. float radius = centerLowAndRadius.w;
  9645. vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);
  9646. float lengthSq;
  9647. if (czm_sceneMode == czm_sceneMode2D)
  9648. {
  9649. lengthSq = czm_eyeHeight2D.y;
  9650. }
  9651. else
  9652. {
  9653. vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);
  9654. lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);
  9655. }
  9656. float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
  9657. float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
  9658. if (lengthSq < nearSq || lengthSq > farSq)
  9659. {
  9660. show = 0.0;
  9661. }
  9662. #endif
  9663. float polylineAngle;
  9664. vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);
  9665. gl_Position = czm_viewportOrthographic * positionWC * show;
  9666. v_st.s = texCoord;
  9667. v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
  9668. v_width = width;
  9669. v_pickColor = pickColor;
  9670. v_polylineAngle = polylineAngle;
  9671. }
  9672. `;var Bl={};Bl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Bl.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 Xtt=new de;Bl.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,Xtt).height}return i};var Ktt=new R,Qtt=new h,Vpe=new h,$tt=new tn(h.UNIT_X,0),jpe=new h,Jtt=new tn(h.UNIT_X,0),Ztt=new h,ent=new h,MK=[];function Hpe(e,t,n){let i=MK;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let a=(n-t)/e;for(o=0;o<e;o++){let s=t+o*a;i[o]=s}return i}var kz=new de,Fz=new de,iA=new h,BK=new h,tnt=new h,OK=new u_,HD=new jc;function nnt(e,t,n,i,o,r,a,s){let c=i.scaleToGeodeticSurface(e,BK),u=i.scaleToGeodeticSurface(t,tnt),f=Bl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,kz),p=i.cartesianToCartographic(u,Fz),g=Hpe(f,o,r);OK.setEndPoints(d,p);let m=OK.surfaceDistance/f,A=s;d.height=o;let y=i.cartographicToCartesian(d,iA);h.pack(y,a,A),A+=3;for(let x=1;x<f;x++){let b=OK.interpolateUsingSurfaceDistance(x*m,Fz);b.height=g[x],y=i.cartographicToCartesian(b,iA),h.pack(y,a,A),A+=3}return A}function int(e,t,n,i,o,r,a,s){let c=i.cartesianToCartographic(e,kz),u=i.cartesianToCartographic(t,Fz),f=Bl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=Hpe(f,o,r);HD.ellipsoid.equals(i)||(HD=new jc(void 0,void 0,i)),HD.setEndPoints(c,u);let p=HD.surfaceDistance/f,g=s;c.height=o;let m=i.cartographicToCartesian(c,iA);h.pack(m,a,g),g+=3;for(let A=1;A<f;A++){let y=HD.interpolateUsingSurfaceDistance(A*p,Fz);y.height=d[A],m=i.cartographicToCartesian(y,iA),h.pack(m,a,g),g+=3}return g}Bl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??R.IDENTITY;let o=R.inverseTransformation(t,Ktt),r=R.multiplyByPoint(o,h.ZERO,Qtt),a=h.normalize(R.multiplyByPointAsVector(o,h.UNIT_Y,Vpe),Vpe),s=tn.fromPointNormal(r,a,$tt),c=h.normalize(R.multiplyByPointAsVector(o,h.UNIT_X,jpe),jpe),u=tn.fromPointNormal(r,c,Jtt),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(tn.getPointDistance(u,d)<0||tn.getPointDistance(u,m)<0){let A=ui.lineSegmentPlane(d,m,s,Ztt);if(l(A)){let y=h.multiplyByScalar(a,5e-9,ent);tn.getPointDistance(s,d)<0&&h.negate(y,y),n.push(h.add(A,y,new h)),i.push(f+1),h.negate(y,y),n.push(h.add(A,y,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};Bl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let A=i.scaleToGeodeticSurface(t[0],BK);if(o=r?o[0]:o,o!==0){let y=i.geodeticSurfaceNormal(A,iA);h.multiplyByScalar(y,o,y),h.add(A,y,A)}return[A.x,A.y,A.z]}let a=e.minDistance;if(!l(a)){let A=e.granularity??D.RADIANS_PER_DEGREE;a=D.chordLength(A,i.maximumRadius)}let s=0,c;for(c=0;c<n-1;c++)s+=Bl.numberOfPoints(t[c],t[c+1],a);let u=(s+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let A=t[c],y=t[c+1],x=r?o[c]:o,b=r?o[c+1]:o;d=nnt(A,y,a,i,x,b,f,d)}MK.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,kz);g.height=r?o[n-1]:o;let m=i.cartographicToCartesian(g,iA);return h.pack(m,f,u-3),f};var Gpe=new de,ont=new de;Bl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],BK);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(x,iA);h.multiplyByScalar(b,o,b),h.add(x,b,x)}return[x.x,x.y,x.z]}let a=e.granularity??D.RADIANS_PER_DEGREE,s=0,c,u=i.cartesianToCartographic(t[0],Gpe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],ont),s+=Bl.numberOfPointsRhumbLine(u,f,a),u=de.clone(f,Gpe);let d=(s+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let x=t[c],b=t[c+1],T=r?o[c]:o,E=r?o[c+1]:o;g=int(x,b,a,i,T,E,p,g)}MK.length=0;let m=t[n-1],A=i.cartesianToCartographic(m,kz);A.height=r?o[n-1]:o;let y=i.cartographicToCartesian(A,iA);return h.pack(y,p,d-3),p};Bl.generateCartesianArc=function(e){let t=Bl.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};Bl.generateCartesianRhumbArc=function(e){let t=Bl.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 $i=Bl;function of(e,t){e=e??G.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=qi.fromType(qi.ColorType,{color:new U(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Fo(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=R.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=$i.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(qpe),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 Wpe=of.POSITION_INDEX=0,rnt=of.SHOW_INDEX=1,ant=of.WIDTH_INDEX=2,snt=of.MATERIAL_INDEX=3,WD=of.POSITION_SIZE_INDEX=4,cnt=of.DISTANCE_DISPLAY_CONDITION=5,qpe=of.NUMBER_OF_PROPERTIES=6;function z0(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(of.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,z0(this,rnt))}},positions:{get:function(){return this._positions},set:function(e){let t=Fo(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)&&z0(this,WD),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),z0(this,Wpe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,z0(this,snt))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,z0(this,ant))}},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,z0(this,WD)}}},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){kt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=kt.clone(e,this._distanceDisplayCondition),z0(this,cnt))}}});of.prototype.update=function(){let e=R.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Wpe]>0||this._propertiesChanged[WD]>0;if((!R.equals(e,this._modelMatrix)||i)&&(this._segments=$i.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ce.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=R.clone(e,this._modelMatrix),this._segments.positions.length!==t)z0(this,WD);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){z0(this,WD);break}}};of.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};of.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<qpe-1;++t)e[t]=0};of.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Ch=of;var lnt=Ch.SHOW_INDEX,unt=Ch.WIDTH_INDEX,NK=Ch.POSITION_INDEX,fnt=Ch.MATERIAL_INDEX,Ype=Ch.POSITION_SIZE_INDEX,dnt=Ch.DISTANCE_DISPLAY_CONDITION,e0e=Ch.NUMBER_OF_PROPERTIES,xu={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 Eh(e){e=e??G.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this._modelMatrix=R.clone(R.IDENTITY),this.debugShowBoundingVolume=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(e0e),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Oe.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=U.clone(U.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Eh.prototype,{length:{get:function(){return FK(this),this._polylines.length}}});Eh.prototype.add=function(e){let t=new Ch(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Eh.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};Eh.prototype.removeAll=function(){kK(this),r0e(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Eh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Eh.prototype.get=function(e){return FK(this),this._polylines[e]};function hnt(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Y.FLOAT,componentsPerAttribute:2}];e._batchTable=new aC(t,n,e._polylines.length)}var t0e=new Tn,n0e=new se,i0e=new z;Eh.prototype.update=function(e){if(FK(this),this._polylines.length===0||!this.show)return;ynt(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Mt.maximumVertexTextureImageUnits===0)throw new re("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");hnt(this,t),this._createBatchTable=!1}if(this._createVertexArray||pnt(this))Qpe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ie.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[Ype]||o[fnt])Qpe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],o=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[NK]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((o[lnt]||o[unt])&&this._batchTable.setBatchedAttribute(i._index,0,new z(i._width,i._show)),this._batchTable.attributes.length>2){if(o[NK]||o[Ype]){let m=e.mode===ie.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,A=Tn.fromCartesian(m.center,t0e),y=se.fromElements(A.low.x,A.low.y,A.low.z,m.radius,n0e);this._batchTable.setBatchedAttribute(i._index,2,A.high),this._batchTable.setBatchedAttribute(i._index,3,y)}if(o[dnt]){let m=i0e;m.x=0,m.y=Number.MAX_VALUE;let A=i.distanceDisplayCondition;l(A)&&(m.x=A.near,m.y=A.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<e0e;++c)o[c]=0;let r=R.IDENTITY;e.mode===ie.SCENE3D&&(r=this.modelMatrix);let a=e.passes,s=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==s)&&(this._opaqueRS=Ve.fromCache({depthMask:s,depthTest:{enabled:s}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==s)&&(this._translucentRS=Ve.fromCache({blending:Jt.ALPHA_BLEND,depthMask:!s,depthTest:{enabled:s}})),this._batchTable.update(e),a.render||a.pick){let c=this._colorCommands;mnt(this,e,c,r)}};var qD=new ce,Xpe=new ce;function mnt(e,t,n,i){let o=t.context,r=t.commandList,a=n.length,s=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let A=u[m],y=A.buckets,x=y.length;for(let b=0;b<x;++b){let T=y[b],E=T.offset,S=T.bucket.shaderProgram,w=T.bucket.polylines,P=w.length,O,B,L=0,_,C;for(let v=0;v<P;++v){let I=w[v],M=_nt(I._material);if(M!==O){if(l(O)&&L>0){let V=B.isTranslucent();s>=a?(_=new tt({owner:e}),n.push(_)):_=n[s],++s,C=It(p(B._uniforms),e._uniformMap),_.boundingVolume=ce.clone(qD,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=S,_.vertexArray=A.va,_.renderState=V?e._translucentRS:e._opaqueRS,_.pass=V?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,E+=L,L=0,c=!0,r.push(_)}B=I._material,B.update(o),O=M}let N=I._locatorBuckets,j=N.length;for(let V=0;V<j;++V){let F=N[V];F.locator===T&&(L+=F.count)}let k;t.mode===ie.SCENE3D?k=I._boundingVolumeWC:t.mode===ie.COLUMBUS_VIEW?k=I._boundingVolume2D:t.mode===ie.SCENE2D?l(I._boundingVolume2D)&&(k=ce.clone(I._boundingVolume2D,Xpe),k.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(k=ce.union(I._boundingVolumeWC,I._boundingVolume2D,Xpe)),c?(c=!1,ce.clone(k,qD)):ce.union(k,qD,qD)}l(O)&&L>0&&(s>=a?(_=new tt({owner:e}),n.push(_)):_=n[s],++s,C=It(p(B._uniforms),e._uniformMap),_.boundingVolume=ce.clone(qD,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=S,_.vertexArray=A.va,_.renderState=B.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=B.isTranslucent()?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,c=!0,r.push(_)),O=void 0}}n.length=s}Eh.prototype.isDestroyed=function(){return!1};Eh.prototype.destroy=function(){return o0e(this),kK(this),r0e(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),fe(this)};function pnt(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[NK]?(i.bufferUsage!==Oe.STREAM_DRAW&&(t=!0,i.bufferUsage=Oe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Oe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Oe.STATIC_DRAW):i.frameCount--),t}var Kpe=[0,0,0];function Qpe(e,t,n){e._createVertexArray=!1,kK(e),o0e(e),Ant(e);let i=[[]],o=i[0],r=e._batchTable,a=e._useHighlightColor,s=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,r,a),f+=g.lengthOfPositions);if(f>0){let m=e._mode,A=new Float32Array(6*f*3),y=new Float32Array(f*4),x,b=0,T=0,E=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(A,y,b,T,E,r,t,n),m===ie.MORPHING&&(l(x)||(x=new Float32Array(6*f*3)),g.writeForMorph(x,b));let C=g.lengthOfPositions;b+=6*C*3,T+=C*4,E+=C*4,c=g.updateIndices(i,s,u,c)}let S=e._positionBufferUsage.bufferUsage,w=Oe.STATIC_DRAW;e._positionBuffer=Ke.createVertexBuffer({context:t,typedArray:A,usage:S});let P;l(x)&&(P=Ke.createVertexBuffer({context:t,typedArray:x,usage:S})),e._texCoordExpandAndBatchIndexBuffer=Ke.createVertexBuffer({context:t,typedArray:y,usage:w});let O=3*Float32Array.BYTES_PER_ELEMENT,B=4*Float32Array.BYTES_PER_ELEMENT,L=0,_=i.length;for(let C=0;C<_;++C)if(o=i[C],o.length>0){let v=new Uint16Array(o),I=Ke.createIndexBuffer({context:t,typedArray:v,usage:Oe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});L+=s[C];let M=6*(C*(O*D.SIXTY_FOUR_KILOBYTES)-L*O),N=O+M,j=O+N,k=O+j,V=O+k,F=O+V,W=C*(B*D.SIXTY_FOUR_KILOBYTES)-L*B,q=[{index:xu.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*O},{index:xu.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*O},{index:xu.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*O},{index:xu.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*O},{index:xu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*O},{index:xu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:xu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*O},{index:xu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*O},{index:xu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:xu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:xu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*O},{index:xu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*O},{index:xu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:W}],J,H,Z,K;m===ie.SCENE3D?(H=e._positionBuffer,J="vertexBuffer",Z=Kpe,K="value"):m===ie.SCENE2D||m===ie.COLUMBUS_VIEW?(H=Kpe,J="value",Z=e._positionBuffer,K="vertexBuffer"):(H=P,J="vertexBuffer",Z=e._positionBuffer,K="vertexBuffer"),q[0][J]=H,q[1][J]=H,q[2][K]=Z,q[3][K]=Z,q[4][J]=H,q[5][J]=H,q[6][K]=Z,q[7][K]=Z,q[8][J]=H,q[9][J]=H,q[10][K]=Z,q[11][K]=Z;let le=new Fn({context:t,attributes:q,indexBuffer:I});e._vertexArrays.push({va:le,buckets:u[C]})}}}function gnt(e,t){return t instanceof Dt?t.id:t}var zz=[];function _nt(e){let t=qi._uniformList[e.type],n=t.length;zz.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];zz[i]=r,zz[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(zz,gnt)}`}function Ant(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let a=0;a<r;++a){let s=o[a];if(s._actualPositions.length>1){s.update();let c=s.material,u=i[c.type];l(u)||(u=i[c.type]=new rp(c,t,n)),u.addPolyline(s)}}}function ynt(e,t){let n=t.mode;(e._mode!==n||!R.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=R.clone(e.modelMatrix),e._createVertexArray=!0)}function FK(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let a=0;a<r;++a)o=e._polylines[a],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function kK(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 o0e(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Eh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function r0e(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function LK(e,t,n){this.count=e,this.offset=t,this.bucket=n}function rp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}rp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};rp.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"),i.push("CLIP_POLYLINE");let o=new He({defines:i,sources:[`in vec4 v_pickColor;
  9673. `,this.material.shaderSource,dC]}),r=t.getVertexShaderCallback()(Nz),a=new He({defines:i,sources:[ru,r]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:xu})};function a0e(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(tn.ORIGIN_ZX_PLANE)===qt.INTERSECTING}rp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ie.SCENE3D||!a0e(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 ls=new h,hd=new h,md=new h,Uz=new h,xnt=new se,bnt=new z;rp.prototype.write=function(e,t,n,i,o,r,a,s){let c=this.mode,u=s.ellipsoid.maximumRadius*D.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,A=g.show&&m>0,y=g._index,x=this.getSegments(g,s),b=x.positions,T=x.lengths,E=b.length,S=g.getPickId(a).color,w=0,P=0,O;for(let j=0;j<E;++j){j===0?g._loop?O=b[E-2]:(O=Uz,h.subtract(b[0],b[1],O),h.add(b[0],O,O)):O=b[j-1],h.clone(O,hd),h.clone(b[j],ls),j===E-1?g._loop?O=b[1]:(O=Uz,h.subtract(b[E-1],b[E-2],O),h.add(b[E-1],O,O)):O=b[j+1],h.clone(O,md);let k=T[w];j===P+k&&(P+=k,++w);let V=j-P===0,F=j===P+T[w]-1;c===ie.SCENE2D&&(hd.z=0,ls.z=0,md.z=0),(c===ie.SCENE2D||c===ie.MORPHING)&&(V||F)&&u-Math.abs(ls.x)<1&&((ls.x<0&&hd.x>0||ls.x>0&&hd.x<0)&&h.clone(ls,hd),(ls.x<0&&md.x>0||ls.x>0&&md.x<0)&&h.clone(ls,md));let W=V?2:0,q=F?2:4;for(let J=W;J<q;++J){Tn.writeElements(ls,e,n),Tn.writeElements(hd,e,n+6),Tn.writeElements(md,e,n+12);let H=J-2<0?-1:1;t[o]=j/(E-1),t[o+1]=2*(J%2)-1,t[o+2]=H,t[o+3]=y,n+=18,o+=4}}let B=xnt;B.x=U.floatToByte(S.red),B.y=U.floatToByte(S.green),B.z=U.floatToByte(S.blue),B.w=U.floatToByte(S.alpha);let L=bnt;L.x=m,L.y=A?1:0;let _=c===ie.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Tn.fromCartesian(_.center,t0e),v=C.high,I=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,n0e),M=i0e;M.x=0,M.y=Number.MAX_VALUE;let N=g.distanceDisplayCondition;l(N)&&(M.x=N.near,M.y=N.far),r.setBatchedAttribute(y,0,L),r.setBatchedAttribute(y,1,B),r.attributes.length>2&&(r.setBatchedAttribute(y,2,v),r.setBatchedAttribute(y,3,I),r.setBatchedAttribute(y,4,M))}};var Tnt=new h,Cnt=new h,Ent=new h,$pe=new h;rp.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let a=i[r],s=a._segments.positions,c=a._segments.lengths,u=s.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?a._loop?g=s[u-2]:(g=$pe,h.subtract(s[0],s[1],g),h.add(s[0],g,g)):g=s[p-1],g=R.multiplyByPoint(n,g,Cnt);let m=R.multiplyByPoint(n,s[p],Tnt),A;p===u-1?a._loop?A=s[1]:(A=$pe,h.subtract(s[u-1],s[u-2],A),h.add(s[u-1],A,A)):A=s[p+1],A=R.multiplyByPoint(n,A,Ent);let y=c[f];p===d+y&&(d+=y,++f);let x=p-d===0,b=p===d+c[f]-1,T=x?2:0,E=b?2:4;for(let S=T;S<E;++S)Tn.writeElements(m,e,t),Tn.writeElements(g,e,t+6),Tn.writeElements(A,e,t+12),t+=18}}};var vnt=new Array(1);rp.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new LK(0,i,this);n[o].push(r);let a=0,s=e[e.length-1],c=0;s.length>0&&(c=s[s.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===ie.SCENE3D){g=vnt;let A=p._actualPositions.length;if(A>0)g[0]=A;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let A=0;for(let y=0;y<m;++y){let x=g[y]-1;for(let b=0;b<x;++b)c+4>D.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:A}),A=0,t.push(4),s=[],e.push(s),c=0,r.count=a,a=0,i=0,r=new LK(0,0,this),n[++o]=[r]),s.push(c,c+2,c+1),s.push(c+1,c+2,c+3),A+=6,a+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:A}),c+4>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),c=0,r.count=a,i=0,a=0,r=new LK(0,0,this),n[++o]=[r])}p._clean()}return r.count=a,i};rp.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 kE={positions:void 0,lengths:void 0},Jpe=new Array(1),Snt=new h,wnt=new de;rp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ie.SCENE3D)return Jpe[0]=n.length,kE.positions=n,kE.lengths=Jpe,kE;a0e(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,a=n.length,s,c=Snt;for(let u=0;u<a;++u)s=n[u],c=R.multiplyByPoint(r,s,c),o.push(t.project(i.cartesianToCartographic(c,wnt)));if(o.length>0){e._boundingVolume2D=ce.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return kE.positions=o,kE.lengths=e._segments.lengths,kE};var Zpe;rp.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*D.PI,a=t._actualLength;if(a){e+=this.getPolylineStartIndex(t);let s=Zpe,c=6*a*3;!l(s)||s.length<c?s=Zpe=new Float32Array(c):s.length>c&&(s=new Float32Array(s.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,A;a=f.length;for(let y=0;y<a;++y){y===0?t._loop?A=f[a-2]:(A=Uz,h.subtract(f[0],f[1],A),h.add(f[0],A,A)):A=f[y-1],h.clone(A,hd),h.clone(f[y],ls),y===a-1?t._loop?A=f[1]:(A=Uz,h.subtract(f[a-1],f[a-2],A),h.add(f[a-1],A,A)):A=f[y+1],h.clone(A,md);let x=d[g];y===m+x&&(m+=x,++g);let b=y-m===0,T=y===m+d[g]-1;o===ie.SCENE2D&&(hd.z=0,ls.z=0,md.z=0),(o===ie.SCENE2D||o===ie.MORPHING)&&(b||T)&&r-Math.abs(ls.x)<1&&((ls.x<0&&hd.x>0||ls.x>0&&hd.x<0)&&h.clone(ls,hd),(ls.x<0&&md.x>0||ls.x>0&&md.x<0)&&h.clone(ls,md));let E=b?2:0,S=T?2:4;for(let w=E;w<S;++w)Tn.writeElements(ls,s,p),Tn.writeElements(hd,s,p+6),Tn.writeElements(md,s,p+12),p+=18}n.copyFromArrayView(s,18*Float32Array.BYTES_PER_ELEMENT*e)}};var ap=Eh;function oA(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._heightReference=e.heightReference,this._billboardCollection=new dd({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new k0({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new ap,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(oA.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function Int(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+oe.packedLength+te.packedLength,a=new Float64Array(r),s=0;return a[s++]=i,a[s++]=o,oe.pack(n,a,s),s+=oe.packedLength,te.pack(t,a,s),a}var Dnt=new Wn("createVectorTilePoints",5),Pnt=new h;function Rnt(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Int(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},a=Dnt.scheduleTask(r,o);if(l(a))return a.then(s=>{if(e.isDestroyed())return;e._positions=new Float64Array(s.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3,g=e._heightReference??nt.NONE;for(let m=0;m<p;++m){let A=d[m],y=h.unpack(n,m*3,Pnt),x=c.add();x.position=y,x._batchIndex=A,x.heightReference=g;let b=u.add();b.text=" ",b.position=y,b._batchIndex=A,b.heightReference=g;let T=f.add();T.positions=[h.clone(y),h.clone(y)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(s=>{e.isDestroyed()||(e._error=s)})}oA.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,a=r.length;for(let s=0;s<a;++s){let c=r[s],u=n.get(s),f=i.get(s),d=o.get(s);t[c]=new nA(e,c,u,f,d)}};oA.prototype.applyDebugSettings=function(e,t){e?(U.clone(t,this._billboardCollection._highlightColor),U.clone(t,this._labelCollection._highlightColor),U.clone(t,this._polylineCollection._highlightColor)):(U.clone(U.WHITE,this._billboardCollection._highlightColor),U.clone(U.WHITE,this._labelCollection._highlightColor),U.clone(U.WHITE,this._polylineCollection._highlightColor))};function Ont(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.show=!0,a.pointSize=nA.defaultPointSize,a.color=nA.defaultColor,a.pointOutlineColor=nA.defaultPointOutlineColor,a.pointOutlineWidth=nA.defaultPointOutlineWidth,a.labelColor=U.WHITE,a.labelOutlineColor=U.WHITE,a.labelOutlineWidth=1,a.font="30px sans-serif",a.labelStyle=_r.FILL,a.labelText=void 0,a.backgroundColor=new U(.165,.165,.165,.8),a.backgroundPadding=new z(7,5),a.backgroundEnabled=!1,a.scaleByDistance=void 0,a.translucencyByDistance=void 0,a.distanceDisplayCondition=void 0,a.heightOffset=0,a.anchorLineEnabled=!1,a.anchorLineColor=U.WHITE,a.image=void 0,a.disableDepthTestDistance=0,a.horizontalOrigin=Bi.CENTER,a.verticalOrigin=zn.CENTER,a.labelHorizontalOrigin=Bi.RIGHT,a.labelVerticalOrigin=zn.BASELINE}}var Mnt=new U,Bnt=new U,Lnt=new U,Nnt=new U,Fnt=new U,knt=new U,YD=new Ut,XD=new Ut,zK=new kt;oA.prototype.applyStyle=function(e,t){if(!l(e)){Ont(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];if(l(e.show)&&(a.show=e.show.evaluate(a)),l(e.pointSize)&&(a.pointSize=e.pointSize.evaluate(a)),l(e.color)&&(a.color=e.color.evaluateColor(a,Mnt)),l(e.pointOutlineColor)&&(a.pointOutlineColor=e.pointOutlineColor.evaluateColor(a,Bnt)),l(e.pointOutlineWidth)&&(a.pointOutlineWidth=e.pointOutlineWidth.evaluate(a)),l(e.labelColor)&&(a.labelColor=e.labelColor.evaluateColor(a,Lnt)),l(e.labelOutlineColor)&&(a.labelOutlineColor=e.labelOutlineColor.evaluateColor(a,Nnt)),l(e.labelOutlineWidth)&&(a.labelOutlineWidth=e.labelOutlineWidth.evaluate(a)),l(e.font)&&(a.font=e.font.evaluate(a)),l(e.labelStyle)&&(a.labelStyle=e.labelStyle.evaluate(a)),l(e.labelText)?a.labelText=e.labelText.evaluate(a):a.labelText=void 0,l(e.backgroundColor)&&(a.backgroundColor=e.backgroundColor.evaluateColor(a,Fnt)),l(e.backgroundPadding)&&(a.backgroundPadding=e.backgroundPadding.evaluate(a)),l(e.backgroundEnabled)&&(a.backgroundEnabled=e.backgroundEnabled.evaluate(a)),l(e.scaleByDistance)){let s=e.scaleByDistance.evaluate(a);l(s)?(YD.near=s.x,YD.nearValue=s.y,YD.far=s.z,YD.farValue=s.w,a.scaleByDistance=YD):a.scaleByDistance=void 0}else a.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let s=e.translucencyByDistance.evaluate(a);l(s)?(XD.near=s.x,XD.nearValue=s.y,XD.far=s.z,XD.farValue=s.w,a.translucencyByDistance=XD):a.translucencyByDistance=void 0}else a.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let s=e.distanceDisplayCondition.evaluate(a);l(s)?(zK.near=s.x,zK.far=s.y,a.distanceDisplayCondition=zK):a.distanceDisplayCondition=void 0}else a.distanceDisplayCondition=void 0;l(e.heightOffset)&&(a.heightOffset=e.heightOffset.evaluate(a)),l(e.anchorLineEnabled)&&(a.anchorLineEnabled=e.anchorLineEnabled.evaluate(a)),l(e.anchorLineColor)&&(a.anchorLineColor=e.anchorLineColor.evaluateColor(a,knt)),l(e.image)?a.image=e.image.evaluate(a):a.image=void 0,l(e.disableDepthTestDistance)&&(a.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(a)),l(e.horizontalOrigin)&&(a.horizontalOrigin=e.horizontalOrigin.evaluate(a)),l(e.verticalOrigin)&&(a.verticalOrigin=e.verticalOrigin.evaluate(a)),l(e.labelHorizontalOrigin)&&(a.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(a)),l(e.labelVerticalOrigin)&&(a.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(a))}};oA.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Rnt(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};oA.prototype.isDestroyed=function(){return!1};oA.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(),fe(this)};var Vz=oA;function U0(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=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=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=Yn.BOTH}Object.defineProperties(U0.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 znt(e){let t=new Float64Array(3+h.packedLength+te.packedLength+oe.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,te.pack(e._ellipsoid,t,n),n+=te.packedLength,oe.pack(e._rectangle,t,n),t}function Unt(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let s=0;s<i;++s)o[s]=$t.unpack(t,n),n+=$t.packedLength;let r=t[n++],a=e._batchedIndices=new Array(r);for(let s=0;s<r;++s){let c=U.unpack(t,n);n+=U.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];a[s]=new b0({color:c,offset:u,count:f,batchIds:p})}}var Vnt=new Wn("createVectorTilePolygons",5),jnt=new U;function Gnt(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,a=e._batchTableColors,s=e._packedBuffer;if(!l(a)){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(oe.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),a=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,m=a.length;for(let A=0;A<m;++A){let y=g.getColor(A,jnt);a[A]=y.toRgba()}s=e._packedBuffer=znt(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,a.buffer,s.buffer],u={packedBuffer:s.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:a.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=Vnt.scheduleTask(u,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 m=new Float64Array(g.packedBuffer),A=m[0];Unt(e,m),e._indices=Ue.getSizeInBytes(A)===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),Hnt(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function Hnt(e){l(e._primitive)||(e._primitive=new LC({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)}U0.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};U0.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};U0.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};U0.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};U0.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Gnt(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)};U0.prototype.isDestroyed=function(){return!1};U0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var jz=U0;var Gz=`in vec4 currentPosition;
  9674. in vec4 previousPosition;
  9675. in vec4 nextPosition;
  9676. in vec2 expandAndWidth;
  9677. in float a_batchId;
  9678. uniform mat4 u_modifiedModelView;
  9679. void main()
  9680. {
  9681. float expandDir = expandAndWidth.x;
  9682. float width = abs(expandAndWidth.y) + 0.5;
  9683. bool usePrev = expandAndWidth.y < 0.0;
  9684. vec4 p = u_modifiedModelView * currentPosition;
  9685. vec4 prev = u_modifiedModelView * previousPosition;
  9686. vec4 next = u_modifiedModelView * nextPosition;
  9687. float angle;
  9688. vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);
  9689. gl_Position = czm_viewportOrthographic * positionWC;
  9690. }
  9691. `;function vh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.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=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(vh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Wnt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,a=2+oe.packedLength+te.packedLength+h.packedLength,s=new Float64Array(a),c=0;return s[c++]=n,s[c++]=i,oe.pack(t,s,c),c+=oe.packedLength,te.pack(o,s,c),c+=te.packedLength,h.pack(r,s,c),s}var qnt=new Wn("createVectorTilePolylines",5),zE={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Ynt(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,a=e._packedBuffer;l(a)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=Wnt(e));let s=[n.buffer,i.buffer,o.buffer,r.buffer,a.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},u=qnt.scheduleTask(c,s);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Xnt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Xnt(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,a=e._vertexBatchIds,s=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+a.byteLength+s.byteLength,e._trianglesLength=s.length/3,e._geometryByteLength=c;let u=Ke.createVertexBuffer({context:t,typedArray:i,usage:Oe.STATIC_DRAW}),f=Ke.createVertexBuffer({context:t,typedArray:n,usage:Oe.STATIC_DRAW}),d=Ke.createVertexBuffer({context:t,typedArray:o,usage:Oe.STATIC_DRAW}),p=Ke.createVertexBuffer({context:t,typedArray:r,usage:Oe.STATIC_DRAW}),g=Ke.createVertexBuffer({context:t,typedArray:a,usage:Oe.STATIC_DRAW}),m=Ke.createIndexBuffer({context:t,typedArray:s,usage:Oe.STATIC_DRAW,indexDatatype:s.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),A=[{index:zE.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:zE.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:zE.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:zE.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:zE.a_batchId,vertexBuffer:g,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Fn({context:t,attributes:A,indexBuffer:m}),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 KD=new R,s0e=new h;function Knt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return R.clone(n,KD),R.multiplyByPoint(KD,e._center,s0e),R.setTranslation(KD,s0e,KD),KD},u_highlightColor:function(){return e._highlightColor}})}function Qnt(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:Jt.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var $nt=`uniform vec4 u_highlightColor;
  9692. void main()
  9693. {
  9694. out_FragColor = u_highlightColor;
  9695. }
  9696. `;function Jnt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(Gz),o=n.getFragmentShaderCallback(!1,void 0,!1)($nt),r=new He({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[ru,i]}),a=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:zE})}function Znt(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:Ie.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}vh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,a,s=n.length,c=0,u=0;for(r=0;r<s;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<s;++r)if(n[r]===t){let d=o[r],p=o[r+1]-d;for(a=0;a<p;++a){let g=(d+a)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};vh.prototype.getPositions=function(e){return vh.getPolylinePositions(this,e)};vh.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 as(e,r)}};vh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function eit(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.show=!0,a.color=U.WHITE}}var tit=new U,nit=U.WHITE,iit=!0;vh.prototype.applyStyle=function(e,t){if(!l(e)){eit(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.color=l(e.color)?e.color.evaluateColor(a,tit):nit,a.show=l(e.show)?e.show.evaluate(a):iit}};vh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Ynt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Knt(this,t),Jnt(this,t),Qnt(this);let n=e.passes;(n.render||n.pick)&&Znt(this,e)};vh.prototype.isDestroyed=function(){return!1};vh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),fe(this)};var UE=vh;var Hz=`in vec3 startEllipsoidNormal;
  9697. in vec3 endEllipsoidNormal;
  9698. in vec4 startPositionAndHeight;
  9699. in vec4 endPositionAndHeight;
  9700. in vec4 startFaceNormalAndVertexCorner;
  9701. in vec4 endFaceNormalAndHalfWidth;
  9702. in float a_batchId;
  9703. uniform mat4 u_modifiedModelView;
  9704. uniform vec2 u_minimumMaximumVectorHeights;
  9705. out vec4 v_startPlaneEC;
  9706. out vec4 v_endPlaneEC;
  9707. out vec4 v_rightPlaneEC;
  9708. out float v_halfWidth;
  9709. out vec3 v_volumeUpEC;
  9710. void main()
  9711. {
  9712. // vertex corner IDs
  9713. // 3-----------7
  9714. // /| left /|
  9715. // / | 1 / |
  9716. // 2-----------6 5 end
  9717. // | / | /
  9718. // start |/ right |/
  9719. // 0-----------4
  9720. //
  9721. float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end
  9722. float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top
  9723. vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
  9724. vec3 right = normalize(cross(forward, startEllipsoidNormal));
  9725. vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
  9726. position.xyz += forward * isEnd;
  9727. v_volumeUpEC = czm_normal * normalize(cross(right, forward));
  9728. // Push for volume height
  9729. float offset;
  9730. vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);
  9731. // offset height to create volume
  9732. offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
  9733. offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
  9734. position.xyz += offset * ellipsoidNormal;
  9735. // move from RTC to EC
  9736. position = u_modifiedModelView * position;
  9737. right = czm_normal * right;
  9738. // Push for width in a direction that is in the start or end plane and in a plane with right
  9739. // N = normalEC ("right-facing" direction for push)
  9740. // R = right
  9741. // p = angle between N and R
  9742. // w = distance to push along R if R == N
  9743. // d = distance to push along N
  9744. //
  9745. // N R
  9746. // { p| } * cos(p) = dot(N, R) = w / d
  9747. // d | |w * d = w / dot(N, R)
  9748. // { | }
  9749. // o---------- polyline segment ---->
  9750. //
  9751. vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
  9752. scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
  9753. vec3 miterPushNormal = czm_normal * normalize(scratchNormal);
  9754. offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC
  9755. offset = offset / dot(miterPushNormal, right);
  9756. position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));
  9757. gl_Position = czm_depthClamp(czm_projection * position);
  9758. position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
  9759. vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
  9760. v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
  9761. v_rightPlaneEC = vec4(right, -dot(right, position.xyz));
  9762. position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
  9763. vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
  9764. v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
  9765. v_halfWidth = endFaceNormalAndHalfWidth.w;
  9766. }
  9767. `;var Wz=`in vec4 v_startPlaneEC;
  9768. in vec4 v_endPlaneEC;
  9769. in vec4 v_rightPlaneEC;
  9770. in float v_halfWidth;
  9771. in vec3 v_volumeUpEC;
  9772. uniform vec4 u_highlightColor;
  9773. void main()
  9774. {
  9775. float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
  9776. // Discard for sky
  9777. if (logDepthOrDepth == 0.0) {
  9778. #ifdef DEBUG_SHOW_VOLUME
  9779. out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
  9780. return;
  9781. #else // DEBUG_SHOW_VOLUME
  9782. discard;
  9783. #endif // DEBUG_SHOW_VOLUME
  9784. }
  9785. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  9786. eyeCoordinate /= eyeCoordinate.w;
  9787. float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);
  9788. // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction
  9789. halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));
  9790. // Check distance of the eye coordinate against the right-facing plane
  9791. float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
  9792. // Check eye coordinate against the mitering planes
  9793. float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
  9794. float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);
  9795. if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
  9796. #ifdef DEBUG_SHOW_VOLUME
  9797. out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
  9798. return;
  9799. #else // DEBUG_SHOW_VOLUME
  9800. discard;
  9801. #endif // DEBUG_SHOW_VOLUME
  9802. }
  9803. out_FragColor = u_highlightColor;
  9804. czm_writeDepthClamp();
  9805. }
  9806. `;function V0(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.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 z(wi._defaultMinTerrainHeight,wi._defaultMaxTerrainHeight),this._boundingVolume=$t.fromRectangle(e.rectangle,wi._defaultMinTerrainHeight,wi._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=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(V0.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function oit(e,t,n){let i=wi.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,a=e._minimumMaximumVectorHeights;a.x=o,a.y=r;let s=e._boundingVolume,c=e._rectangle;$t.fromRectangle(c,o,r,n,s)}function rit(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,a=2+oe.packedLength+te.packedLength+h.packedLength,s=new Float64Array(a),c=0;return s[c++]=n,s[c++]=i,oe.pack(t,s,c),c+=oe.packedLength,te.pack(o,s,c),c+=te.packedLength,h.pack(r,s,c),s}var ait=new Wn("createVectorTileClampedPolylines"),rA={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function sit(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,a=e._packedBuffer;l(a)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=rit(e));let s=[n.buffer,i.buffer,o.buffer,r.buffer,a.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},u=ait.scheduleTask(c,s);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),cit(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function cit(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,a=e._startFaceNormalAndVertexCornerIds,s=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=a.byteLength+s.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=Ke.createVertexBuffer({context:t,typedArray:n,usage:Oe.STATIC_DRAW}),p=Ke.createVertexBuffer({context:t,typedArray:i,usage:Oe.STATIC_DRAW}),g=Ke.createVertexBuffer({context:t,typedArray:o,usage:Oe.STATIC_DRAW}),m=Ke.createVertexBuffer({context:t,typedArray:r,usage:Oe.STATIC_DRAW}),A=Ke.createVertexBuffer({context:t,typedArray:a,usage:Oe.STATIC_DRAW}),y=Ke.createVertexBuffer({context:t,typedArray:s,usage:Oe.STATIC_DRAW}),x=Ke.createVertexBuffer({context:t,typedArray:c,usage:Oe.STATIC_DRAW}),b=Ke.createIndexBuffer({context:t,typedArray:u,usage:Oe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),T=[{index:rA.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:rA.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:rA.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:rA.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:rA.startFaceNormalAndVertexCorner,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:rA.endFaceNormalAndHalfWidth,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:rA.a_batchId,vertexBuffer:x,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Fn({context:t,attributes:T,indexBuffer:b}),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 QD=new R,c0e=new h;function lit(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return R.clone(n,QD),R.multiplyByPoint(QD,e._center,c0e),R.setTranslation(QD,c0e,QD),QD},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function l0e(e){return Ve.fromCache({cull:{enabled:!0,face:Li.FRONT},blending:Jt.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Xn.EQUAL,frontOperation:{fail:vt.KEEP,zFail:vt.KEEP,zPass:vt.KEEP},backFunction:Xn.EQUAL,backOperation:{fail:vt.KEEP,zFail:vt.KEEP,zPass:vt.KEEP},reference:Ht.CESIUM_3D_TILE_MASK,mask:Ht.CESIUM_3D_TILE_MASK}})}function uit(e){l(e._rs)||(e._rs=l0e(!1),e._rs3DTiles=l0e(!0))}function fit(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(Hz),o=n.getFragmentShaderCallback(!1,void 0,!0)(Wz),r=new He({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[ru,i]}),a=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:rA})}function dit(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:Ie.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=tt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Yn.TERRAIN||i===Yn.BOTH)&&t.commandList.push(n),(i===Yn.CESIUM_3D_TILE||i===Yn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}V0.prototype.getPositions=function(e){return UE.getPolylinePositions(this,e)};V0.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 as(e,r)}};V0.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function hit(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.show=!0,a.color=U.WHITE}}var mit=new U,pit=U.WHITE,git=!0;V0.prototype.applyStyle=function(e,t){if(!l(e)){hit(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.color=l(e.color)?e.color.evaluateColor(a,mit):pit,a.show=l(e.show)?e.show.evaluate(a):git}};function _it(e){return wi.initialize().then(function(){oit(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}V0.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=_it(this).then(sit(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}lit(this,t),fit(this,t),uit(this);let n=e.passes;(n.render||n.pick)&&dit(this,e)};V0.prototype.isDestroyed=function(){return!1};V0.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),fe(this)};var qz=V0;var UK=32767,Ait=new de,yit=new h;function xit(e,t,n,i,o){let r=e.length/3,a=e.subarray(0,r),s=e.subarray(r,2*r),c=e.subarray(2*r,3*r);on.zigZagDeltaDecode(a,s,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let d=a[f],p=s[f],g=c[f],m=D.lerp(t.west,t.east,d/UK),A=D.lerp(t.south,t.north,p/UK),y=D.lerp(n,i,g/UK),x=de.fromRadians(m,A,y,Ait),b=o.cartographicToCartesian(x,yit);h.pack(b,u,f*3)}return u}var Yz=xit;var jK=class{constructor(t,n,i,o,r){this._tileset=t,this._tile=n,this._resource=i,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,vit(this,o,r)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||VK(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||VK(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||VK(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){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(),fe(this)}};function bit(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Tit(e,t){let n,i,o,r,a=e.POLYGONS_LENGTH??0,s=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(a>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,a)}if(s>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,s)}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 u=l(n)||l(i)||l(o),f=a>0&&!l(n)||s>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new re("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)&&a>0)for(n=new Uint16Array(a),r=0;r<a;++r)n[r]=p++;if(!l(i)&&s>0)for(i=new Uint16Array(s),r=0;r<s;++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 Sh=Uint32Array.BYTES_PER_ELEMENT;function Cit(e){return new UE(e)}function Eit(e){return new qz(e)}function vit(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=Sh;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=Sh;let a=o.getUint32(n,!0);if(n+=Sh,a===0){e._ready=!0;return}let s=o.getUint32(n,!0);if(n+=Sh,s===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Sh;let u=o.getUint32(n,!0);n+=Sh;let f=o.getUint32(n,!0);n+=Sh;let d=o.getUint32(n,!0);n+=Sh;let p=o.getUint32(n,!0);n+=Sh;let g=o.getUint32(n,!0);n+=Sh;let m=o.getUint32(n,!0);n+=Sh;let A=Sr(i,n,s);n+=s;let y=new Uint8Array(t,n,c);n+=c;let x,b;u>0&&(x=Sr(i,n,u),n+=u,f>0&&(b=new Uint8Array(t,n,f),b=new Uint8Array(b),n+=f));let T=A.POLYGONS_LENGTH??0,E=A.POLYLINES_LENGTH??0,S=A.POINTS_LENGTH??0,w=T+E+S,P=new Vm(e,w,x,b,bit(e));if(e._batchTable=P,w===0)return;let O=new Km(A,y),B=O.getGlobalProperty("REGION");if(!l(B))throw new re("Feature table global property: REGION must be defined");let L=oe.unpack(B),_=B[4],C=B[5],v=e._tile.computedTransform,I=O.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(I)?(I=h.unpack(I),R.multiplyByPoint(v,I,I)):(I=oe.center(L),I.height=D.lerp(_,C,.5),I=te.WGS84.cartographicToCartesian(I));let M=Tit(A,y);if(n+=(4-n%4)%4,T>0){O.featuresLength=T;let j=O.getPropertyArray("POLYGON_COUNTS",Y.UNSIGNED_INT,1)??O.getPropertyArray("POLYGON_COUNT",Y.UNSIGNED_INT,1);if(!l(j))throw new re("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=O.getPropertyArray("POLYGON_INDEX_COUNTS",Y.UNSIGNED_INT,1)??O.getPropertyArray("POLYGON_INDEX_COUNT",Y.UNSIGNED_INT,1);if(!l(k))throw new re("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=j.reduce(function(Z,K){return Z+K*2},0),F=k.reduce(function(Z,K){return Z+K},0),W=new Uint32Array(t,n,F);n+=d;let q=new Uint16Array(t,n,V);n+=p;let J,H;l(A.POLYGON_MINIMUM_HEIGHTS)&&l(A.POLYGON_MAXIMUM_HEIGHTS)&&(J=O.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Y.FLOAT,1),H=O.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Y.FLOAT,1)),e._polygons=new jz({positions:q,counts:j,indexCounts:k,indices:W,minimumHeight:_,maximumHeight:C,polygonMinimumHeights:J,polygonMaximumHeights:H,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:P,batchIds:M.polygons,modelMatrix:v})}let N=e._tileset;if(E>0){O.featuresLength=E;let j=O.getPropertyArray("POLYLINE_COUNTS",Y.UNSIGNED_INT,1)??O.getPropertyArray("POLYLINE_COUNT",Y.UNSIGNED_INT,1);if(!l(j))throw new re("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let k=O.getPropertyArray("POLYLINE_WIDTHS",Y.UNSIGNED_SHORT,1);if(!l(k)){k=new Uint16Array(E);for(let J=0;J<E;++J)k[J]=2}let V=j.reduce(function(J,H){return J+H*3},0),F=new Uint16Array(t,n,V);n+=g;let W=N.examineVectorLinesFunction;if(l(W)){let J=Yz(new Uint16Array(F),L,_,C,te.WGS84);Sit(J,j,M.polylines,P,e.url,W)}let q=Cit;l(N.classificationType)&&(q=Eit),e._polylines=q({positions:F,widths:k,counts:j,batchIds:M.polylines,minimumHeight:_,maximumHeight:C,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:P,classificationType:N.classificationType,keepDecodedPositions:N.vectorKeepDecodedPositions})}if(S>0){let j=new Uint16Array(t,n,S*3);n+=m,e._points=new Vz({positions:j,batchIds:M.points,minimumHeight:_,maximumHeight:C,rectangle:L,batchTable:P,heightReference:N.heightReference,scene:N.scene})}}function VK(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}}function Sit(e,t,n,i,o,r){let a=t.length,s=0;for(let c=0;c<a;c++){let u=t[c]*3,f=e.slice(s,s+u);s+=u,r(f,n[c],o,i)}}var Xz=jK;var wh=class wh{constructor(){lt(this,"_collection",null);lt(this,"_index",-1);lt(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(wh.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(wh.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(wh.Layout.SHOW_U8)===1}set show(t){this._setUint8(wh.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(wh.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+wh.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(wh.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(wh.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};lt(wh,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var GK=wh,la=GK;var $D=class $D{constructor(t=G.EMPTY_OBJECT){lt(this,"_renderContext",null);this.show=t.show??!0,this._blendOption=t.blendOption??Oi.TRANSLUCENT,this._modelMatrix=R.clone(t.modelMatrix??R.IDENTITY),this._boundingVolume=ce.clone(t.boundingVolume??new ce,new ce),this._boundingVolumeAutoUpdate=!l(t.boundingVolume),this._allowPicking=t.allowPicking??!1,this._pickIds=new Map,this._pickObjects=[],this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??$D.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??$D.DEFAULT_CAPACITY,this._positionView=null,this._positionDatatype=t.positionDatatype??Y.DOUBLE,this._positionNormalized=t.positionNormalized??!1,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(),this._allocateMaterialBuffer()}_getCollectionClass(){_e.throwInstantiationError()}_getPrimitiveClass(){_e.throwInstantiationError()}_getMaterialClass(){_e.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(){this._positionView=Y.createTypedArray(this._positionDatatype,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){this._pickObjects.length=0;for(let t of this._pickIds.values())for(let n of t)n.destroy();l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),o=this._getCollectionClass(),{primitiveCount:r}=this,a=new i,s=new i,c=new Uint32Array(r);for(let f=0;f<r;f++)c[f]=f;c.sort((f,d)=>t(this.get(f,a),this.get(d,s)));for(let f=0;f<r;f++)n[c[f]]=f;let u=o._cloneEmpty(this);for(let f=0;f<r;f++){let d=this.get(c[f],a),p=u.add({},s);i.clone(d,p)}return o._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=r,n}static clone(t,n){let i=t._getPrimitiveClass().Layout,o=t._getMaterialClass(),r=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*i.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*o.packedLength),n.show=t.show,n.debugShowBoundingVolume=t.debugShowBoundingVolume,n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=new r;for(let s=0,c=n.primitiveCount;s<c;s++)n.get(s,a)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneEmpty(t){_e.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.subarray(0,this._positionCount*3);this._positionNormalized&&(t=on.dequantize(t,this._positionDatatype,Ft.VEC3,this._positionCount)),ce.fromVertices(t,h.ZERO,3,this.boundingVolume),ce.transform(this.boundingVolume,this.modelMatrix,this.boundingVolume),this._dirtyBoundingVolume=!1}_updatePickIds(t){let n=this._pickIds.get(t);if(n&&n.length===this._primitiveCount)return;n||(n=[],this._pickIds.set(t,n));let i=this,o=this._getPrimitiveClass(),r=new o;for(let a=n.length,s=this._primitiveCount;a<s;a++){this.get(a,r);let c=this._pickObjects[a]||{collection:this,index:a,get primitive(){return i.get(a,new o)}},u=t.createPickId(c);r._pickId=u.key,n.push(u)}}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=G.EMPTY_OBJECT,n){let i=this._getMaterialClass(),o=this._primitiveCount++;return n=this.get(o,n),n.featureId=t.featureId??o,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,l(t.pickObject)&&(this._pickObjects[o]=t.pickObject),n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==ie.SCENE3D&&_t("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._dirtyCount>0&&this._updatePickIds(t.context)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}static _copySubArray(t,n,i){for(let o=0;o<i;o++)n[o]=t[o]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let o=0,r=this.primitiveCount;o<r;o++)i.push(this.get(o,n).toJSON());return i}};lt($D,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var Kz=$D;Kz.DEFAULT_CAPACITY=1024;var us=Kz;var{ERR_CAPACITY:Z5n}=us.Error,wit=new h,Qz=class Qz extends la{constructor(){super(...arguments);lt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(wit)),i}get vertexOffset(){return this._getUint32(Qz.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,o=this.vertexOffset;i._positionView[o*3]=n.x,i._positionView[o*3+1]=n.y,i._positionView[o*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};lt(Qz,"Layout",{...la.Layout,POSITION_OFFSET_U32:la.Layout.__BYTE_LENGTH,__BYTE_LENGTH:la.Layout.__BYTE_LENGTH+4});var HK=Qz,Jc=HK;var $z=`#ifdef USE_FLOAT64
  9807. in vec3 positionHigh;
  9808. in vec3 positionLow;
  9809. #else
  9810. in vec3 position;
  9811. #endif
  9812. in vec4 pickColor;
  9813. in vec4 showPixelSizeColorAlpha;
  9814. in vec3 outlineWidthColorAlpha;
  9815. out vec4 v_pickColor;
  9816. out vec4 v_color;
  9817. out vec4 v_outlineColor;
  9818. out float v_innerRadiusFrac;
  9819. void main()
  9820. {
  9821. // Unpack attributes.
  9822. float show = showPixelSizeColorAlpha.x;
  9823. float pixelSize = showPixelSizeColorAlpha.y;
  9824. vec4 color = czm_decodeRGB8(showPixelSizeColorAlpha.z);
  9825. float alpha = showPixelSizeColorAlpha.w;
  9826. float outlineWidth = outlineWidthColorAlpha.x;
  9827. vec4 outlineColor = czm_decodeRGB8(outlineWidthColorAlpha.y);
  9828. float outlineAlpha = outlineWidthColorAlpha.z;
  9829. ///////////////////////////////////////////////////////////////////////////
  9830. float innerRadius = 0.5 * pixelSize * czm_pixelRatio;
  9831. float outerRadius = (0.5 * pixelSize + outlineWidth) * czm_pixelRatio;
  9832. ///////////////////////////////////////////////////////////////////////////
  9833. #ifdef USE_FLOAT64
  9834. vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  9835. vec4 positionEC = czm_modelViewRelativeToEye * p;
  9836. #else
  9837. vec4 positionEC = czm_modelView * vec4(position, 1.0);
  9838. #endif
  9839. ///////////////////////////////////////////////////////////////////////////
  9840. gl_Position = czm_projection * positionEC;
  9841. czm_vertexLogDepth();
  9842. v_pickColor = pickColor / 255.0;
  9843. v_color = color;
  9844. v_color.a *= alpha * show;
  9845. v_outlineColor = outlineColor;
  9846. v_outlineColor.a *= outlineAlpha * show;
  9847. v_innerRadiusFrac = innerRadius / outerRadius;
  9848. gl_PointSize = 2.0 * outerRadius * show;
  9849. gl_Position *= show;
  9850. }
  9851. `;var Jz=`in vec4 v_pickColor;
  9852. in vec4 v_color;
  9853. in vec4 v_outlineColor;
  9854. in float v_innerRadiusFrac;
  9855. void main()
  9856. {
  9857. // Distance between fragment and point center, 0 to 0.5.
  9858. float distanceToCenter = length(gl_PointCoord - vec2(0.5));
  9859. float delta = fwidth(distanceToCenter);
  9860. float outerLimit = 0.5;
  9861. float innerLimit = 0.5 * v_innerRadiusFrac;
  9862. float outerAlpha = 1.0 - smoothstep(max(0.0, outerLimit - delta), outerLimit, distanceToCenter);
  9863. float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter);
  9864. vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha);
  9865. color.a *= mix(v_outlineColor.a, v_color.a, innerAlpha);
  9866. if (color.a < 0.005) // matches 0/255 and 1/255
  9867. {
  9868. discard;
  9869. }
  9870. out_FragColor = czm_gammaCorrect(color);
  9871. czm_writeLogDepth();
  9872. }
  9873. `;var JD=class{constructor(t=G.EMPTY_OBJECT){this.color=U.clone(t.color??U.WHITE),this.outlineColor=U.clone(t.outlineColor??U.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return U.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),U.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};lt(JD,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),lt(JD,"DEFAULT_MATERIAL");var bu=JD;var ZD=class ZD extends bu{constructor(t=G.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};lt(ZD,"Layout",{...bu.Layout,SIZE_U8:bu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:bu.Layout.__BYTE_LENGTH+4}),lt(ZD,"DEFAULT_MATERIAL",Object.freeze(new ZD));var WK=ZD,sp=WK;var qK={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},u0e={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},Lx=new Jc,Nx=new sp,eP=new U,f0e=new h,Fx=new Tn;function Iit(e,t,n){let i=t.context;n=n||{destroy:Dit};let o=e._positionDatatype===Y.DOUBLE,r=o?qK:u0e;if(!l(n.attributeArrays)){let s=e.primitiveCountMax;n.attributeArrays={...o?{positionHigh:new Float32Array(s*3),positionLow:new Float32Array(s*3)}:{position:e._positionView},pickColor:new Uint8Array(s*4),showSizeColorAlpha:new Float32Array(s*4),outlineWidthColorAlpha:new Float32Array(s*3)}}if(e._dirtyCount>0){let{attributeArrays:s}=n,c=s.pickColor,u=s.showSizeColorAlpha,f=s.outlineWidthColorAlpha,{_dirtyOffset:d,_dirtyCount:p}=e;for(let g=d,m=d+p;g<m;g++)e.get(g,Lx),Lx._dirty&&(o&&(Lx.getPosition(f0e),Tn.fromCartesian(f0e,Fx),s.positionHigh[g*3]=Fx.high.x,s.positionHigh[g*3+1]=Fx.high.y,s.positionHigh[g*3+2]=Fx.high.z,s.positionLow[g*3]=Fx.low.x,s.positionLow[g*3+1]=Fx.low.y,s.positionLow[g*3+2]=Fx.low.z),Lx.getMaterial(Nx),U.fromRgba(Lx._pickId,eP),c[g*4]=U.floatToByte(eP.red),c[g*4+1]=U.floatToByte(eP.green),c[g*4+2]=U.floatToByte(eP.blue),c[g*4+3]=U.floatToByte(eP.alpha),u[g*4]=Lx.show?1:0,u[g*4+1]=Nx.size,u[g*4+2]=on.encodeRGB8(Nx.color),u[g*4+3]=Nx.color.alpha,f[g*3]=Nx.outlineWidth,f[g*3+1]=on.encodeRGB8(Nx.outlineColor),f[g*3+2]=Nx.outlineColor.alpha,Lx._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let s in r)if(Object.hasOwn(r,s)){let c=s;n.vertexArray.copyAttributeFromRange(r[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:s}=n;n.vertexArray=new Fn({context:i,attributes:[...o?[{index:qK.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:s.positionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:qK.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:s.positionLow,context:i,usage:Oe.STATIC_DRAW})}]:[{index:u0e.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ke.createVertexBuffer({typedArray:e._positionView,context:i,usage:Oe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:Ke.createVertexBuffer({typedArray:s.pickColor,context:i,usage:Oe.STATIC_DRAW})},{index:r.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:Ke.createVertexBuffer({typedArray:s.showSizeColorAlpha,context:i,usage:Oe.STATIC_DRAW})},{index:r.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:s.outlineWidthColorAlpha,context:i,usage:Oe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ve.fromCache({blending:e._blendOption===Oi.OPAQUE?Jt.DISABLED:Jt.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new He({sources:[$z],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new He({sources:[Jz]}),attributeLocations:r})),l(n.command)||(n.command=new tt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Re.POINTS,pass:e._blendOption===Oi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==e.primitiveCount&&(a.count=e.primitiveCount),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._dirtyCount=0,e._dirtyOffset=0,n}function Dit(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ve.removeFromCache(e.renderState)}var Zz=Iit;var YK=class e extends us{constructor(t=G.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Jc}_getMaterialClass(){return sp}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,positionDatatype:t.positionDatatype,positionNormalized:t.positionNormalized})}add(t,n=new Jc){return super.add(t,n),n._setUint32(Jc.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=Zz(this,t,this._renderContext))}},rf=YK;var{ERR_CAPACITY:H9n,ERR_RESIZE:W9n,ERR_OUT_OF_RANGE:q9n}=us.Error,pd=class pd extends la{constructor(){super(...arguments);lt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(pd.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(pd.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,o=this.vertexOffset,r=this.vertexCount,a=n.length/3,s=i.vertexCount+a-r;i._positionCount=s,this._setUint32(pd.Layout.POSITION_COUNT_U32,a);let c=i._positionView;for(let u=0;u<a;u++)c[(o+u)*3]=n[u*3],c[(o+u)*3+1]=n[u*3+1],c[(o+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(pd.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(pd.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:o}=this,r=this._collection._holeIndexView;if(!l(n)){let a=r.byteOffset+i*r.BYTES_PER_ELEMENT,s=r.constructor;return new s(r.buffer,a,o)}for(let a=0;a<o;a++)n[a]=r[i+a];return n}setHoles(n){let i=this._collection,o=this.holeOffset,r=this.holeCount,a=n.length,s=i.holeCount+a-r;i._holeCount=s,this._setUint32(pd.Layout.HOLE_COUNT_U32,a);let c=i._holeIndexView;for(let u=0;u<a;u++)c[o+u]=n[u];this._dirty=!0}getHoleVertexCount(n){let i=this.getHoles(),o=i[n];return n===i.length-1?this.vertexCount-o:i[n+1]-o}getHolePositions(n,i){let r=this.getHoles()[n],a=this.getHoleVertexCount(n);return this._getPositionsRange(r,a,i)}_getPositionsRange(n,i,o){let r=this._collection,a=this._collection._positionView,s=this.vertexOffset+n;if(!l(o)){let c=a.byteOffset+s*3*a.BYTES_PER_ELEMENT,u=a.constructor;return new u(a.buffer,c,i*3)}for(let c=0;c<i;c++)o[c*3]=a[(s+c)*3],o[c*3+1]=a[(s+c)*3+1],o[c*3+2]=a[(s+c)*3+2];return o}get triangleOffset(){return this._getUint32(pd.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(pd.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:o}=this,r=this._collection._triangleIndexView;if(!l(n)){let a=r.byteOffset+i*3*r.BYTES_PER_ELEMENT,s=r.constructor;return new s(r.buffer,a,o*3)}for(let a=0;a<o;a++)n[a*3]=r[(i+a)*3],n[a*3+1]=r[(i+a)*3+1],n[a*3+2]=r[(i+a)*3+2];return n}setTriangles(n){let i=this._collection,o=this.triangleOffset,r=this.triangleCount,a=n.length/3,s=i.triangleCount+a-r;i._triangleCount+=a-r,this._setUint32(pd.Layout.TRIANGLE_COUNT_U32,a);let c=i._triangleIndexView;for(let u=0;u<a;u++)c[(o+u)*3]=n[u*3],c[(o+u)*3+1]=n[u*3+1],c[(o+u)*3+2]=n[u*3+2];this._dirty=!0}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};lt(pd,"Layout",{...la.Layout,POSITION_OFFSET_U32:la.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:la.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:la.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:la.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:la.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:la.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:la.Layout.__BYTE_LENGTH+24});var XK=pd,Ha=XK;var eU=`#ifdef USE_FLOAT64
  9874. in vec3 positionHigh;
  9875. in vec3 positionLow;
  9876. #else
  9877. in vec3 position;
  9878. #endif
  9879. in vec4 pickColor;
  9880. in vec3 showColorAlpha;
  9881. out vec4 v_pickColor;
  9882. out vec4 v_color;
  9883. void main()
  9884. {
  9885. float show = showColorAlpha.x;
  9886. vec4 color = czm_decodeRGB8(showColorAlpha.y);
  9887. float alpha = showColorAlpha.z;
  9888. ///////////////////////////////////////////////////////////////////////////
  9889. #ifdef USE_FLOAT64
  9890. vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  9891. vec4 positionEC = czm_modelViewRelativeToEye * p;
  9892. #else
  9893. vec4 positionEC = czm_modelView * vec4(position, 1.0);
  9894. #endif
  9895. ///////////////////////////////////////////////////////////////////////////
  9896. gl_Position = czm_projection * positionEC;
  9897. czm_vertexLogDepth();
  9898. v_pickColor = pickColor / 255.0;
  9899. v_color = color;
  9900. v_color.a *= alpha * show;
  9901. gl_Position *= show;
  9902. }
  9903. `;var tU=`in vec4 v_pickColor;
  9904. in vec4 v_color;
  9905. void main()
  9906. {
  9907. if (v_color.a < 0.005) // matches 0/255 and 1/255
  9908. {
  9909. discard;
  9910. }
  9911. out_FragColor = czm_gammaCorrect(v_color);
  9912. czm_writeLogDepth();
  9913. }
  9914. `;var nU=class nU extends bu{constructor(t=G.EMPTY_OBJECT){super(t)}};lt(nU,"DEFAULT_MATERIAL",Object.freeze(new nU));var KK=nU,cp=KK;var QK={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},d0e={position:0,pickColor:1,showColorAlpha:2},fs=new Ha,$K=new cp,tP=new U,h0e=new h,kx=new Tn;function Pit(e,t,n){let i=t.context;n=n||{destroy:Oit};let o=e._positionDatatype===Y.DOUBLE,r=o?QK:d0e;if(!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:c,triangleCountMax:u}=e;n.indexArray=Ue.createTypedArray(c,u*3),n.attributeArrays={...o?{positionHigh:new Float32Array(c*3),positionLow:new Float32Array(c*3)}:{position:e._positionView},pickColor:new Uint8Array(c*4),showColorAlpha:new Float32Array(c*3)}}if(e._dirtyCount>0){let{attributeArrays:c}=n,{_dirtyOffset:u,_dirtyCount:f}=e,d=n.indexArray,p=c.pickColor,g=c.showColorAlpha;for(let m=u,A=u+f;m<A;m++){if(e.get(m,fs),!fs._dirty)continue;let y=fs.triangleOffset,x=fs.vertexOffset,b=fs.getTriangles();for(let w=0,P=fs.triangleCount;w<P;w++)d[y*3]=x+b[w*3],d[y*3+1]=x+b[w*3+1],d[y*3+2]=x+b[w*3+2],y++;let T=fs.show,E=o?fs.getPositions():null;fs.getMaterial($K);let S=on.encodeRGB8($K.color);U.fromRgba(fs._pickId,tP);for(let w=0,P=fs.vertexCount;w<P;w++)o&&(h.fromArray(E,w*3,h0e),Tn.fromCartesian(h0e,kx),c.positionHigh[x*3]=kx.high.x,c.positionHigh[x*3+1]=kx.high.y,c.positionHigh[x*3+2]=kx.high.z,c.positionLow[x*3]=kx.low.x,c.positionLow[x*3+1]=kx.low.y,c.positionLow[x*3+2]=kx.low.z),p[x*4]=U.floatToByte(tP.red),p[x*4+1]=U.floatToByte(tP.green),p[x*4+2]=U.floatToByte(tP.blue),p[x*4+3]=U.floatToByte(tP.alpha),g[x*3]=T?1:0,g[x*3+1]=S,g[x*3+2]=$K.color.alpha,x++;fs._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=Rit(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in r)if(Object.hasOwn(r,p)){let g=p;n.vertexArray.copyAttributeFromRange(r[g],n.attributeArrays[g],f,d)}}}else{let{attributeArrays:c}=n;n.vertexArray=new Fn({context:i,indexBuffer:Ke.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Oe.STATIC_DRAW,indexDatatype:Ue.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:QK.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:QK.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Oe.STATIC_DRAW})}]:[{index:d0e.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ke.createVertexBuffer({typedArray:c.position,context:i,usage:Oe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:Ke.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Oe.STATIC_DRAW})},{index:r.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Oe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ve.fromCache({blending:e._blendOption===Oi.OPAQUE?Jt.DISABLED:Jt.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new He({sources:[eU],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new He({sources:[tU]}),attributeLocations:r}));let a=e.triangleCount*3;l(n.command)||(n.command=new tt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Re.TRIANGLES,pass:e._blendOption===Oi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:a,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==a&&(s.count=a),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._dirtyCount=0,e._dirtyOffset=0,n}function Rit(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,fs);let i=fs.vertexOffset,o=fs.triangleOffset*3;e.get(t+n-1,fs);let r=fs.vertexOffset+fs.vertexCount-i,a=(fs.triangleOffset+fs.triangleCount)*3-o;return{indexOffset:o,indexCount:a,vertexOffset:i,vertexCount:r}}function Oit(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ve.removeFromCache(e.renderState)}var iU=Pit;var{ERR_CAPACITY:R7n}=us.Error,JK=class e extends us{constructor(t=G.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??us.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??us.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Ha}_getMaterialClass(){return cp}_allocateHoleIndexBuffer(){this._holeIndexView=Ue.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=Ue.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n){return super.clone(t,n),this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount,n}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,vertexCountMax:t.vertexCountMax,holeCountMax:t.holeCountMax,triangleCountMax:t.triangleCountMax,positionDatatype:t.positionDatatype,positionNormalized:t.positionNormalized})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new Ha){super.add(t,n);let i=this._positionCount;n._setUint32(Ha.Layout.POSITION_OFFSET_U32,i),n._setUint32(Ha.Layout.POSITION_COUNT_U32,0);let o=this._holeCount;n._setUint32(Ha.Layout.HOLE_OFFSET_U32,o),n._setUint32(Ha.Layout.HOLE_COUNT_U32,0);let r=this._triangleCount;return n._setUint32(Ha.Layout.TRIANGLE_OFFSET_U32,r),n._setUint32(Ha.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=iU(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},af=JK;var{ERR_RESIZE:N7n,ERR_CAPACITY:F7n}=us.Error,VE=class VE extends la{constructor(){super(...arguments);lt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(VE.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(VE.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:o}=this,r=this._collection._positionView;if(!l(n)){let a=r.byteOffset+i*3*r.BYTES_PER_ELEMENT,s=r.constructor;return new s(r.buffer,a,o*3)}for(let a=0;a<o;a++)n[a*3]=r[(i+a)*3],n[a*3+1]=r[(i+a)*3+1],n[a*3+2]=r[(i+a)*3+2];return n}setPositions(n){let i=this._collection,o=this.vertexOffset,r=this.vertexCount,a=n.length/3,s=i._positionCount+a-r;i._positionCount=s,this._setUint32(VE.Layout.POSITION_COUNT_U32,a);let c=i._positionView;for(let u=0;u<a;u++)c[(o+u)*3]=n[u*3],c[(o+u)*3+1]=n[u*3+1],c[(o+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};lt(VE,"Layout",{...la.Layout,POSITION_OFFSET_U32:la.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:la.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:la.Layout.__BYTE_LENGTH+8});var ZK=VE,yc=ZK;var oU=`#ifdef USE_FLOAT64
  9915. in vec3 positionHigh;
  9916. in vec3 positionLow;
  9917. in vec3 prevPositionHigh;
  9918. in vec3 prevPositionLow;
  9919. in vec3 nextPositionHigh;
  9920. in vec3 nextPositionLow;
  9921. #else
  9922. in vec3 position;
  9923. in vec3 prevPosition;
  9924. in vec3 nextPosition;
  9925. #endif
  9926. in vec4 pickColor;
  9927. in vec4 showColorWidthAndTexCoord;
  9928. in float alpha;
  9929. out vec4 v_pickColor;
  9930. out vec4 v_color;
  9931. out vec2 v_st;
  9932. out float v_width;
  9933. out float v_polylineAngle;
  9934. void main()
  9935. {
  9936. float show = showColorWidthAndTexCoord.x;
  9937. vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);
  9938. float width = showColorWidthAndTexCoord.z;
  9939. float texCoord = showColorWidthAndTexCoord.w;
  9940. ///////////////////////////////////////////////////////////////////////////
  9941. bool usePrevious = texCoord == 1.0;
  9942. float expandDir = gl_VertexID % 2 == 1 ? 1.0 : -1.0;
  9943. float polylineAngle;
  9944. #ifdef USE_FLOAT64
  9945. vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);
  9946. vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);
  9947. vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);
  9948. vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
  9949. #else
  9950. vec4 positionEC = czm_modelView * vec4(position, 1.0);
  9951. vec4 prevPositionEC = czm_modelView * vec4(prevPosition, 1.0);
  9952. vec4 nextPositionEC = czm_modelView * vec4(nextPosition, 1.0);
  9953. // Positions are already in eye space; use the EC variant to skip the redundant transform.
  9954. vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
  9955. #endif
  9956. ///////////////////////////////////////////////////////////////////////////
  9957. gl_Position = czm_viewportOrthographic * positionWC * show;
  9958. v_pickColor = pickColor / 255.0;
  9959. v_color = color;
  9960. v_color.a *= alpha / 255.0 * show;
  9961. v_st.s = texCoord;
  9962. v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
  9963. v_width = width;
  9964. v_polylineAngle = polylineAngle;
  9965. }
  9966. `;var rU=`in vec4 v_pickColor;
  9967. in vec4 v_color;
  9968. void main()
  9969. {
  9970. if (v_color.a < 0.005) // matches 0/255 and 1/255
  9971. {
  9972. discard;
  9973. }
  9974. out_FragColor = czm_gammaCorrect(v_color);
  9975. czm_writeLogDepth();
  9976. }
  9977. `;var nP=class nP extends bu{constructor(t=G.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.WIDTH_U8+i,t.width)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getUint8(this.Layout.WIDTH_U8+n),i}toJSON(){return{...super.toJSON(),width:this.width}}};lt(nP,"Layout",{...bu.Layout,WIDTH_U8:bu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:bu.Layout.__BYTE_LENGTH+4}),lt(nP,"DEFAULT_MATERIAL",Object.freeze(new nP));var eQ=nP,lp=eQ;var zx={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},aU={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},xc=new yc,iP=new lp,j0=new U,jE=new h,Ux=new h,Vx=new h,jx=new Tn,Gx=new Tn,Hx=new Tn;function Mit(e,t,n){let i=t.context;n=n||{destroy:Nit};let o=e._positionDatatype===Y.DOUBLE,r=o?zx:aU;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,u=e.vertexCountMax*2;n.indexArray=Ue.createTypedArray(u,c*6),n.attributeArrays={...o?{positionHigh:new Float32Array(u*3),positionLow:new Float32Array(u*3),prevPositionHigh:new Float32Array(u*3),prevPositionLow:new Float32Array(u*3),nextPositionHigh:new Float32Array(u*3),nextPositionLow:new Float32Array(u*3)}:{position:Y.createTypedArray(e._positionDatatype,u*3),prevPosition:Y.createTypedArray(e._positionDatatype,u*3),nextPosition:Y.createTypedArray(e._positionDatatype,u*3)},pickColor:new Uint8Array(u*4),showColorWidthAndTexCoord:new Float32Array(u*4),alpha:new Uint8Array(u)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:u}=e,{attributeArrays:f}=n,d=n.indexArray,p=f.pickColor,g=f.showColorWidthAndTexCoord,m=f.alpha;for(let A=c,y=c+u;A<y;A++){if(e.get(A,xc),!xc._dirty)continue;xc.getMaterial(iP);let x=on.encodeRGB8(iP.color),b=iP.color.alpha;U.fromRgba(xc._pickId,j0);let T=xc.show,E=xc.vertexOffset*2,S=(xc.vertexOffset-A)*6,w=xc.vertexCount;if(o){let P=xc.getPositions();for(let O=0;O<w;O++){let B=O===0,L=O===w-1;h.fromArray(P,O*3,jE),B?(h.fromArray(P,(O+1)*3,Vx),h.subtract(jE,Vx,Ux),h.add(jE,Ux,Ux)):L?(h.fromArray(P,(O-1)*3,Ux),h.subtract(jE,Ux,Vx),h.add(jE,Vx,Vx)):(h.fromArray(P,(O-1)*3,Ux),h.fromArray(P,(O+1)*3,Vx)),L||(d[S]=E,d[S+1]=E+1,d[S+2]=E+2,d[S+3]=E+2,d[S+4]=E+1,d[S+5]=E+3,S+=6),Tn.fromCartesian(jE,jx),Tn.fromCartesian(Ux,Gx),Tn.fromCartesian(Vx,Hx);for(let _=0;_<2;_++)f.positionHigh[E*3]=jx.high.x,f.positionHigh[E*3+1]=jx.high.y,f.positionHigh[E*3+2]=jx.high.z,f.positionLow[E*3]=jx.low.x,f.positionLow[E*3+1]=jx.low.y,f.positionLow[E*3+2]=jx.low.z,f.prevPositionHigh[E*3]=Gx.high.x,f.prevPositionHigh[E*3+1]=Gx.high.y,f.prevPositionHigh[E*3+2]=Gx.high.z,f.prevPositionLow[E*3]=Gx.low.x,f.prevPositionLow[E*3+1]=Gx.low.y,f.prevPositionLow[E*3+2]=Gx.low.z,f.nextPositionHigh[E*3]=Hx.high.x,f.nextPositionHigh[E*3+1]=Hx.high.y,f.nextPositionHigh[E*3+2]=Hx.high.z,f.nextPositionLow[E*3]=Hx.low.x,f.nextPositionLow[E*3+1]=Hx.low.y,f.nextPositionLow[E*3+2]=Hx.low.z,p[E*4]=U.floatToByte(j0.red),p[E*4+1]=U.floatToByte(j0.green),p[E*4+2]=U.floatToByte(j0.blue),p[E*4+3]=U.floatToByte(j0.alpha),g[E*4]=T?1:0,g[E*4+1]=x,g[E*4+2]=iP.width,g[E*4+3]=O/(w-1),m[E]=b*255,E++}}else{let P=e._positionView,O=xc.vertexOffset*3,B=f.position,L=f.prevPosition,_=f.nextPosition;for(let C=0;C<w;C++){let v=C===0,I=C===w-1,M=P[O+C*3],N=P[O+C*3+1],j=P[O+C*3+2],k,V,F,W,q,J;v?(W=P[O+3],q=P[O+3+1],J=P[O+3+2],k=2*M-W,V=2*N-q,F=2*j-J):I?(k=P[O+(C-1)*3],V=P[O+(C-1)*3+1],F=P[O+(C-1)*3+2],W=2*M-k,q=2*N-V,J=2*j-F):(k=P[O+(C-1)*3],V=P[O+(C-1)*3+1],F=P[O+(C-1)*3+2],W=P[O+(C+1)*3],q=P[O+(C+1)*3+1],J=P[O+(C+1)*3+2]),I||(d[S]=E,d[S+1]=E+1,d[S+2]=E+2,d[S+3]=E+2,d[S+4]=E+1,d[S+5]=E+3,S+=6);for(let H=0;H<2;H++)B[E*3]=M,B[E*3+1]=N,B[E*3+2]=j,L[E*3]=k,L[E*3+1]=V,L[E*3+2]=F,_[E*3]=W,_[E*3+1]=q,_[E*3+2]=J,p[E*4]=U.floatToByte(j0.red),p[E*4+1]=U.floatToByte(j0.green),p[E*4+2]=U.floatToByte(j0.blue),p[E*4+3]=U.floatToByte(j0.alpha),g[E*4]=T?1:0,g[E*4+1]=x,g[E*4+2]=iP.width,g[E*4+3]=C/(w-1),m[E]=b*255,E++}}xc._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=Lit(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in r)if(Object.hasOwn(r,p)){let g=p;n.vertexArray.copyAttributeFromRange(r[g],n.attributeArrays[g],f,d)}}}else{let c=n.attributeArrays;n.vertexArray=new Fn({context:i,indexBuffer:Ke.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Oe.STATIC_DRAW,indexDatatype:Ue.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:zx.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:zx.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Oe.STATIC_DRAW})},{index:zx.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:zx.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Oe.STATIC_DRAW})},{index:zx.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Oe.STATIC_DRAW})},{index:zx.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:Ke.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Oe.STATIC_DRAW})}]:[{index:aU.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ke.createVertexBuffer({typedArray:c.position,context:i,usage:Oe.STATIC_DRAW})},{index:aU.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ke.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Oe.STATIC_DRAW})},{index:aU.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:Ke.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Oe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:Ke.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Oe.STATIC_DRAW})},{index:r.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:Ke.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Oe.STATIC_DRAW})},{index:r.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:Ke.createVertexBuffer({typedArray:c.alpha,context:i,usage:Oe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ve.fromCache({blending:e._blendOption===Oi.OPAQUE?Jt.DISABLED:Jt.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new He({sources:[ru,oU],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new He({sources:[rU]}),attributeLocations:r}));let a=Bit(e);l(n.command)||(n.command=new tt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Re.TRIANGLES,pass:e._blendOption===Oi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:a,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==a&&(s.count=a),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._dirtyCount=0,e._dirtyOffset=0,n}function Bit(e){return(e.vertexCount-e.primitiveCount)*6}function Lit(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,xc);let i=xc.vertexOffset*2,r=(xc.vertexOffset-t)*6;e.get(t+n-1,xc);let a=(xc.vertexOffset+xc.vertexCount)*2-i,c=(a/2-n)*6;return{indexOffset:r,indexCount:c,vertexOffset:i,vertexCount:a}}function Nit(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ve.removeFromCache(e.renderState)}var sU=Mit;var tQ=class e extends us{_getCollectionClass(){return e}_getPrimitiveClass(){return yc}_getMaterialClass(){return lp}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,vertexCountMax:t.vertexCountMax,positionDatatype:t.positionDatatype,positionNormalized:t.positionNormalized})}add(t,n=new yc){super.add(t,n);let i=this._positionCount;return n._setUint32(yc.Layout.POSITION_OFFSET_U32,i),n._setUint32(yc.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=sU(this,t,this._renderContext))}},sf=tQ;function GE(e,t){this._conditionsExpression=qe(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,kit(this,t)}Object.defineProperties(GE.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Fit(e,t){this.condition=e,this.expression=t}function kit(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let a=i[r],s=String(a[0]),c=String(a[1]);n.push(new Fit(new dh(s,t),new dh(c,t)))}e._runtimeConditions=n}GE.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)}};GE.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)}};GE.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",a=o.length;for(let s=0;s<a;++s){let c=o[s],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${s===0?"if":"else if"} (${u})
  9978. {
  9979. return ${f};
  9980. }
  9981. `}return r=`${i} ${e}
  9982. {
  9983. ${r} return ${i}(1.0);
  9984. }
  9985. `,r};GE.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];Jn(e,o.condition.getVariables()),Jn(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var cU=GE;function aA(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._lineWidth=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,zit(this,e)}function zit(e,t){t=qe(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,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,o=t.meta??G.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new dh(o[r],i))}e._meta=n,e._ready=!0}function tr(e,t){let n=(e._style??G.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new dh(String(t));if(typeof t=="string")return new dh(t,n);if(l(t.conditions))return new cU(t,n)}else return;return t}function nr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return qe(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(aA.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=tr(this,e),this._style.show=nr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=tr(this,e),this._style.color=nr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=tr(this,e),this._style.pointSize=nr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=tr(this,e),this._style.pointOutlineColor=nr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=tr(this,e),this._style.pointOutlineWidth=nr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=tr(this,e),this._style.labelColor=nr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=tr(this,e),this._style.labelOutlineColor=nr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=tr(this,e),this._style.labelOutlineWidth=nr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=tr(this,e),this._style.font=nr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=tr(this,e),this._style.labelStyle=nr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=tr(this,e),this._style.labelText=nr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=tr(this,e),this._style.backgroundColor=nr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=tr(this,e),this._style.backgroundPadding=nr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=tr(this,e),this._style.backgroundEnabled=nr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=tr(this,e),this._style.scaleByDistance=nr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=tr(this,e),this._style.translucencyByDistance=nr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=tr(this,e),this._style.distanceDisplayCondition=nr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=tr(this,e),this._style.heightOffset=nr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=tr(this,e),this._style.anchorLineEnabled=nr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=tr(this,e),this._style.anchorLineColor=nr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=tr(this,e),this._style.image=nr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=tr(this,e),this._style.disableDepthTestDistance=nr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=tr(this,e),this._style.horizontalOrigin=nr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=tr(this,e),this._style.verticalOrigin=nr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=tr(this,e),this._style.labelHorizontalOrigin=nr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=tr(this,e),this._style.labelVerticalOrigin=nr(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=tr(this,e),this._style.lineWidth=nr(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});aA.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new aA(n)})};aA.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)};aA.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)};aA.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)};aA.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Jn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Jn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Jn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var sA=aA;var m0e=new Jc,p0e=new yc,g0e=new Ha,Uit=new sp,Vit=new lp,jit=new cp,nQ=class{constructor(t,n,i=0){lt(this,"_color",new U);lt(this,"_outlineColor",new U);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return U.clone(t.color,this._color);return U.clone(U.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())U.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())U.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())U.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())U.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return as.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new _e("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(rf,m0e),yield*this._iteratePrimitivesWith(sf,p0e),yield*this._iteratePrimitivesWith(af,g0e)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let o=0;o<i.length;o++){let r=i[o],a=this._primitivesByCollection.get(o);if(a&&r instanceof t)for(let s of a)r.get(s,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(rf,m0e,Uit)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(sf,p0e,Vit)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(af,g0e,jit)}*_iterateMaterialsWith(t,n,i){for(let o of this._iteratePrimitivesWith(t,n))o.getMaterial(i),yield i,o.setMaterial(i)}},HE=nQ;var _0e=new h,Git=new Jc,Hit=new yc,y0e=new Ha;function Wit(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let o=0;o<n.length;o++)x0e(e,n[o],R.IDENTITY,i);return i}function lU(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function qit(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,o=e.primitiveType,a=mt.getAttributeBySemantic(e,it.POSITION).count,s=e.indices?Is.readIndicesAsTypedArray(e.indices):void 0;if(o===Re.POINTS)t.pointPrimitiveCount+=a,t.pointVertexCount+=a;else if(o===Re.LINE_STRIP){let c=n?n.count:A0e(s);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=s.length-c+1}else if(o===Re.TRIANGLES||o===Re.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=a,t.polygonTriangleCount+=s.length/3;let c=n.polygonHoleCounts;if(c)for(let u=0;u<c.length;u++)t.polygonHoleCount+=c[u]}else{let c=A0e(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new re(`Unexpected primitive type: ${o}`);return t}function A0e(e){let t=lU(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function Yit(e,t,n,i,o){let r=mt.getAttributeBySemantic(t,it.POSITION),a=r.typedArray??(n.positionNormalized?Is.readAttributeAsRawCompactTypedArray(r):Is.readAttributeAsTypedArray(r)),s=t.indices?Is.readIndicesAsTypedArray(t.indices):void 0,c=Xit(e,t,o);n instanceof rf?Kit(n,i,a,s,c):n instanceof sf?Qit(n,i,a,s,c):n instanceof af&&(l(t.vector)?$it(n,i,a,s,c,t.vector):Jit(n,i,a,c,t.polygon))}function Xit(e,t,n){let i=e.tileset.featureIdLabel,o=mt.getFeatureIdsByLabel(t.featureIds,i);if(!(o instanceof yn.FeatureIdAttribute))return()=>{};let r=mt.getAttributeBySemantic(t,it.FEATURE_ID,o.setIndex),a=r.typedArray??Is.readAttributeAsTypedArray(r);for(let s=0;s<a.length;s++){let c=a[s];if(!n.has(c)){let u=new HE(e,c,o.propertyTableId);n.set(c,u)}}return function(c){let u=a[c];if(u!==o.nullFeatureId)return n.get(u)}}function Kit(e,t,n,i,o){let r=n.length/3;for(let a=0,s=i?i.length:r;a<s;a++){let c=i?i[a]:a;h.fromArray(n,c*3,_0e);let u=o(c);u&&u.addPrimitiveByCollection(t,a),e.add({position:_0e,pickObject:u,featureId:u?.featureId},Git)}}function Qit(e,t,n,i,o){let r=lU(i),a=0,s=0,c=0;for(let u=0;u<i.length;u++){if(i[u]===r?s=u-a:u+1===i.length&&(s=u+1-a),s===0)continue;let d=a+s,p=i.subarray(a,d),g=b0e(n,p,3),m=o(i[a]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},Hit),a=u+1,s=0,c++}}function $it(e,t,n,i,o,r){let a=r.polygonAttributeOffsets,s=r.polygonIndicesOffsets,c=r.polygonHoleCounts,u=r.polygonHoleOffsets,f=n.length/3,d=a.length;for(let p=0;p<d;p++){let g=a[p],m=p+1<d?a[p+1]:f,A=n.subarray(g*3,m*3),y;if(l(c)&&c[p]>0){let S=c[p];y=u.slice(p,p+S);for(let w=0;w<S;w++)y[w]-=g}let x=s[p],b=p+1<d?s[p+1]:i.length,T=i.slice(x,b);for(let S=0;S<T.length;S++)T[S]-=g;let E=o(g);E&&E.addPrimitiveByCollection(t,p),e.add({positions:A,triangles:T,holes:y,pickObject:E,featureId:E?.featureId},y0e)}}function Jit(e,t,n,i,o){let r=o.loopIndices.constructor,a=new r(o.loopIndices.length),s=lU(o.loopIndices);for(let c=0;c<o.count;c++){let u=c+1===o.count,f=o.loopIndicesOffsets[c],d=u?o.loopIndices.length:o.loopIndicesOffsets[c+1],p=o.loopIndices.subarray(f,d),g=b0e(n,p,3,a),m=[];for(let b=0;b<p.length;b++){let T=b+1===p.length;p[b]===s&&!T&&m.push(b)}let A=new r(m),y;if(l(o.triangleIndices)){let b=o.triangleIndicesOffsets[c],T=u?o.triangleIndices.length:o.triangleIndicesOffsets[c+1];y=o.triangleIndices.subarray(b,T);for(let E=0;E<y.length;E++)y[E]=a[y[E]]}else throw new Error("Runtime triangulation not yet supported.");let x=i(p[0]);x&&x.addPrimitiveByCollection(t,c),e.add({positions:g,triangles:y,holes:A,pickObject:x,featureId:x?.featureId},y0e)}}function x0e(e,t,n,i){let o=mt.getNodeTransform(t),r=R.multiplyTransformation(n,o,new R),a=t.primitives;for(let c=0;c<a.length;c++){let u=a[c],f=u.primitiveType,d,p=qit(u),g=mt.getAttributeBySemantic(u,it.POSITION),m=g.normalized??!1,A=g.componentDatatype;f===Re.POINTS?d=new rf({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:A}):f===Re.LINE_STRIP?d=new sf({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:A}):(f===Re.TRIANGLES||f===Re.LINE_LOOP)&&(d=new af({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:m,positionDatatype:A}));let x=u.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(x)||i.featuresByTableId.set(x,new Map),i.collections.push(d),i.collectionLocalMatrices.push(R.clone(r)),i.collectionFeatureTableIds.set(d,x),Yit(e,u,d,i.collections.length-1,i.featuresByTableId.get(x))}let s=t.children;for(let c=0;c<s.length;c++)x0e(e,s[c],r,i)}function b0e(e,t,n,i){let o=lU(t),r=0;for(let u=0;u<t.length;u++)t[u]!==o&&r++;let a=e.constructor,s=new a(r*n),c=0;for(let u=0;u<t.length;u++){let f=t[u];if(i&&(i[f]=f===o?o:c),f!==o){for(let d=0;d<n;d++)s[c*n+d]=e[f*n+d];c++}}return s}var uU=Wit;var fU=new Jc,dU=new yc,hU=new Ha,oP=new sp,iQ=new lp,T0e=new cp,C0e=new R,oQ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=R.clone(R.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof rf).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof af?t+n.triangleCount:n instanceof sf?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new _e("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let o=this.getFeature(t,i);return o?o.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new sA({color:i}))}applyStyle(t){let n=r=>r instanceof rf,i=r=>r instanceof sf,o=r=>r instanceof af;for(let r of this._collections.filter(n)){let a=this._collectionFeatureTableIds.get(r);for(let s=0,c=r.primitiveCount;s<c;s++){r.get(s,fU);let u=this.getFeature(fU.featureId,a);l(t.show)&&(fU.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,oP.color),l(t.pointSize)&&(oP.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(oP.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,oP.outlineColor),fU.setMaterial(oP)}}for(let r of this._collections.filter(i)){let a=this._collectionFeatureTableIds.get(r);for(let s=0,c=r.primitiveCount;s<c;s++){r.get(s,dU);let u=this.getFeature(dU.featureId,a);l(t.show)&&(dU.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,iQ.color),l(t.lineWidth)&&(iQ.width=t.lineWidth.evaluate(u)),dU.setMaterial(iQ)}}for(let r of this._collections.filter(o)){let a=this._collectionFeatureTableIds.get(r);for(let s=0,c=r.primitiveCount;s<c;s++){r.get(s,hU);let u=this.getFeature(hU.featureId,a);l(t.show)&&(hU.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,T0e.color),hU.setMaterial(T0e)}}}update(t,n){if(l(this._model)&&!this._ready){let i=this._model;i.modelMatrix=this._tile.computedTransform,i.update(n),i.ready&&(eot(this),this._ready=!0)}R.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,C0e);for(let i=0;i<this._collections.length;i++)R.multiplyTransformation(C0e,this._collectionLocalMatrices[i],this._collections[i].modelMatrix),this._collections[i].update(n)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._model?.destroy(),this._model=void 0,this._collections.forEach(t=>t.destroy()),this._collections.length=0,fe(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),a=Zit(t,n,r,o),s=await cd.fromGltfAsync(a);return s.show=!1,r._model=s,r}};function Zit(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function eot(e){let t=e._model.sceneGraph.components,n=mt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new R);R.multiplyTransformation(t.transform,n,e._modelMatrix);let i=uU(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var Wx=oQ;function Ks(){}Ks._maxSortingConcurrency=Math.max(cn.hardwareConcurrency-1,1);Ks._sorterTaskProcessor=void 0;Ks._taskProcessorReady=!1;Ks._error=void 0;Ks._getSorterTaskProcessor=function(){if(!l(Ks._sorterTaskProcessor)){let e=new Wn("gaussianSplatSorter",Ks._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?Ks._taskProcessorReady=!0:Ks._error=new re("Gaussian splat sorter could not be initialized.")}).catch(t=>{Ks._error=t}),Ks._sorterTaskProcessor=e}return Ks._sorterTaskProcessor};Ks.radixSortIndexes=function(e){let t=Ks._getSorterTaskProcessor();if(l(Ks._error))throw Ks._error;if(Ks._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var WE=Ks;function Qs(){}Qs._maxSortingConcurrency=Math.max(cn.hardwareConcurrency-1,1);Qs._textureTaskProcessor=void 0;Qs._taskProcessorReady=!1;Qs._error=void 0;Qs._getTextureTaskProcessor=function(){if(!l(Qs._textureTaskProcessor)){let e=new Wn("gaussianSplatTextureGenerator",Qs._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?Qs._taskProcessorReady=!0:Qs._error=new re("Gaussian splat sorter could not be initialized.")}).catch(t=>{Qs._error=t}),Qs._textureTaskProcessor=e}return Qs._textureTaskProcessor};Qs.generateFromAttributes=function(e){let t=Qs._getTextureTaskProcessor();if(l(Qs._error))throw Qs._error;if(!Qs._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var mU=Qs;function tot(e){let t=new i_;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL}})),this.alphaOptions=new ME,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,he.FRAGMENT)}var pU=tot;var gU=`//
  9986. // Vertex shader for Gaussian splats.
  9987. // The splats are rendered as quads in view space. Splat attributes are loaded from a texture with precomputed 3D covariance.
  9988. // Passes local quad coordinates and color to the fragment shader for Gaussian evaluation.
  9989. //
  9990. // Discards splats outside the view frustum or with negligible screen size.
  9991. //
  9992. #if defined(HAS_SPHERICAL_HARMONICS)
  9993. const uint coefficientCount[3] = uint[3](3u,8u,15u);
  9994. const float SH_C1 = 0.48860251;
  9995. const float SH_C2[5] = float[5](
  9996. 1.092548430,
  9997. -1.09254843,
  9998. 0.315391565,
  9999. -1.09254843,
  10000. 0.546274215
  10001. );
  10002. const float SH_C3[7] = float[7](
  10003. -0.59004358,
  10004. 2.890611442,
  10005. -0.45704579,
  10006. 0.373176332,
  10007. -0.45704579,
  10008. 1.445305721,
  10009. -0.59004358
  10010. );
  10011. //Retrieve SH coefficient. Currently RG32UI format
  10012. uvec2 loadSHCoeff(uint splatID, int index) {
  10013. ivec2 shTexSize = textureSize(u_sphericalHarmonicsTexture, 0);
  10014. uint dims = coefficientCount[uint(u_sphericalHarmonicsDegree)-1u];
  10015. uint splatsPerRow = uint(shTexSize.x) / dims;
  10016. uint shIndex = (splatID%splatsPerRow) * dims + uint(index);
  10017. ivec2 shPosCoord = ivec2(shIndex, splatID / splatsPerRow);
  10018. return texelFetch(u_sphericalHarmonicsTexture, shPosCoord, 0).rg;
  10019. }
  10020. //Unpack RG32UI half float coefficients to vec3
  10021. vec3 halfToVec3(uvec2 packed) {
  10022. return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x);
  10023. }
  10024. vec3 loadAndExpandSHCoeff(uint splatID, int index) {
  10025. uvec2 coeff = loadSHCoeff(splatID, index);
  10026. return halfToVec3(coeff);
  10027. }
  10028. vec3 evaluateSH(uint splatID, vec3 viewDir) {
  10029. vec3 result = vec3(0.0);
  10030. int coeffIndex = 0;
  10031. float x = viewDir.x, y = viewDir.y, z = viewDir.z;
  10032. if (u_sphericalHarmonicsDegree >= 1.) {
  10033. vec3 sh1 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10034. vec3 sh2 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10035. vec3 sh3 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10036. result += -SH_C1 * y * sh1 + SH_C1 * z * sh2 - SH_C1 * x * sh3;
  10037. if (u_sphericalHarmonicsDegree >= 2.) {
  10038. float xx = x * x;
  10039. float yy = y * y;
  10040. float zz = z * z;
  10041. float xy = x * y;
  10042. float yz = y * z;
  10043. float xz = x * z;
  10044. vec3 sh4 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10045. vec3 sh5 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10046. vec3 sh6 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10047. vec3 sh7 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10048. vec3 sh8 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10049. result += SH_C2[0] * xy * sh4 +
  10050. SH_C2[1] * yz * sh5 +
  10051. SH_C2[2] * (2.0f * zz - xx - yy) * sh6 +
  10052. SH_C2[3] * xz * sh7 +
  10053. SH_C2[4] * (xx - yy) * sh8;
  10054. if (u_sphericalHarmonicsDegree >= 3.) {
  10055. vec3 sh9 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10056. vec3 sh10 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10057. vec3 sh11 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10058. vec3 sh12 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10059. vec3 sh13 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10060. vec3 sh14 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10061. vec3 sh15 = loadAndExpandSHCoeff(splatID, coeffIndex++);
  10062. result += SH_C3[0] * y * (3.0f * xx - yy) * sh9 +
  10063. SH_C3[1] * xy * z * sh10 +
  10064. SH_C3[2] * y * (4.0f * zz - xx - yy) * sh11 +
  10065. SH_C3[3] * z * (2.0f * zz - 3.0f * xx - 3.0f * yy) * sh12 +
  10066. SH_C3[4] * x * (4.0f * zz - xx - yy) * sh13 +
  10067. SH_C3[5] * z * (xx - yy) * sh14 +
  10068. SH_C3[6] * x * (xx - 3.0f * yy) * sh15;
  10069. }
  10070. }
  10071. }
  10072. return result;
  10073. }
  10074. #endif
  10075. // Transforms and projects splat covariance into screen space and extracts the major and minor axes of the Gaussian ellipsoid
  10076. // which is used to calculate the vertex position in clip space.
  10077. vec4 calcCovVectors(vec3 viewPos, mat3 Vrk) {
  10078. vec4 t = vec4(viewPos, 1.0);
  10079. vec2 focal = vec2(czm_projection[0][0] * czm_viewport.z, czm_projection[1][1] * czm_viewport.w);
  10080. vec2 J1 = focal / t.z;
  10081. vec2 J2 = -focal * vec2(t.x, t.y) / (t.z * t.z);
  10082. mat3 J = mat3(
  10083. J1.x, 0.0, J2.x,
  10084. 0.0, J1.y, J2.y,
  10085. 0.0, 0.0, 0.0
  10086. );
  10087. mat3 R = mat3(czm_modelView);
  10088. //transform our covariance into view space
  10089. //ensures orientation is correct
  10090. mat3 Vrk_view = R * Vrk * transpose(R);
  10091. mat3 cov = transpose(J) * Vrk_view * J;
  10092. float diagonal1 = cov[0][0] + .3;
  10093. float offDiagonal = cov[0][1];
  10094. float diagonal2 = cov[1][1] + .3;
  10095. float mid = 0.5 * (diagonal1 + diagonal2);
  10096. float radius = length(vec2((diagonal1 - diagonal2) * 0.5, offDiagonal));
  10097. float lambda1 = mid + radius;
  10098. float lambda2 = max(mid - radius, 0.1);
  10099. vec2 diagonalVector = normalize(vec2(offDiagonal, lambda1 - diagonal1));
  10100. return vec4(
  10101. min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector,
  10102. min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x)
  10103. );
  10104. }
  10105. highp vec4 discardVec = vec4(0.0, 0.0, 2.0, 1.0);
  10106. void main() {
  10107. uint texIdx = uint(a_splatIndex);
  10108. // u_splatRowMask and u_splatRowShift encode the row width of the splat
  10109. // attribute texture. The texture width is always maximumTextureSize, which
  10110. // varies by GPU, so these are passed as uniforms rather than constants.
  10111. // rowMask = maximumTextureSize/2 - 1
  10112. // rowShift = log2(maximumTextureSize/2)
  10113. uint rowMask = uint(u_splatRowMask);
  10114. uint rowShift = uint(u_splatRowShift);
  10115. ivec2 posCoord = ivec2(int((texIdx & rowMask) << 1), int(texIdx >> rowShift));
  10116. vec4 splatPosition = vec4( uintBitsToFloat(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))) );
  10117. vec4 splatViewPos = czm_modelView * vec4(splatPosition.xyz, 1.0);
  10118. vec4 clipPosition = czm_projection * splatViewPos;
  10119. float clip = 1.2 * clipPosition.w;
  10120. if (clipPosition.z < -clip || clipPosition.x < -clip || clipPosition.x > clip ||
  10121. clipPosition.y < -clip || clipPosition.y > clip) {
  10122. gl_Position = vec4(0.0, 0.0, 2.0, 1.0);
  10123. return;
  10124. }
  10125. ivec2 covCoord = ivec2(int(((texIdx & rowMask) << 1) | 1u), int(texIdx >> rowShift));
  10126. uvec4 covariance = uvec4(texelFetch(u_splatAttributeTexture, covCoord, 0));
  10127. gl_Position = clipPosition;
  10128. vec2 u1 = unpackHalf2x16(covariance.x) ;
  10129. vec2 u2 = unpackHalf2x16(covariance.y);
  10130. vec2 u3 = unpackHalf2x16(covariance.z);
  10131. mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y);
  10132. vec4 covVectors = calcCovVectors(splatViewPos.xyz, Vrk);
  10133. if (dot(covVectors.xy, covVectors.xy) < 4.0 && dot(covVectors.zw, covVectors.zw) < 4.0) {
  10134. gl_Position = discardVec;
  10135. return;
  10136. }
  10137. vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.;
  10138. gl_Position += vec4((corner.x * covVectors.xy + corner.y * covVectors.zw) / czm_viewport.zw * gl_Position.w, 0, 0);
  10139. gl_Position.z = clamp(gl_Position.z, -abs(gl_Position.w), abs(gl_Position.w));
  10140. v_vertPos = corner ;
  10141. v_splatColor = vec4(covariance.w & 0xffu, (covariance.w >> 8) & 0xffu, (covariance.w >> 16) & 0xffu, (covariance.w >> 24) & 0xffu) / 255.0;
  10142. #if defined(HAS_SPHERICAL_HARMONICS)
  10143. vec4 splatWC = czm_inverseView * splatViewPos;
  10144. vec3 viewDirModel = normalize(u_inverseModelRotation * (splatWC.xyz - u_cameraPositionWC.xyz));
  10145. v_splatColor.rgb += evaluateSH(texIdx, viewDirModel).rgb;
  10146. #endif
  10147. v_splitDirection = u_splitDirection;
  10148. }`;var _U=`//
  10149. // Fragment shader for Gaussian splats.
  10150. // Renders a Gaussian splat within a quad, discarding fragments outside the unit circle.
  10151. // Applies an approximate Gaussian falloff based on distance from the center and outputs
  10152. // a color modulated by the alpha and Gaussian weight.
  10153. //
  10154. void main() {
  10155. if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
  10156. if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
  10157. float A = -dot(v_vertPos, v_vertPos);
  10158. if (A < -4.) {
  10159. discard;
  10160. }
  10161. float B = exp(A * 4.) * v_splatColor.a ;
  10162. out_FragColor = vec4(v_splatColor.rgb * B , B);
  10163. }
  10164. `;var qx=new R,D0e=new R,rP=new R,mi=new $,aP=new Le,not=new h,iot=new Le,oot=new h,rot=1e-12,AU=1e-5,rQ=1e-7,Rs={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Sa={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},aot=2,sot=30,cot=3,lot=.008726646259971648,uot=1;function fot(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<cot)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=uot?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=lot:!1}function E0e(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function dot(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function v0e(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function aQ(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function S0e(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function hot(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let o=0;o<n.length;o++){let r=n[o];t-r.frameNumber>0?r.texture.destroy():i.push(r)}e._retiredTextures=i}function mot(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function pot(e,t,n,i){let o=e._aggregateScratchBuffers[t];l(o)||(o=[],e._aggregateScratchBuffers[t]=o);let r=mot(e._snapshot,t);for(let s=0;s<o.length;s++){let c=o[s];if(c.length>=i&&c.buffer!==r)return c}let a=Y.createTypedArray(n,i);return o.push(a),a}function got(e,t){return e.length===t?e:e.subarray(0,t)}function _ot(e,t,n){if(!l(t.indexes)||t.state!==Sa.READY)throw new _e("Committing snapshot before it is READY.");let i=n.frameNumber,o=e._snapshot,r=l(o)?o.gaussianSplatTexture:e.gaussianSplatTexture;l(r)&&r!==t.gaussianSplatTexture&&S0e(e,r,i);let a=l(o)?o.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(a)&&a!==t.sphericalHarmonicsTexture&&S0e(e,a,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Rs.IDLE,e._dirty=!1}async function Aot(e,t,n,i){try{let o=await i,r=Mt.maximumTextureSize,a=r,s=Math.ceil(n.numSplats/(r/2)),c=Math.log2(r/2),u=r/2-1;if(s>r){let g=n.numSplats;s=r;let m=a/2;if(n.numSplats=r*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let A=n.shData.length/g;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*A))}n.splatBudgetSSEScale=g/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${g} splats exceed the maximum texture capacity (${r}\xD7${m} = ${n.numSplats} splats at width=${a}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=a*s*4,d;f<=o.data.length?d=o.data.subarray(0,f):(d=new Uint32Array(f),d.set(o.data));let p={width:a,height:s,data:d};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Sa.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=I0e(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=I0e(t.context,p),g.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let g=n.sphericalHarmonicsTexture,m=Mt.maximumTextureSize,A=n.shCoefficientCount/3,y=Math.floor(m/A),x=y*(A*2),b=Math.ceil(n.numSplats/y);if(b>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${b} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(g)&&g.destroy(),n.sphericalHarmonicsTexture=void 0;else{let T=new Uint32Array(m*b*2),E=0;for(let S=0;E<n.shData.length;S+=m*2)T.set(n.shData.subarray(E,E+x),S),E+=x;n.sphericalHarmonicsTexture=xot(t.context,{data:T,width:m,height:b}),l(g)&&g.destroy()}}n.state=Sa.TEXTURE_READY}catch(o){console.error("Error generating Gaussian splat texture:",o),n.state=Sa.BUILDING}}async function yot(e,t,n,i){try{let o=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let r=n.expectedCount,a=r,s=o?.length;if(r!==a||s!==r){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Sa.SORTING&&(n.snapshot.state=Sa.TEXTURE_READY);return}let c=n.snapshot;c.indexes=o,c.state=Sa.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,_ot(e,c,t),e._pendingSnapshot=void 0,Ll.buildGSplatDrawCommand(e,t)}catch(o){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Sa.SORTING&&(n.snapshot.state=Sa.TEXTURE_READY),e._sorterState=Rs.ERROR,e._sorterError=o}}async function w0e(e,t,n){try{let i=await n,o=v0e(e,t),r=t?.expectedCount,a=r,s=i?.length;if(!o||(r!==a||s!==r)){o&&(e._sorterPromise=void 0,e._sorterState=Rs.IDLE);return}e._indexes=i,e._sorterState=Rs.SORTED}catch(i){if(!v0e(e,t))return;e._sorterState=Rs.ERROR,e._sorterError=i}}function xot(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Xe.RG_INTEGER,pixelDatatype:je.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function I0e(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Xe.RGBA_INTEGER,pixelDatatype:je.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function Ll(e){e=e??G.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new R,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=Vr.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new R,this._rootTransform=void 0,this._axisCorrectionMatrix=mt.getAxisCorrectionMatrix(Fi.Y,Fi.X,new R),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Rs.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(Ll.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Sa.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});Ll.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};Ll.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,aQ(this._pendingSnapshot),aQ(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),fe(this)};Ll.prototype.isDestroyed=function(){return this._isDestroyed};Ll.prototype.onTileLoad=function(e){this._dirty=!0};Ll.prototype.onTileVisible=function(e){};Ll.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=pt.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let o=i._rootTransform,r=R.multiplyTransformation(t,i._axisCorrectionMatrix,qx);R.multiplyTransformation(r,e.content.worldTransform,r);let a=R.inverse(o,D0e),s=R.multiplyTransformation(a,r,qx),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&R.equalsEpsilon(s,c,rot))return;let u=e.content.positions,f=e.content.rotations,d=e.content.scales,p=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]),g=Math.sqrt(s[4]*s[4]+s[5]*s[5]+s[6]*s[6]),m=Math.sqrt(s[8]*s[8]+s[9]*s[9]+s[10]*s[10]);mi[0]=s[0]/p,mi[1]=s[1]/p,mi[2]=s[2]/p,mi[3]=s[4]/g,mi[4]=s[5]/g,mi[5]=s[6]/g,mi[6]=s[8]/m,mi[7]=s[9]/m,mi[8]=s[10]/m;let A=mi[0]*mi[3]+mi[1]*mi[4]+mi[2]*mi[5],y=mi[0]*mi[6]+mi[1]*mi[7]+mi[2]*mi[8],x=mi[3]*mi[6]+mi[4]*mi[7]+mi[5]*mi[8],b=Math.abs(p-1)<=rQ&&Math.abs(g-1)<=rQ&&Math.abs(m-1)<=rQ,T=Math.abs(A)<=AU&&Math.abs(y)<=AU&&Math.abs(x)<=AU,E=mi[0]*(mi[4]*mi[8]-mi[5]*mi[7])-mi[3]*(mi[1]*mi[8]-mi[2]*mi[7])+mi[6]*(mi[1]*mi[5]-mi[2]*mi[4]),S=b&&T&&Math.abs(E-1)<=AU;Le.fromRotationMatrix(mi,aP),Le.normalize(aP,aP);let w=mt.getAttributeBySemantic(n,it.POSITION).typedArray,P=mt.getAttributeBySemantic(n,it.ROTATION).typedArray,O=mt.getAttributeBySemantic(n,it.SCALE).typedArray,B=not,L=iot,_=oot;for(let C=0;C<w.length/3;++C)B.x=w[C*3],B.y=w[C*3+1],B.z=w[C*3+2],L.x=P[C*4],L.y=P[C*4+1],L.z=P[C*4+2],L.w=P[C*4+3],_.x=O[C*3],_.y=O[C*3+1],_.z=O[C*3+2],S?(R.multiplyByPoint(s,B,B),Le.multiply(aP,L,L),Le.normalize(L,L)):(R.fromTranslationQuaternionRotationScale(B,L,_,rP),R.multiplyTransformation(s,rP,rP),R.getTranslation(rP,B),R.getScale(rP,_),Le.multiply(aP,L,L),Le.normalize(L,L)),u[C*3]=B.x,u[C*3+1]=B.y,u[C*3+2]=B.z,f[C*4]=L.x,f[C*4+1]=L.y,f[C*4+2]=L.z,f[C*4+3]=L.w,d[C*3]=_.x,d[C*3+1]=_.y,d[C*3+2]=_.z;e.content._lastSplatTransform=R.clone(s,e.content._lastSplatTransform),e.content._transformed=!0};Ll.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Sa.BUILDING)return;n.state=Sa.TEXTURE_PENDING;let i=mU.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Sa.BUILDING;return}Aot(e,t,n,i)};Ll.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new pU(e),{shaderBuilder:o}=i,r=i.renderStateOptions;r.cull.enabled=!1,r.depthMask=!1,r.depthTest.enabled=!0,r.blending=Jt.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Ie.GAUSSIAN_SPLATS,o.addAttribute("vec2","a_screenQuadPosition"),o.addAttribute("float","a_splatIndex"),o.addVarying("vec4","v_splatColor"),o.addVarying("vec2","v_vertPos"),o.addUniform("float","u_splitDirection",he.VERTEX),o.addVarying("float","v_splitDirection"),o.addUniform("highp usampler2D","u_splatAttributeTexture",he.VERTEX),o.addUniform("float","u_sphericalHarmonicsDegree",he.VERTEX),o.addUniform("float","u_splatScale",he.VERTEX),o.addUniform("vec3","u_cameraPositionWC",he.VERTEX),o.addUniform("mat3","u_inverseModelRotation",he.VERTEX);let a=i.uniformMap;o.addUniform("int","u_splatRowMask",he.VERTEX),o.addUniform("int","u_splatRowShift",he.VERTEX);let s=e.gaussianSplatTexture;a.u_splatAttributeTexture=function(){return s},a.u_splatRowMask=function(){return e._splatRowMask},a.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(o.addDefine("HAS_SPHERICAL_HARMONICS","1",he.VERTEX),o.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",he.VERTEX),a.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),a.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},a.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},a.u_inverseModelRotation=function(){return e._shInverseRotation},a.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Re.TRIANGLE_STRIP,o.addVertexLines(gU),o.addFragmentLines(_U);let u=o.buildShaderProgram(t.context),f=qe(Ve.fromCache(i.renderStateOptions),!0);f.cull.face=mt.getCullFace(n.modelMatrix,Re.TRIANGLE_STRIP),f=Ve.fromCache(f);let d={screenQuadPosition:0,splatIndex:2},p=new yn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=Y.UNSIGNED_INT,p.type=Ft.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let x=new At({attributes:{screenQuadPosition:new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Re.TRIANGLE_STRIP});e._vertexArray=Fn.fromGeometry({context:t.context,geometry:x,attributeLocations:d,bufferUsage:Oe.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=R.clone(e._rootTransform,e._drawCommandModelMatrix),A=e._vertexArray,y=new tt({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:a,renderState:f,vertexArray:A,shaderProgram:u,cull:r.cull.enabled,pass:Ie.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Re.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=y};Ll.prototype.update=function(e){let t=this._tileset;if(hot(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Rs.IDLE){let o=t._selectedTiles.length!==0&&dot(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):o?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(o||this._dirty)&&(this._needsSnapshotRebuild=!0);let r=this._selectedTilesStableFrames>=aot,a=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let s=r||a||this._snapshotRebuildStallFrames>=sot;if(!(this._dirty||this._needsSnapshotRebuild||o||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&R.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&s){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Rs.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&aQ(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=pt.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],S=R.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,D0e);R.multiplyTransformation(S,E.content.worldTransform??R.IDENTITY,S),R.getRotation(R.inverse(S,S),this._shInverseRotation)}for(let E of u)Ll.transformTile(E);let f=u.reduce((E,S)=>E+S.content.pointsLength,0),d=(E,S,w,P)=>{let O,B=0,L=0;for(let _ of u){let C=w(_.content),v=l(P)?P:Ft.getNumberOfComponents(C.type),I=l(C.typedArray)?C.typedArray:C;L+=I.length,l(O)||(O=pot(this,E,S,f*v))}if(!l(O))return Y.createTypedArray(S,0);for(let _ of u){let C=_.content,v=w(C),I=l(v.typedArray)?v.typedArray:v;O.set(I,B),B+=I.length}return got(O,L)},p=()=>{let E=0;for(let O of u)if(O.content.sphericalHarmonicsDegree>0){switch(O.content.sphericalHarmonicsDegree){case 1:E=9;break;case 2:E=24;break;case 3:E=45;break}break}if(E===0)return;let S=f*(E*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<S)&&(this._scratchAggregateShBuffer=new Uint32Array(S));let w=this._scratchAggregateShBuffer,P=0;for(let O of u){let B=O.content.packedSphericalHarmonicsData;O.content.sphericalHarmonicsDegree>0&&(w.set(B,P),P+=B.length)}return P<w.length?w.subarray(0,P):w},g=d("positions",Y.FLOAT,E=>E.positions,3),m=d("scales",Y.FLOAT,E=>E.scales,3),A=d("rotations",Y.FLOAT,E=>E.rotations,4),y=d("colors",Y.UNSIGNED_BYTE,E=>mt.getAttributeBySemantic(E.gltfPrimitive,it.COLOR)),x=u[0].content.sphericalHarmonicsDegree,b=x>0?u[0].content.sphericalHarmonicsCoefficientCount:0,T=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:g,rotations:A,scales:m,colors:y,shData:T,sphericalHarmonicsDegree:x,shCoefficientCount:b,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Sa.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===Sa.BUILDING){Ll.generateSplatTexture(this,e,u);return}if(u.state===Sa.TEXTURE_PENDING||u.state===Sa.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(R.clone(i.viewMatrix,this._prevViewMatrix),R.multiply(i.viewMatrix,this._rootTransform,qx),u.state===Sa.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,d=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:d,expectedCount:u.numSplats,snapshot:u};let p=WE.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(qx),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Sa.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Sa.SORTING;let g=this._pendingSort;yot(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Sa.SORTING&&(u.state=Sa.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(R.clone(i.viewMatrix,this._prevViewMatrix),R.multiply(i.viewMatrix,this._rootTransform,qx),!l(this._sorterPromise)){if(!fot(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=WE.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(qx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){E0e(this,e);let g=this._activeSort;this._sorterState=Rs.SORTING,w0e(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Rs.WAITING;return}this._sorterState=Rs.SORTING;return}else if(this._sorterState===Rs.WAITING){if(!l(this._sorterPromise)){let o=++this._sortRequestId,r=this._splatDataGeneration,a=this._numSplats;this._activeSort={requestId:o,dataGeneration:r,expectedCount:a};let s=WE.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(qx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=s,l(s)){E0e(this,e);let c=this._activeSort;this._sorterState=Rs.SORTING,w0e(this,c,s);return}}if(!l(this._sorterPromise)){this._sorterState=Rs.WAITING;return}this._sorterState=Rs.SORTING;return}else{if(this._sorterState===Rs.SORTING)return;if(this._sorterState===Rs.SORTED)Ll.buildGSplatDrawCommand(this,e),this._sorterState=Rs.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Rs.ERROR)throw this._sorterError}this._dirty=!1}};var yU=Ll;var cQ=class e{constructor(t,n,i,o){this._tileset=n,this._tile=i,this._resource=o,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new yU({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Hs("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions
  10165. Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,o){let r=i,a=De.createIfNeeded(r),s={releaseGltfJson:!1,upAxis:Fi.Y,forwardAxis:Fi.Z};l(o.asset)?(s.gltfJson=o,s.baseResource=a,s.gltfResource=a):o instanceof Uint8Array?(s.typedArray=o,s.baseResource=a,s.gltfResource=a):s.gltfResource=De.createIfNeeded(o);let c=new id(s);try{await c.load()}catch(u){throw c.destroy(),new re(`Failed to load glTF: ${u.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=mt.getAttributeBySemantic(this.gltfPrimitive,it.POSITION).typedArray.slice(),this._rotations=mt.getAttributeBySemantic(this.gltfPrimitive,it.ROTATION).typedArray.slice(),this._scales=mt.getAttributeBySemantic(this.gltfPrimitive,it.SCALE).typedArray.slice();let{l:o,n:r}=Tot(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=o,this._sphericalHarmonicsCoefficientCount=r,this._packedSphericalHarmonicsData=Sot(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),fe(this)}};function bot(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function Tot(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var P0e=new ArrayBuffer(4),Cot=new Float32Array(P0e),Eot=new Uint32Array(P0e);function sQ(e){Cot[0]=e;let t=Eot[0],n=t>>31&1,i=t>>23&255,o=t&8388607,r;if(i===255)r=n<<15|31744|(o?512:0);else if(i===0)r=n<<15;else{let a=i-127+15;a>=31?r=n<<15|31744:a<=0?r=n<<15:r=n<<15|a<<10|o>>>13}return r}function vot(e){let t=bot(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),a=parseInt(e.slice(o+n.length),10);return{l:r,n:a}}function Sot(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),o=new Uint32Array(i),r=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),a=0,s=[0,9,24];switch(t){case 1:a=9;break;case 2:a=24;break;case 3:a=45;break}r.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=a*(2/3);for(let u=0;u<r.length;u++){let{l:f,n:d}=vot(r[u].name);for(let p=0;p<e.pointsLength;p++){let g=s[f-1]*2/3,m=p*c+g+d*2,A=p*3;o[m]=sQ(r[u].typedArray[A])|sQ(r[u].typedArray[A+1])<<16,o[m+1]=sQ(r[u].typedArray[A+2])}}return o}var Yx=cQ;var R0e={b3dm:function(e,t,n,i,o){return ld.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return ld.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return ld.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return LF.fromTileType(e,t,n,i,o,R0e)},externalTileset:function(e,t,n,i){return Iz.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new jF(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new Xz(e,t,n,i,o)},subt:function(e,t,n,i,o){return oD.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return oD.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new re("Invalid glb content");let s=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,s);return Yx.tilesetRequiresGaussianSplattingExt(e)?Yx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Wx.fromGltf(e,t,n,c):ld.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Yx.tilesetRequiresGaussianSplattingExt(e)?Yx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Wx.fromGltf(e,t,n,i):ld.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return ld.fromGeoJson(e,t,n,i)}},qE=R0e;var O0e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(O0e);var ir=O0e;var gd={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"};gd.isBinaryFormat=function(e){switch(e){case gd.BATCHED_3D_MODEL:case gd.INSTANCED_3D_MODEL:case gd.COMPOSITE:case gd.POINT_CLOUD:case gd.VECTOR:case gd.GEOMETRY:case gd.IMPLICIT_SUBTREE:case gd.VOXEL_BINARY:case gd.GLTF_BINARY:return!0;default:return!1}};Object.freeze(gd);var Os=gd;var M0e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(M0e);var Ih=M0e;var ds={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},G0=new Array(ds.NUMBER_OF_PASSES);G0[ds.RENDER]=Object.freeze({pass:ds.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});G0[ds.PICK]=Object.freeze({pass:ds.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});G0[ds.SHADOW]=Object.freeze({pass:ds.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});G0[ds.PRELOAD]=Object.freeze({pass:ds.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});G0[ds.PRELOAD_FLIGHT]=Object.freeze({pass:ds.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});G0[ds.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:ds.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});G0[ds.MOST_DETAILED_PRELOAD]=Object.freeze({pass:ds.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});G0[ds.MOST_DETAILED_PICK]=Object.freeze({pass:ds.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});ds.getPassOptions=function(e){return G0[e]};Object.freeze(ds);var or=ds;var lQ=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return fe(this)}},H0=lQ;function W0(e){e=e??G.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(W0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});W0.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};W0.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};W0.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};W0.prototype.getProperty=function(e){return Un.getProperty(e,this._properties,this._class)};W0.prototype.setProperty=function(e,t){return Un.setProperty(e,t,this._properties,this._class)};W0.prototype.getPropertyBySemantic=function(e){return Un.getPropertyBySemantic(e,this._properties,this._class)};W0.prototype.setPropertyBySemantic=function(e,t){return Un.setPropertyBySemantic(e,t,this._properties,this._class)};var xU=W0;function uQ(e,t){let n=vi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){uQ._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=e.schema.classes??G.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new xU({content:n,class:o})}}uQ._oneTimeWarning=_t;var YE=uQ;function wot(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=vi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(a){return a===o});return r>=0?i[r]:void 0}var XE=wot;function q0(e){e=e??G.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(q0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});q0.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};q0.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};q0.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};q0.prototype.getProperty=function(e){return Un.getProperty(e,this._properties,this._class)};q0.prototype.setProperty=function(e,t){return Un.setProperty(e,t,this._properties,this._class)};q0.prototype.getPropertyBySemantic=function(e){return Un.getPropertyBySemantic(e,this._properties,this._class)};q0.prototype.setPropertyBySemantic=function(e,t){return Un.setPropertyBySemantic(e,t,this._properties,this._class)};var bU=q0;function fQ(e,t){let n=vi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){fQ._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=e.schema.classes??G.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new bU({tile:n,class:o})}}fQ._oneTimeWarning=_t;var TU=fQ;function Iot(e){let t=new Uint8Array(e),n=Um(t);if(n==="glTF"&&(n="glb"),Os.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Dot(t);if(l(i.root))return{contentType:Os.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Os.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Os.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Os.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Os.VOXEL_JSON,jsonPayload:i};throw new re("Invalid tile content.")}function Dot(e){let t;try{t=Sr(e)}catch{throw new re("Invalid tile content.")}return t}var cA=Iot;var dQ=class{constructor(t,n,i,o){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let r=l(o.contents)?o.contents:o.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let a=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(a),this._requests=new Array(a),this._ready=!1,this._innerContentResources=new Array(a),this._serverKeys=new Array(a);for(let s=0;s<a;s++){let c=i.getDerivedResource({url:r[s].uri}),u=pl.getServerKey(c.getUrlComponent());this._innerContentResources[s]=c,this._serverKeys[s]=u}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!Pot(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;hQ(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Rot(this,i,n,this._tile._contentState);return Oot(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,o=i.length;for(let r=0;r<o;++r)i[r].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyStyle(t)}update(t,n){let i=this._contents,o=i.length,r=!0;for(let a=0;a<o;++a)i[a].update(t,n),r=r&&i[a].ready;!this._ready&&r&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let o,r=Number.POSITIVE_INFINITY,a=this._contents,s=a.length;for(let c=0;c<s;++c){let u=a[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<r&&(o=u,r=f)}if(l(o))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return fe(this)}};function hQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function B0e(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)}function Pot(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)&&!pl.serverHasOpenSlots(n,t[n]))return!1;return pl.heapHasOpenSlots(e.length)}function Rot(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,a=function(){return r._priority},s=e._serverKeys[t],c=new Cr({throttle:!0,throttleByServer:!0,type:ts.TILES3D,priorityFunction:a,serverKey:s});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Ai.CANCELLED){B0e(e,i);return}return hQ(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Ai.CANCELLED){B0e(e,i);return}hQ(e,-1),L0e(e,t,f)}})}async function Oot(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,a)=>Mot(e,r,a)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(l),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function Mot(e,t,n){if(l(t))try{let i=cA(t),o=e._tileset,r=e._innerContentResources[n],a=e._tile;i.contentType===Os.EXTERNAL_TILESET&&(e._externalTilesetCount++,a.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Os.GEOMETRY||i.contentType===Os.VECTOR;let s,c=qE[i.contentType];l(i.binaryPayload)?s=await Promise.resolve(c(o,a,r,i.binaryPayload.buffer,0)):s=await Promise.resolve(c(o,a,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(a.hasImplicitContentMetadata){let d=a.implicitSubtree,p=a.implicitCoordinates;s.metadata=d.getContentMetadataView(p,n)}else a.hasImplicitContent||(s.metadata=YE(o,u));let f=XE(o,u);return l(f)&&(s.group=new MC({metadata:f})),s}catch(i){L0e(e,n,i)}}function L0e(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}`))}var CU=dQ;var N0e=Math.cos,F0e=Math.sin,Bot=Math.sqrt,mQ={};mQ.computePosition=function(e,t,n,i,o,r,a){let s=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,d=N0e(f),p=F0e(f),g=s.z*p,m=c.longitude+i*e.granYSin+o*e.granXCos,A=d*N0e(m),y=d*F0e(m),x=s.x*A,b=s.y*y,T=Bot(x*A+b*y+g*p);if(r.x=x/T,r.y=b/T,r.z=g/T,n){let E=e.stNwCorner;l(E)?(f=E.latitude-e.stGranYCos*i+o*e.stGranXSin,m=E.longitude+i*e.stGranYSin+o*e.stGranXCos,a.x=(m-e.stWest)*e.lonScalar,a.y=(f-e.stSouth)*e.latScalar):(a.x=(m-u.west)*e.lonScalar,a.y=(f-u.south)*e.latScalar)}};var Lot=new Wi,_d=new h,Not=new de,EU=new h,sP=new Hi;function k0e(e,t,n,i,o,r,a){let s=Math.cos(t),c=i*s,u=n*s,f=Math.sin(t),d=i*f,p=n*f;sP._ellipsoid=te.default,_d=sP.project(e,_d),_d=h.subtract(_d,EU,_d);let g=Wi.fromRotation(t,Lot);_d=Wi.multiplyByVector(g,_d,_d),_d=h.add(_d,EU,_d),e=sP.unproject(_d,e),r-=1,a-=1;let m=e.latitude,A=m+r*p,y=m-c*a,x=m-c*a+r*p,b=Math.max(m,A,y,x),T=Math.min(m,A,y,x),E=e.longitude,S=E+r*u,w=E+a*d,P=E+a*d+r*u,O=Math.max(E,S,w,P),B=Math.min(E,S,w,P);return{north:b,south:T,east:O,west:B,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}mQ.computeOptions=function(e,t,n,i,o,r,a){let s=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===D.PI_OVER_TWO&&(d=!0),f===-D.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>s?g=D.TWO_PI-c+s:g=s-c;let A=Math.ceil(g/t)+1,y=Math.ceil(m/t)+1,x=g/(A-1),b=m/(y-1),T=oe.northwest(e,r),E=oe.center(e,Not);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=D.TWO_PI),sP._ellipsoid=te.default,EU=sP.project(E,EU));let S=b,w=x,P=0,O=0,B=oe.clone(e,o),L={granYCos:S,granYSin:P,granXCos:w,granXSin:O,nwCorner:T,boundingRectangle:B,width:A,height:y,northCap:d,southCap:p};if(n!==0){let _=k0e(T,n,x,b,E,A,y);u=_.north,f=_.south,s=_.east,c=_.west,L.granYCos=_.granYCos,L.granYSin=_.granYSin,L.granXCos=_.granXCos,L.granXSin=_.granXSin,B.north=u,B.south=f,B.east=s,B.west=c}if(i!==0){n=n-i;let _=oe.northwest(B,a),C=k0e(_,n,x,b,E,A,y);L.stGranYCos=C.granYCos,L.stGranXCos=C.granXCos,L.stGranYSin=C.granYSin,L.stGranXSin=C.granXSin,L.stNwCorner=_,L.stWest=C.west,L.stSouth=C.south}return L};var Ms=mQ;var Fot=new ce,kot=new ce,zot=new h,Uot=new oe;function z0e(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,a=t.southCap,s=i,c=2,u=0,f=4;r&&(c-=1,s-=1,u+=1,f-=2),a&&(c-=1,s-=1,u+=1,f-=2),u+=c*o+2*s-f;let d=new Float64Array(u*3),p=0,g=0,m,A=zot;if(r)Ms.computePosition(t,n,!1,g,0,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;else for(m=0;m<o;m++)Ms.computePosition(t,n,!1,g,m,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;for(m=o-1,g=1;g<i;g++)Ms.computePosition(t,n,!1,g,m,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;if(g=i-1,!a)for(m=o-2;m>=0;m--)Ms.computePosition(t,n,!1,g,m,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;for(m=0,g=i-2;g>0;g--)Ms.computePosition(t,n,!1,g,m,A),d[p++]=A.x,d[p++]=A.y,d[p++]=A.z;let y=d.length/3*2,x=Ue.createTypedArray(d.length/3,y),b=0;for(let E=0;E<d.length/3-1;E++)x[b++]=E,x[b++]=E+1;x[b++]=d.length/3-1,x[b++]=0;let T=new At({attributes:new _n,primitiveType:Re.LINES});return T.attributes.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=x,T}function Vot(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=z0e(e,t),a=t.height,s=t.width,c=ni.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=ni.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(d,u),r.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let A=(f.length/3+m)*2,y=Ue.createTypedArray(f.length/3,A);u=f.length/6;let x=0;for(let T=0;T<u-1;T++)y[x++]=T,y[x++]=T+1,y[x++]=T+u,y[x++]=T+u+1;y[x++]=u-1,y[x++]=0,y[x++]=u+u-1,y[x++]=u,y[x++]=0,y[x++]=u;let b;if(p)b=a-1;else{let T=s-1;y[x++]=T,y[x++]=T+u,b=s+a-2}if(y[x++]=b,y[x++]=b+u,!g){let T=s+b-1;y[x++]=T,y[x]=T+u}return r.indices=y,r}function QE(e){e=e??G.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??D.RADIANS_PER_DEGREE,i=e.ellipsoid??te.default,o=e.rotation??0,r=e.height??0,a=e.extrudedHeight??r;this._rectangle=oe.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,a),this._rotation=o,this._extrudedHeight=Math.min(r,a),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}QE.packedLength=oe.packedLength+te.packedLength+5;QE.pack=function(e,t,n){return n=n??0,oe.pack(e._rectangle,t,n),n+=oe.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var U0e=new oe,V0e=te.clone(te.UNIT_SPHERE),KE={rectangle:U0e,ellipsoid:V0e,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};QE.unpack=function(e,t,n){t=t??0;let i=oe.unpack(e,t,U0e);t+=oe.packedLength;let o=te.unpack(e,t,V0e);t+=te.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=oe.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._surfaceHeight=a,n._rotation=s,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(KE.granularity=r,KE.height=a,KE.rotation=s,KE.extrudedHeight=c,KE.offsetAttribute=u===-1?void 0:u,new QE(KE))};var jot=new de;QE.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ms.computeOptions(t,e._granularity,e._rotation,0,Uot,jot),o,r;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let a=e._surfaceHeight,s=e._extrudedHeight,c=!D.equalsEpsilon(a,s,0,D.EPSILON2),u;if(c){if(o=Vot(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===ln.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===ln.NONE?0:1,g=g.fill(u)),o.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ce.fromRectangle3D(t,n,a,kot),d=ce.fromRectangle3D(t,n,s,Fot);r=ce.union(f,d)}else{if(o=z0e(e,i),o.attributes.position.values=ni.scaleToGeodeticHeight(o.attributes.position.values,a,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===ln.NONE?0:1;let d=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}r=ce.fromRectangle3D(t,n,a)}return new At({attributes:o.attributes,indices:o.indices,primitiveType:Re.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var $E=QE;function ZE(e){this.rectangle=oe.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=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=e.ellipsoid??te.WGS84;Yot(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(ZE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});ZE.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=$t.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)};var j0e=new h,vU=new h,G0e=new h,Got=new h,Hot=new h,Wot=new h,qot=new h,Ad=new de,H0e=new tn(h.UNIT_X,0),JE=new An;function Yot(e,t,n){n.cartographicToCartesian(oe.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(oe.northeast(t),e.northeastCornerCartesian),Ad.longitude=t.west,Ad.latitude=(t.south+t.north)*.5,Ad.height=0;let i=n.cartographicToCartesian(Ad,Wot),o=h.cross(i,h.UNIT_Z,Got);h.normalize(o,e.westNormal),Ad.longitude=t.east;let r=n.cartographicToCartesian(Ad,qot),a=h.cross(h.UNIT_Z,r,j0e);h.normalize(a,e.eastNormal);let s=h.subtract(i,r,j0e);h.magnitude(s)===0&&(s=h.clone(o,s));let c=h.normalize(s,Hot),u=t.south,f;if(u>0){Ad.longitude=(t.west+t.east)*.5,Ad.latitude=u;let A=n.cartographicToCartesian(Ad,JE.origin);h.clone(c,JE.direction);let y=tn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,H0e);ui.rayPlane(JE,y,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(A,vU)}else f=n.geodeticSurfaceNormalCartographic(oe.southeast(t),vU);let d=h.cross(f,s,G0e);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){Ad.longitude=(t.west+t.east)*.5,Ad.latitude=p;let A=n.cartographicToCartesian(Ad,JE.origin);h.negate(c,JE.direction);let y=tn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,H0e);ui.rayPlane(JE,y,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(A,vU)}else g=n.geodeticSurfaceNormalCartographic(oe.northwest(t),vU);let m=h.cross(s,g,G0e);h.normalize(m,e.northNormal)}var Xot=new h,Kot=new h,Qot=new h(0,-1,0),$ot=new h(0,0,-1),W0e=new h;function Jot(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!oe.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==ie.SCENE3D&&(u=t.mapProjection.project(oe.southwest(e.rectangle),Xot),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(oe.northeast(e.rectangle),Kot),f.z=f.y,f.y=f.x,f.x=0,d=Qot,g=h.UNIT_Y,p=$ot,m=h.UNIT_Z);let A=h.subtract(i,u,W0e),y=h.dot(A,d),x=h.dot(A,p),b=h.subtract(i,f,W0e),T=h.dot(b,g),E=h.dot(b,m);y>0?r+=y*y:T>0&&(r+=T*T),x>0?r+=x*x:E>0&&(r+=E*E)}let a,s,c;if(t.mode===ie.SCENE3D?(a=o.height,s=e.minimumHeight,c=e.maximumHeight):(a=i.x,s=0,c=0),a>c){let u=a-c;r+=u*u}else if(a<s){let u=s-a;r+=u*u}return Math.sqrt(r)}ZE.prototype.distanceToCamera=function(e){let t=Jot(this,e);if(e.mode===ie.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};ZE.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};ZE.prototype.createDebugVolume=function(e){let t=R.clone(R.IDENTITY),n=new $E({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Bt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var yd=ZE;var cP={},Zot=new h,q0e=new h,Y0e=new h,X0e=new h,K0e=new $t;cP.validOutline=function(e){let n=$t.fromPoints(e,K0e).halfAxes,i=$.getColumn(n,0,q0e),o=$.getColumn(n,1,Y0e),r=$.getColumn(n,2,X0e),a=h.magnitude(i),s=h.magnitude(o),c=h.magnitude(r);return!(a===0&&(s===0||c===0)||s===0&&c===0)};cP.computeProjectTo2DArguments=function(e,t,n,i){let o=$t.fromPoints(e,K0e),r=o.halfAxes,a=$.getColumn(r,0,q0e),s=$.getColumn(r,1,Y0e),c=$.getColumn(r,2,X0e),u=h.magnitude(a),f=h.magnitude(s),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=a),p===u?g=s:p===d&&(m=s),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(o.center,t),!0};function Q0e(e,t,n,i,o){let r=h.subtract(e,t,Zot),a=h.dot(n,r),s=h.dot(i,r);return z.fromElements(a,s,o)}cP.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Q0e(i[r],e,t,n);return o}};cP.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Q0e(i,e,t,n,o)}};var lA=cP;function ert(e){let t=e.length,n=new Float64Array(t*3),i=Ue.createTypedArray(t,t*2),o=0,r=0;for(let s=0;s<t;s++){let c=e[s];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=s,i[r++]=(s+1)%t}let a=new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new At({attributes:a,indices:i,primitiveType:Re.LINES})}function Xx(e){e=e??G.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Kn.computeHierarchyPackedLength(t,h)+1}Xx.fromPositions=function(e){e=e??G.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new Xx(t)};Xx.pack=function(e,t,n){return n=n??0,n=Kn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var trt={polygonHierarchy:{}};Xx.unpack=function(e,t,n){t=t??0;let i=Kn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new Xx(trt)),n._polygonHierarchy=i,n.packedLength=o,n};Xx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Fo(n,h.equalsEpsilon,!0),n.length<3||!lA.validOutline(n))return;let o=Kn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new Bt({geometry:ert(o[c])});r.push(u)}let a=kn.combineInstances(r)[0],s=ce.fromPoints(t.positions);return new At({attributes:a.attributes,indices:a.indices,primitiveType:a.primitiveType,boundingSphere:s})};var Dh=Xx;var SU=new de;function lP(e){let t=v_.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??te.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=urt(t,n,i,o);this._boundingPlanes=r;let a=mrt(r);this._vertices=a,this._edgeNormals=new Array(6),this._edgeNormals[0]=TQ(r[0],a.slice(0,4));let s;for(s=0;s<4;s++)this._edgeNormals[0][s]=h.negate(this._edgeNormals[0][s],this._edgeNormals[0][s]);for(this._edgeNormals[1]=TQ(r[1],a.slice(4,8)),s=0;s<4;s++)this._edgeNormals[2+s]=TQ(r[2+s],[a[s%4],a[(s+1)%4],a[4+(s+1)%4],a[4+s]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],s=0;s<4;s++)this._planeVertices.push([this._vertices[s%4],this._vertices[(s+1)%4],this._vertices[4+(s+1)%4],this._vertices[4+s]]);let c=t.getCenter();SU=o.cartesianToCartographic(c,SU),SU.height=(i+n)/2,this.center=o.cartographicToCartesian(SU,c),this._boundingSphere=ce.fromPoints(a)}var nrt=new h,irt=new de,ort=new h,rrt=new de,art=new h,srt=new h,crt=new h,lrt=new h;function urt(e,t,n,i){let o=new Array(6),r=e.getCenter(),a=i.geodeticSurfaceNormal(r,nrt),s=i.cartesianToCartographic(r,irt);s.height=n;let c=i.cartographicToCartesian(s,ort),u=tn.fromPointNormal(c,a);o[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,rrt),m.height=t;let y=tn.getPointDistance(u,i.cartographicToCartesian(m,art));y<f&&(f=y)}let A=tn.clone(u);for(A.normal=h.negate(A.normal,A.normal),A.distance=A.distance*-1+f,o[1]=A,d=0;d<4;d++){g=p[d];let y=p[(d+1)%4],x=i.geodeticSurfaceNormal(g,srt),b=h.subtract(y,g,lrt),T=h.cross(b,x,crt);T=h.normalize(T,T),o[2+d]=tn.fromPointNormal(g,T)}return o}var Kx=new h,Qx=new h,$x=new h,pQ=new h,gQ=new h,_Q=new h,frt=new h,drt=new h,hrt=new h,AQ=new h,yQ=new h,xQ=new h,uA=new h,up=new $;function $0e(e,t,n){Kx=e.normal,Qx=t.normal,$x=n.normal,pQ=h.multiplyByScalar(e.normal,-e.distance,pQ),gQ=h.multiplyByScalar(t.normal,-t.distance,gQ),_Q=h.multiplyByScalar(n.normal,-n.distance,_Q),AQ=h.multiplyByScalar(h.cross(Qx,$x,frt),h.dot(pQ,Kx),AQ),yQ=h.multiplyByScalar(h.cross($x,Kx,drt),h.dot(gQ,Qx),yQ),xQ=h.multiplyByScalar(h.cross(Kx,Qx,hrt),h.dot(_Q,$x),xQ),up[0]=Kx.x,up[1]=Qx.x,up[2]=$x.x,up[3]=Kx.y,up[4]=Qx.y,up[5]=$x.y,up[6]=Kx.z,up[7]=Qx.z,up[8]=$x.z;let i=$.determinant(up);return uA=h.add(AQ,yQ,uA),uA=h.add(uA,xQ,uA),new h(uA.x/i,uA.y/i,uA.z/i)}function mrt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=$0e(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=$0e(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var bQ=new h,ev=new h;function TQ(e,t){let n=[];for(let i=0;i<4;i++)bQ=h.subtract(t[(i+1)%4],t[i],bQ),ev=h.cross(e.normal,bQ,ev),ev=h.normalize(ev,ev),n[i]=h.clone(ev);return n}Object.defineProperties(lP.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var CQ=new h;lP.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;tn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):tn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,a;for(r=0;r<4;r++)a=2+r,tn.getPointDistance(this._boundingPlanes[a],t)>0&&(n.push(a),i.push(this._planeVertices[a]),o=this._edgeNormals[a]);if(n.length===0)return 0;let s,c;if(n.length===1)return c=this._boundingPlanes[n[0]],s=EQ(tn.projectPointOntoPlane(c,t,CQ),i[0],c,o),h.distance(s,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 s=J0e(t,p[0],p[1]),h.distance(s,t)}let f=Number.MAX_VALUE,d;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],s=EQ(tn.projectPointOntoPlane(c,t,CQ),i[r],c,this._edgeNormals[n[r]]),d=h.distanceSquared(s,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return s=EQ(tn.projectPointOntoPlane(this._boundingPlanes[1],t,CQ),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(s,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var prt=new h,grt=new h;function J0e(e,t,n){let i=h.subtract(n,t,prt),o=h.subtract(e,t,grt),r=h.dot(i,o);if(r<=0)return t;let a=h.dot(i,i);return r>=a?n:(r=r/a,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var _rt=new tn(h.UNIT_X,0);function EQ(e,t,n,i){let o=Number.MAX_VALUE,r,a,s;for(let c=0;c<t.length;c++){let u=tn.fromPointNormal(t[c],i[c],_rt);tn.getPointDistance(u,e)<0||(s=J0e(e,t[c],t[(c+1)%4]),r=h.distance(e,s),r<o&&(o=r,a=s))}return l(a)?a:e}lP.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?qt.INSIDE:n===this._vertices.length?qt.OUTSIDE:qt.INTERSECTING};lP.prototype.createDebugVolume=function(e){let t=R.clone(R.IDENTITY),n=new Dh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Dh.createGeometry(n),o=new Bt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),r=new Dh({polygonHierarchy:{positions:this._planeVertices[1]}}),a=Dh.createGeometry(r),s=new Bt({geometry:a,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Dh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=Dh.createGeometry(f);c[u]=new Bt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}})}return new Pn({geometryInstances:[c[0],c[1],c[2],c[3],s,o],appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var wU=lP;var Art=new h(1,1,1),IU=Math.cos,DU=Math.sin;function tv(e){e=e??G.EMPTY_OBJECT;let t=e.radii??Art,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,a=e.maximumCone??D.PI,s=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}tv.packedLength=2*h.packedLength+8;tv.pack=function(e,t,n){return n=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]=e._offsetAttribute??-1,t};var Z0e=new h,ege=new h,Y0={radii:Z0e,innerRadii:ege,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};tv.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Z0e);t+=h.packedLength;let o=h.unpack(e,t,ege);t+=h.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=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=a,n._minimumCone=s,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(Y0.minimumClock=r,Y0.maximumClock=a,Y0.minimumCone=s,Y0.maximumCone=c,Y0.stackPartitions=u,Y0.slicePartitions=f,Y0.subdivisions=d,Y0.offsetAttribute=p===-1?void 0:p,new tv(Y0))};tv.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,a=e._maximumCone,s=e._subdivisions,c=te.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/D.TWO_PI),f=Math.round(f*Math.abs(a-r)/D.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,A=!1;g&&(p=2,r>0&&(m=!0,d+=u),a<Math.PI&&(A=!0,d+=u));let y=s*p*(f+u),x=new Float64Array(y*3),b=2*(y+d-(u+f)*p),T=Ue.createTypedArray(y,b),E,S,w,P,O=0,B=new Array(f),L=new Array(f);for(E=0;E<f;E++)P=r+E*(a-r)/(f-1),B[E]=DU(P),L[E]=IU(P);let _=new Array(s),C=new Array(s);for(E=0;E<s;E++)w=i+E*(o-i)/(s-1),_[E]=DU(w),C[E]=IU(w);for(E=0;E<f;E++)for(S=0;S<s;S++)x[O++]=t.x*B[E]*C[S],x[O++]=t.y*B[E]*_[S],x[O++]=t.z*L[E];if(g)for(E=0;E<f;E++)for(S=0;S<s;S++)x[O++]=n.x*B[E]*C[S],x[O++]=n.y*B[E]*_[S],x[O++]=n.z*L[E];for(B.length=s,L.length=s,E=0;E<s;E++)P=r+E*(a-r)/(s-1),B[E]=DU(P),L[E]=IU(P);for(_.length=u,C.length=u,E=0;E<u;E++)w=i+E*(o-i)/(u-1),_[E]=DU(w),C[E]=IU(w);for(E=0;E<s;E++)for(S=0;S<u;S++)x[O++]=t.x*B[E]*C[S],x[O++]=t.y*B[E]*_[S],x[O++]=t.z*L[E];if(g)for(E=0;E<s;E++)for(S=0;S<u;S++)x[O++]=n.x*B[E]*C[S],x[O++]=n.y*B[E]*_[S],x[O++]=n.z*L[E];for(O=0,E=0;E<f*p;E++){let M=E*s;for(S=0;S<s-1;S++)T[O++]=M+S,T[O++]=M+S+1}let v=f*s*p;for(E=0;E<u;E++)for(S=0;S<s-1;S++)T[O++]=v+E+S*u,T[O++]=v+E+(S+1)*u;if(g)for(v=f*s*p+u*s,E=0;E<u;E++)for(S=0;S<s-1;S++)T[O++]=v+E+S*u,T[O++]=v+E+(S+1)*u;if(g){let M=f*s*p,N=M+s*u;if(m)for(E=0;E<u;E++)T[O++]=M+E,T[O++]=N+E;if(A)for(M+=s*u-u,N+=s*u-u,E=0;E<u;E++)T[O++]=M+E,T[O++]=N+E}let I=new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:x})});if(l(e._offsetAttribute)){let M=x.length,N=e._offsetAttribute===ln.NONE?0:1,j=new Uint8Array(M/3).fill(N);I.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:j})}return new At({attributes:I,indices:T,primitiveType:Re.LINES,boundingSphere:ce.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var xd=tv;function nv(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new xd(i),this._workerName="createSphereOutlineGeometry"}nv.packedLength=xd.packedLength;nv.pack=function(e,t,n){return xd.pack(e._ellipsoidGeometry,t,n)};var yrt=new xd,Jx={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};nv.unpack=function(e,t,n){let i=xd.unpack(e,t,yrt);return Jx.stackPartitions=i._stackPartitions,Jx.slicePartitions=i._slicePartitions,Jx.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,Jx.radii),n._ellipsoidGeometry=new xd(Jx),n):(Jx.radius=i._radii.x,new nv(Jx))};nv.createGeometry=function(e){return xd.createGeometry(e._ellipsoidGeometry)};var fA=nv;function iv(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new ce(e,t)}Object.defineProperties(iv.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}}});iv.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};iv.prototype.intersectPlane=function(e){return ce.intersectPlane(this._boundingSphere,e)};iv.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};iv.prototype.createDebugVolume=function(e){let t=new fA({radius:this.radius}),n=R.fromTranslation(this.center,R.clone(R.IDENTITY)),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var dA=iv;var xrt=new h,brt=new h,Trt=new h,Crt=new h;function Zx(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,D.EPSILON7/i,n)}function vQ(e,t){let n=h.normalize(e,Crt),i=h.equalsEpsilon(n,h.UNIT_X,D.EPSILON6)?h.UNIT_Y:h.UNIT_X;return Zx(e,i,t)}function tge(e){let t=$.getColumn(e,0,xrt),n=$.getColumn(e,1,brt),i=$.getColumn(e,2,Trt),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),a=h.equals(i,h.ZERO);return!o&&!r&&!a?e:o&&r&&a?(e[0]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(o&&!r&&!a?t=Zx(n,i,t):!o&&r&&!a?n=Zx(t,i,n):!o&&!r&&a?i=Zx(n,t,i):o?r?a||(t=vQ(i,t),n=Zx(i,t,n)):(t=vQ(n,t),i=Zx(n,t,i)):(n=vQ(t,n),i=Zx(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function ov(e,t){t=tge(t),this._orientedBoundingBox=new $t(e,t),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(ov.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});ov.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};ov.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};ov.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=tge(t),$.clone(t,this._orientedBoundingBox.halfAxes),ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};ov.prototype.createDebugVolume=function(e){let t=new Sm({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=R.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var cf=ov;function rr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||vi(n,"3DTILES_multiple_contents"),a=o&&!r?n.contents[0]:n.content;this._contentHeader=a,this.transform=l(n.transform)?R.unpack(n.transform):R.clone(R.IDENTITY);let s=l(i)?i.computedTransform:e.modelMatrix,c=R.multiply(s,this.transform,new R),u=l(i)?i._initialTransform:R.IDENTITY;this._initialTransform=R.multiply(u,this.transform,new R),this.computedTransform=c,this.metadata=TU(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(a)&&l(a.boundingVolume)&&(f=this.createBoundingVolume(a.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,rr._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")&&rr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?pr.REPLACE:pr.ADD):l(i)?p=i.refine:p=pr.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,A,y,x;if(t=De.createIfNeeded(t),r)A=ir.UNLOADED,y=t.clone();else if(l(a)){let S=a.uri;l(a.url)&&(rr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),S=a.url),S===""?(rr._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 H0(e,this),m=!0,A=ir.READY):(A=ir.UNLOADED,y=t.getDerivedResource({url:S}),x=pl.getServerKey(y.getUrlComponent()))}else g=new H0(e,this),m=!0,A=ir.READY;this._content=g,this._contentResource=y,this._contentState=A,this._expiredContent=void 0,this._serverKey=x,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let b=n.expire,T,E;l(b)&&(T=b.duration,l(b.date)&&(E=Q.fromIso8601(b.date))),this.expireDuration=T,this.expireDate=E,this.lastStyleTime=0,this._optimChildrenWithinParent=Ih.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=U.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 Q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}rr._deprecationWarning=Hs;Object.defineProperties(rr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return 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 U),U.clone(this._color)},set:function(e){this._color=U.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===ir.READY}},contentUnloaded:{get:function(){return this._contentState===ir.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===ir.EXPIRED}},contentFailed:{get:function(){return this._contentState===ir.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var hA=new h;function Ert(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:a}=t,s=h.multiplyByScalar(a.directionWC,e._centerZDepth,hA),c=h.add(a.positionWC,s,hA),u=h.subtract(c,r,hA);if(h.magnitude(u)>o){let E=h.normalize(u,hA),S=h.multiplyByScalar(E,o,hA),w=h.add(r,S,hA),P=h.subtract(w,a.positionWC,hA),O=h.normalize(P,hA);e._foveatedFactor=1-Math.abs(h.dot(a.directionWC,O))}else e._foveatedFactor=0;let p=e.refine===pr.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===or.PRELOAD_FLIGHT||n._pass===or.PRELOAD)return!1;let m=1-Math.cos(a.frustum.fov*.5),A=n.foveatedConeSize*m;if(e._foveatedFactor<=A)return!1;let y=m-A,x=D.clamp((e._foveatedFactor-A)/y,0,1),b=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,x),T=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-b<=T}var sge=new Q;rr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,a=t?r:this.geometricError;if(a===0)return 0;let{camera:s,context:c}=e,u=s.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*o,p;if(e.mode===ie.SCENE2D||u instanceof fn){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=a/m}else{let g=Math.max(this._distanceToCamera,D.EPSILON7),m=u.sseDenominator;if(p=a*d/(g*m),i.dynamicScreenSpaceError){let A=i._dynamicScreenSpaceErrorComputedDensity,y=i.dynamicScreenSpaceErrorFactor,x=D.fog(g,A)*y;p-=x}}return p/=e.pixelRatio,p};function vrt(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,a=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&a&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function Srt(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}rr.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:is.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!==is.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Srt(n,this),this._priorityProgressiveResolution=vrt(n,this),this.priorityDeferred=Ert(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};rr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(sge);Q.lessThan(this.expireDate,e)&&(this._contentState=ir.EXPIRED,this._expiredContent=this._content)}};function wrt(e){if(!l(e.expireDuration))return;let t=Q.now(sge);Q.addSeconds(t,e.expireDuration,t),l(e.expireDate)?Q.lessThan(e.expireDate,t)&&Q.clone(t,e.expireDate):e.expireDate=Q.clone(t)}function Irt(e){return function(){return e._priority}}rr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Drt(this):Rrt(this)};function Drt(e){let t=e._content,n=e._tileset;if(!l(t)){let o=vi(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new CU(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=ir.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=ir.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=ir.FAILED,o})}async function Prt(e,t,n,i,o){let r=e._contentState;e._contentState=ir.LOADING,++t.statistics.numberOfPendingRequests;let a;try{a=await o}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Ai.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}if(cge(e,s))return i&&(e.expireDate=void 0),e._content=new H0(t,e),nge(e),e._contentState=ir.PROCESSING,e._content;throw e._contentState=ir.FAILED,s}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Ai.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let s=await Ort(e,a);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=s,s instanceof H0&&nge(e),e._contentState=ir.PROCESSING,s)}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=ir.FAILED,s}}function Rrt(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Cr({throttle:!0,throttleByServer:!0,type:ts.TILES3D,priorityFunction:Irt(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 Prt(e,o,i,n,r)}function cge(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function nge(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}rr._isEmptyTile=cge;async function Ort(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let u=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:u}let o=cA(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||o.contentType===Os.GEOMETRY||o.contentType===Os.VECTOR,(o.contentType===Os.IMPLICIT_SUBTREE||o.contentType===Os.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),o.contentType===Os.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let r,a=qE[o.contentType];if(e.isDestroyed())return;l(o.binaryPayload)?r=await Promise.resolve(a(n,e,e._contentResource,o.binaryPayload.buffer,0)):r=await Promise.resolve(a(n,e,e._contentResource,o.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let u=e.implicitSubtree,f=e.implicitCoordinates;r.metadata=u.getContentMetadataView(f,0)}else e.hasImplicitContent||(r.metadata=YE(n,s));let c=XE(n,s);return l(c)&&(r.group=new MC({metadata:c})),r}rr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};rr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=ir.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 lge=new ce;function wQ(e,t){if(t.mode!==ie.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,lge);e._boundingVolume2D=new dA(i.center,i.radius)}return t.mode!==ie.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Mrt(e,t){if(t.mode!==ie.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,lge);e._contentBoundingVolume2D=new dA(i.center,i.radius)}return t.mode!==ie.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}rr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=wQ(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=s!==qt.INSIDE,s===qt.OUTSIDE)return is.MASK_OUTSIDE}let a=o.clippingPolygons;if(l(a)&&a.enabled){let s=a.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=s!==qt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};rr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return qt.INSIDE;if(this._visibilityPlaneMask===is.MASK_INSIDE)return qt.INSIDE;let t=e.cullingVolume,n=Mrt(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=a!==qt.INSIDE,a===qt.OUTSIDE)return qt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=a!==qt.OUTSIDE,a===qt.INSIDE)return qt.OUTSIDE}return t.computeVisibility(n)};rr.prototype.distanceToTile=function(e){return wQ(this,e).distanceToCamera(e)};var Brt=new h;rr.prototype.distanceToTileCenter=function(e){let n=wQ(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,Brt);return h.dot(e.camera.directionWC,i)};rr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var uge=new $,fge=new h,Lrt=new $,IQ=new h,dge=new oe,hge=new $t,SQ=new R;function Nrt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],IQ),o=$.fromArray(e,3,Lrt);i=R.multiplyByPoint(t,i,i);let r=R.getMatrix3(t,uge);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new cf(i,o)}function ige(e,t,n,i){let o=oe.unpack(e,0,dge),r=e[4],a=e[5],s=$t.fromRectangle(o,r,a,te.WGS84,hge),c=s.center,u=s.halfAxes;t=R.multiplyTransformation(t,R.inverseTransformation(n,SQ),SQ),c=R.multiplyByPoint(t,c,c);let f=R.getMatrix3(t,uge);return u=$.multiply(f,u,u),l(i)&&i instanceof cf?(i.update(c,u),i):new cf(c,u)}function Frt(e,t,n,i){if(!R.equalsEpsilon(t,n,D.EPSILON8))return i instanceof cf?ige(e,t,n,i):ige(e,t,n,void 0);let o=oe.unpack(e,0,dge);return i instanceof yd?(i.rectangle=oe.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(te.WGS84),i):new yd({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function krt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],IQ),o=e[3];i=R.multiplyByPoint(t,i,i);let r=R.getScale(t,fge),a=h.maximumComponent(r);return o*=a,l(n)?(n.update(i,o),n):new dA(i,o)}rr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=ux.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new re("boundingVolume must be defined");if(vi(e,"3DTILES_bounding_volume_S2"))return new wU(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:a,sphere:s}=e;if(l(r)){let c=Nrt(r,t,n);return this._verticalExaggeration!==1&&oge(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(a)){let c=Frt(a,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof cf?oge(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=ho.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=ho.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(te.WGS84))),c}if(l(s)){let c=krt(s,t,n);if(this._verticalExaggeration!==1){let u=ho.getPosition(c.center,te.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,IQ),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new re("boundingVolume must contain a sphere, region, or box")};var zrt=h.unpackArray(new Array(24).fill(0));function oge(e,t,n){let i=e.boundingVolume.computeCorners(zrt).map(r=>ho.getPosition(r,te.WGS84,t,n,r)),o=$t.fromPoints(i,hge);e.update(o.center,o.halfAxes)}rr.prototype.updateTransform=function(e,t){e=e??R.IDENTITY;let n=R.multiplyTransformation(e,this.transform,SQ),i=!R.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&R.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.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()};rr.prototype.updateGeometricErrorScale=function(){let e=R.getScale(this.computedTransform,fge),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Urt(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=U.WHITE:c=U.DARKGRAY:c=U.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Yt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(U.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(U.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let a=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),s=!t.debugColorizeTiles&&e._debugColorizeTiles;a?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):s&&(e._debugColorizeTiles=!1,e.color=U.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),s&&t.makeStyleDirty()}function Vrt(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=ir.FAILED,o}}function jrt(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 Grt(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)}rr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;jrt(this,e),Grt(this,e),Urt(this,e,t,n),Vrt(this,e,t);let r=i.length;this._commandsLength=r-o;for(let a=o;a<r;++a){let s=i[a],c=s.pass===Ie.TRANSLUCENT;s.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var rge=[];rr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(wrt(this),this._selectedFrame=0,this.lastStyleTime=0,Q.now(this._loadTimestamp),this._contentState=ir.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=rge;try{this._content.update(e,t)}catch(i){throw this._contentState=ir.FAILED,i}rge.length=0,t.commandList=n};function age(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function PU(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}rr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,a=0,s=o,c=a+s,u=o,f=c+u,d=r,p=Math.pow(10,f),g=f+d,m=r,A=Math.pow(10,g),y=g+m,x=Math.pow(10,y),b=PU(this._depth,n.depth,i.depth);b=t?1-b:b;let E=!e.isSkippingLevelOfDetail&&this.refine===pr.REPLACE?PU(this._priorityHolder._distanceToCamera,n.distance,i.distance):PU(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),S=age(E,s,a),w=this._priorityProgressiveResolution?0:p,P=PU(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),O=age(P,u,c),B=this.priorityDeferred?A:0,L=e._pass===or.PRELOAD_FLIGHT?0:x;this._priority=b+S+w+O+B+L};rr.prototype.isDestroyed=function(){return!1};rr.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(),fe(this)};var Ph=rr;function X0(e){e=e??G.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(X0.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}}});X0.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};X0.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};X0.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};X0.prototype.getProperty=function(e){return Un.getProperty(e,this._properties,this._class)};X0.prototype.setProperty=function(e,t){return Un.setProperty(e,t,this._properties,this._class)};X0.prototype.getPropertyBySemantic=function(e){return Un.getPropertyBySemantic(e,this._properties,this._class)};X0.prototype.setPropertyBySemantic=function(e,t){return Un.setPropertyBySemantic(e,t,this._properties,this._class)};var uP=X0;function K0(e){e=e??G.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(K0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});K0.prototype.hasProperty=function(e){return Un.hasProperty(e,this._properties,this._class)};K0.prototype.hasPropertyBySemantic=function(e){return Un.hasPropertyBySemantic(e,this._properties,this._class)};K0.prototype.getPropertyIds=function(e){return Un.getPropertyIds(this._properties,this._class,e)};K0.prototype.getProperty=function(e){return Un.getProperty(e,this._properties,this._class)};K0.prototype.setProperty=function(e,t){return Un.setProperty(e,t,this._properties,this._class)};K0.prototype.getPropertyBySemantic=function(e){return Un.getPropertyBySemantic(e,this._properties,this._class)};K0.prototype.setPropertyBySemantic=function(e,t){return Un.setPropertyBySemantic(e,t,this._properties,this._class)};var RU=K0;function mge(e){e=e??G.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new RU({tileset:i,class:n.classes[i.class]}));let r=[],a=[],s=t.groups;if(Array.isArray(s)){let c=s.length;for(let u=0;u<c;u++){let f=s[u];a.push(new uP({group:f,class:n.classes[f.class]}))}}else if(l(s)){r=Object.keys(s).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(s.hasOwnProperty(f)){let d=s[f];a.push(new uP({id:f,group:s[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=a,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(mge.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 rv=mge;var pge={},Hrt=new h;pge.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof cf||i instanceof yd){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Ih.USE_OPTIMIZATION;for(let r=0;r<n;++r){let s=t[r].boundingVolume;if(!(s instanceof cf||s instanceof yd)){e._optimChildrenWithinParent=Ih.SKIP_OPTIMIZATION;break}let c=s._orientedBoundingBox,u=h.subtract(c.center,o.center,Hrt),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=Ih.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Ih.USE_OPTIMIZATION};var OU=pge;function fP(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(fP.prototype,{length:{get:function(){return this._length}}});function Wrt(e,t,n){this.item=e,this.previous=t,this.next=n}fP.prototype.add=function(e){let t=new Wrt(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 gge(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}fP.prototype.remove=function(e){l(e)&&(gge(this,e),--this._length)};fP.prototype.splice=function(e,t){if(e===t)return;gge(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 MU=fP;function eb(){this._list=new MU,this._sentinel=this._list.add(),this._trimTiles=!1}eb.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};eb.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};eb.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};eb.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};eb.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 a=r.item;r=r.next,this.unloadTile(e,a,t)}};eb.prototype.trim=function(){this._trimTiles=!0};var BU=eb;function LU(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 PQ(e,t){let n;return t==="_loadTimestamp"?n=Q.toDate(e).getTime():n=e,n}LU.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=PQ(e,n),this._referenceMaximum[n]=PQ(t,n)};function qrt(e,t){let n=e.tilePropertyName;if(l(n)){let i=PQ(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 DQ=[new U(.1,.1,.1,1),new U(.153,.278,.878,1),new U(.827,.231,.49,1),new U(.827,.188,.22,1),new U(1,.592,.259,1),new U(1,.843,0,1)];LU.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=qrt(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let a=r-o+D.EPSILON7,c=D.clamp(i-o,0,a)/a,u=DQ.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=DQ[d],A=DQ[p],y=U.clone(U.WHITE);y.red=D.lerp(m.red,A.red,g),y.green=D.lerp(m.green,A.green,g),y.blue=D.lerp(m.blue,A.blue,g),e._debugColor=y};LU.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 NU=LU;function av(){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.texturesReferenceCounterById={},this.batchTableByteLength=0}av.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};av.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};av.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof ld))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};av.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof ld))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};av.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,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.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var fp=av;function dP(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(dP.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});dP.prototype.makeDirty=function(){this._styleDirty=!0};dP.prototype.resetDirty=function(){this._styleDirty=!1};dP.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 a=0;a<r;++a){let s=o[a];if(s.lastStyleTime!==n){let c=s.content;s.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var FU=dP;function Yrt(e,t,n){let i=vi(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)&&!vi(o,"3DTILES_bounding_volume_S2")&&!vi(o,"3DTILES_bounding_volume_cylinder"))throw new re("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 De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=Xrt(t);for(let a=0;a<r.length;a++){let s=r[a];this.contentHeaders.push(qe(s,!0));let c=new De({url:s.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Krt(t),this.subdivisionScheme=Va[i.subdivisionScheme],this.branchingFactor=Va.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Xrt(e){if(vi(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 Krt(e){let t=qe(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 Q0=Yrt;var hP={};function _ge(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function RQ(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Age(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 OQ(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}hP.encode2D=function(e,t){return(_ge(e)|_ge(t)<<1)>>>0};hP.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Age(e),t[1]=Age(e>>1),t};hP.encode3D=function(e,t,n){return RQ(e)|RQ(t)<<1|RQ(n)<<2};hP.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=OQ(e),t[1]=OQ(e>>1),t[2]=OQ(e>>2),t};var tb=hP;function ar(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===Va.OCTREE&&(this.z=e.z)}Object.defineProperties(ar.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Va.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Va.OCTREE?tb.encode3D(this.x,this.y,this.z):tb.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Va.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});ar.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===Va.OCTREE){let o=(this.z<<e.level)+e.z;return new ar({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new ar({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};ar.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===Va.OCTREE){let r=Math.floor(this.z/t);return new ar({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new ar({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};ar.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===Va.OCTREE){let r=e.z%n;return new ar({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new ar({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};ar.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===Va.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new ar({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new ar({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};ar.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};ar.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};ar.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===Va.OCTREE){let a=e.z>>t,s=this.z===a;return o&&r&&s}return o&&r};ar.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===Va.OCTREE?this.z===e.z:!0)};ar.prototype.isImplicitTilesetRoot=function(){return this.level===0};ar.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};ar.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};ar.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Va.OCTREE&&(e.z=this.z),e};var yge=[0,0,0];ar.fromMortonIndex=function(e,t,n,i){let o;return e===Va.OCTREE?(o=tb.decode3D(i,yge),new ar({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=tb.decode2D(i,yge),new ar({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};ar.fromTileIndex=function(e,t,n){let i,o,r;return e===Va.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(D.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),ar.fromMortonIndex(e,t,i,r)};var $0=ar;function J0(){}J0.selectTiles=function(e,t){_e.throwInstantiationError()};J0.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};J0.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};J0.selectTile=function(e,t){if(e.contentVisibility(t)===qt.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)};J0.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};J0.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};J0.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Qrt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Qrt(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,a=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/a<1}J0.updateTile=function(e,t){xge(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Zrt(e),e._shouldSelect=!1,e._finalResolution=!0};function xge(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];xge(r,t),e._visible=r._visible;return}if($rt(e,t)){e._visible=!1;return}let i=e.refine===pr.REPLACE,o=e._optimChildrenWithinParent===Ih.USE_OPTIMIZATION;if(i&&o&&n&&!Jrt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function $rt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==pr.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Jrt(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 Zrt(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 $s=J0;function bge(){}var mP={stack:new lu,stackMaximumLength:0};bge.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}=$s,a=mP.stack;for(a.push(i);a.length>0;){mP.stackMaximumLength=Math.max(mP.stackMaximumLength,a.length);let s=a.pop(),c=s.refine===pr.ADD,u=s.refine===pr.REPLACE,f=eat(s);f&&tat(s,a,t),(c||u&&!f)&&(nat(e,s),o(s,t),iat(s,t),s.hasRenderableContent&&!s.contentAvailable&&(n=!1)),r(s,t)}return mP.stack.trim(mP.stackMaximumLength),n};function eat(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function tat(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 nat(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function iat(e,t){e.contentAvailable&&e.contentVisibility(t)!==qt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var kU=bge;function Tge(){}var pP={stack:new lu,stackMaximumLength:0},gP={stack:new lu,stackMaximumLength:0};Tge.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($s.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;rat(n,t),pP.stack.trim(pP.stackMaximumLength),gP.stack.trim(gP.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function MQ(e,t){e.contentAvailable&&$s.selectTile(e,t)}function oat(e,t,n){let i=e.refine===pr.REPLACE,{tileset:o,children:r}=e,{updateTile:a,loadTile:s,touchTile:c}=$s;for(let m=0;m<r.length;++m)a(r[m],n);r.sort($s.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let A=r[m];if(A.isVisible?(t.push(A),A._foveatedFactor<g&&(p=m,g=A._foveatedFactor),d=!0):(u||o.loadSiblings)&&(A._foveatedFactor<g&&(p=m,g=A._foveatedFactor),s(A,n),c(A,n)),u){let y;A._inRequestVolume?A.hasRenderableContent?y=A.contentAvailable:y=aat(A,n):y=!1,f=f&&y}}if(d||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let A=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;A._foveatedFactor=Math.min(m._foveatedFactor,A._foveatedFactor),A._distanceToCamera=Math.min(m._distanceToCamera,A._distanceToCamera);for(let y=0;y<r.length;++y)r[y]._priorityHolder=A}return f}function rat(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:a}=$s,s=pP.stack;for(s.push(e);s.length>0;){pP.stackMaximumLength=Math.max(pP.stackMaximumLength,s.length);let c=s.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?oat(c,s,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===pr.ADD?(MQ(c,t),o(c,t)):c.refine===pr.REPLACE&&(o(c,t),d&&MQ(c,t)):(n._emptyTiles.push(c),o(c,t),d&&MQ(c,t)),r(c,t),a(c,t)}}function aat(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=$s,a=!0,s=gP.stack;for(s.push(e);s.length>0;){gP.stackMaximumLength=Math.max(gP.stackMaximumLength,s.length);let c=s.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c);if(!d&&!c.contentAvailable&&(a=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),d)for(let p=0;p<f;++p){let g=u[p];s.push(g)}}return e.hasEmptyContent||a}var zU=Tge;function Cge(){}var _P={stack:new lu,stackMaximumLength:0},AP={stack:new lu,stackMaximumLength:0},Z0={stack:new lu,stackMaximumLength:0,ancestorStack:new lu,ancestorStackMaximumLength:0},sat=2;Cge.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($s.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;hat(n,t),mat(n,t),_P.stack.trim(_P.stackMaximumLength),AP.stack.trim(AP.stackMaximumLength),Z0.stack.trim(Z0.stackMaximumLength),Z0.ancestorStack.trim(Z0.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function cat(e,t){let{updateTile:n,touchTile:i,selectTile:o}=$s,r=AP.stack;for(r.push(e);r.length>0;){AP.stackMaximumLength=Math.max(AP.stackMaximumLength,r.length);let s=r.pop().children;for(let c=0;c<s.length;++c){let u=s[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<sat&&r.push(u))}}}function UU(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:cat(e,t)}function lat(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 uat(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 fat(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:a,touchTile:s}=$s;for(let u=0;u<o.length;++u)r(o[u],n);o.sort($s.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(a(f,n),s(f,n))}return c}function dat(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 hat(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:a,touchTile:s}=$s,c=_P.stack;for(c.push(e);c.length>0;){_P.stackMaximumLength=Math.max(_P.stackMaximumLength,c.length);let u=c.pop();lat(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=o(u)?fat(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===pr.ADD?(UU(u,t),r(u,t)):u.refine===pr.REPLACE&&(dat(u,i)?(r(u,t),p&&UU(u,t)):p?(UU(u,t),r(u,t)):uat(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&UU(u,t)),a(u,t),s(u,t)}}function mat(e,t){let{selectTile:n,canTraverse:i}=$s,{stack:o,ancestorStack:r}=Z0,a;for(o.push(e);o.length>0||r.length>0;){if(Z0.stackMaximumLength=Math.max(Z0.stackMaximumLength,o.length),Z0.ancestorStackMaximumLength=Math.max(Z0.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==a&&(u._finalResolution=!1),n(u,t);continue}}let s=o.pop();if(!l(s))continue;let c=i(s);if(s._shouldSelect)if(s.refine===pr.ADD)n(s,t);else{if(s._selectionDepth=r.length,s._selectionDepth>0&&(s.tileset.hasMixedContent=!0),a=s,!c){n(s,t);continue}r.push(s),s._stackLength=o.length}if(c){let u=s.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&o.push(d)}}}}var VU=Cge;function hs(){this._layers=[],this.layerAdded=new ye,this.layerRemoved=new ye,this.layerMoved=new ye,this.layerShownOrHidden=new ye}Object.defineProperties(hs.prototype,{length:{get:function(){return this._layers.length}}});hs.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()})};hs.prototype.addImageryProvider=function(e,t){let n=new va(e);return this.add(n,t),n};hs.prototype.remove=function(e,t){t=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};hs.prototype.removeAll=function(e){e=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=[]};hs.prototype.contains=function(e){return this.indexOf(e)!==-1};hs.prototype.indexOf=function(e){return this._layers.indexOf(e)};hs.prototype.get=function(e){return this._layers[e]};function jU(e,t){return e.indexOf(t)}function Ege(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.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)}hs.prototype.raise=function(e){let t=jU(this._layers,e);Ege(this,t,t+1)};hs.prototype.lower=function(e){let t=jU(this._layers,e);Ege(this,t,t-1)};hs.prototype.raiseToTop=function(e){let t=jU(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))};hs.prototype.lowerToBottom=function(e){let t=jU(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 pat=new oe;function vge(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let s=0;!l(r)&&s<o.length;++s){let c=o[s];oe.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let a=r.data.imagery;for(let s=a.length-1;s>=0;--s){let c=a[s],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!oe.contains(u.rectangle,t))continue;let d=pat,p=1/1024;d.west=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),oe.contains(d,t)&&i(u)}}hs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(vge(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};hs.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(vge(t,i,!0,function(a){if(!a.imageryLayer.ready)return;let c=a.imageryLayer.imageryProvider.pickFeatures(a.x,a.y,a.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(a.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(a){let s=[];for(let c=0;c<a.length;++c){let u=a[c],f=r[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),s.push(p)}}return s})};hs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};hs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};hs.prototype.isDestroyed=function(){return!1};hs.prototype.destroy=function(){return this.removeAll(!0),fe(this)};hs.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 sv=hs;function $o(e){e=e??G.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 BU,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=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new lu,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new FU,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?R.clone(e.modelMatrix):R.clone(R.IDENTITY),this._addHeightCallbacks=[],this._statistics=new fp,this._statisticsLast=new fp,this._statisticsPerPass=new Array(or.NUMBER_OF_PASSES);for(let o=0;o<or.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new fp;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 NU(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=D.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??te.WGS84,this._initialClippingPlanesOriginMatrix=R.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new sv(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??D.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??vn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Qu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new I0(e.pointCloudShading),this._pointCloudEyeDomeLighting=new H_,this.loadProgress=new ye,this.allTilesLoaded=new ye,this.initialTilesLoaded=new ye,this.tileLoad=new ye,this.tileUnload=new ye,this.tileFailed=new ye,this.tileVisible=new ye,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&ba.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&qm.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new OC,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new z_(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this.splitDirection=e.splitDirection??Vr.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&_t("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??_h.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties($o.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){ba.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){qm.setOwner(e,this,"_clippingPolygons")}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Hs("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=R.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&&(R.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):R.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},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,Mge(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}}});$o.fromIonAssetId=async function(e,t){let n=await ya.fromAssetId(e);return $o.fromUrl(n,t)};$o.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await $o.loadJson(n),r=await gat(n,o),a=new $o(t);a._resource=n,a._url=n.url,a._basePath=i,a._metadataExtension=r,a._geometricError=o.geometricError,a._scaledGeometricError=o.geometricError;let s=o.asset;a._asset=s,a._extras=o.extras,Mge(a);let c=l(o.asset.gltfUpAxis)?Fi.fromName(o.asset.gltfUpAxis):Fi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??Fi.X;a._properties=o.properties,a._extensionsUsed=o.extensionsUsed,a._extensions=o.extensions,a._modelUpAxis=u,a._modelForwardAxis=f,a._root=a.loadTileset(n,o);let p=a._root.createBoundingVolume(o.root.boundingVolume,R.IDENTITY).boundingSphere.center,g=a._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>wi._defaultMinTerrainHeight&&(a._initialClippingPlanesOriginMatrix=pt.eastNorthUpToFixedFrame(p)),a._clippingPlanesOriginMatrix=R.clone(a._initialClippingPlanesOriginMatrix),a};$o.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};$o.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};$o.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new re("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new re("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&$o.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let a=Sge(this,e,t.root,n);l(n)&&(n.children.push(a),a._depth=n._depth+1);let s=[];for(s.push(a);s.length>0;){let c=s.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===pr.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=Sge(this,e,d,c);c.children.push(p),p._depth=c._depth+1,s.push(p)}this._cullWithChildrenBounds&&OU.checkChildrenWithinParent(c)}return a};function Sge(e,t,n,i){if(!(l(n.implicitTiling)||vi(n,"3DTILES_implicit_tiling")))return new Ph(e,t,n,i);let r=e.schema,a=new Q0(t,n,r),s=new $0({subdivisionScheme:a.subdivisionScheme,subtreeLevels:a.subtreeLevels,level:0,x:0,y:0,z:0}),c=a.subtreeUriTemplate.getDerivedResource({templateValues:s.getTemplateValues()}).url,f=qe(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new Ph(e,t,f,i);return d.implicitTileset=a,d.implicitCoordinates=s,d}async function gat(e,t){let n=vi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Pi.getSchemaLoader({resource:e});else if(l(n.schema))i=Pi.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new rv({schema:i.schema,metadataJson:n});return Pi.unload(i),o}var wge=new h,_at=new de,Aat=new R,yat=new h,xat=new h,bat=new h,Tat=new h;function Cat(e,t){let n,i,o,r,a,s=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof yd)n=h.normalize(s.positionWC,wge),i=s.directionWC,o=s.positionCartographic.height,r=u.minimumHeight,a=u.maximumHeight;else{let A=R.inverseTransformation(c.computedTransform,Aat),y=t.mapProjection.ellipsoid,x=u.boundingVolume,b=R.multiplyByPoint(A,x.center,yat);if(h.magnitude(b)>y.minimumRadius){let T=de.fromCartesian(b,y,_at);n=h.normalize(s.positionWC,wge),i=s.directionWC,o=s.positionCartographic.height,r=0,a=T.height*2}else{let T=R.multiplyByPoint(A,s.positionWC,xat);if(n=h.UNIT_Z,i=R.multiplyByPointAsVector(A,s.directionWC,bat),i=h.normalize(i,i),o=T.z,u instanceof cf){let E=$.getColumn(x.halfAxes,2,Tat),S=h.magnitude(E);r=b.z-S,a=b.z+S}else if(u instanceof dA){let E=x.radius;r=b.z-E,a=b.z+E}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=r+(a-r)*f,p=a,g=D.clamp((o-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function Eat(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=>{Pge(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?kat(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Dge(e,t){return e._priority-t._priority}$o.prototype.postPassesUpdate=function(e){l(this._root)&&(vat(this,e),Uat(this,e),this._cache.unloadTiles(this,Oge),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};$o.prototype.prePassesUpdate=function(e){if(!l(this._root))return;Oat(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=Q.clone(e.time)),this._timeSinceLoad=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&Cat(this,e),e.newFrame&&this._cache.reset()};function vat(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],a=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==ir.LOADING){++i;continue}else if(a){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function Sat(e){let t=e._requestedTiles;t.sort(Dge);for(let n=0;n<t.length;++n)Eat(e,t[n])}function Pge(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 wat(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==ir.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var Iat=new de,Dat=new de,Pat=new h;function Rat(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 a=r.ellipsoid,s=de.clone(r.positionCartographic,Iat),c=de.fromCartesian(o.center,a,Dat);l(c)&&(s.height=c.height);let u=de.toCartesian(s,a,Pat);h.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{l(r.callback)&&r.callback(),r.invoked=!1}))}}function Oat(e,t){wat(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,a=i+o,s=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>a){s=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,Pge(f,e,u)}}e.totalMemoryUsageInBytes<i?Bat(e):s&&n.length>0&&Mat(e)}function Mat(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(Dge)}function Bat(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var GU=new h,Lat={maximumFractionDigits:3};function Ige(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Lat):Math.round(t).toLocaleString()}function BQ(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,GU);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,GU);r=h.multiplyByScalar(r,.75*n,GU),o=h.add(r,i,GU)}return o}function LQ(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=`
  10166. Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=`
  10167. Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=`
  10168. Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=`
  10169. Triangles: ${e.content.trianglesLength}`,o++),i+=`
  10170. Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=`
  10171. Texture Memory: ${Ige(e.content.texturesByteLength)}`,i+=`
  10172. Geometry Memory: ${Ige(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
  10173. Urls:`;let a=e.content.innerContentUrls;for(let s=0;s<a.length;s++)i+=`
  10174. - ${a[s]}`;o+=a.length}else i+=`
  10175. 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 Nat(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 a=l(e.debugPickPosition)?e.debugPickPosition:BQ(e.debugPickedTile),s=LQ(e.debugPickedTile,e,a);s.pixelOffset=new z(15,-15)}}else{for(let a=0;a<i;++a){let s=n[a];LQ(s,e,BQ(s))}for(let a=0;a<r;++a){let s=o[a];(s.hasTilesetContent||s.hasImplicitContent)&&LQ(s,e,BQ(s))}}e._tileDebugLabels.update(t)}function Fat(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,a=e._selectedTiles,s=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&a.length>0;e._backfaceCommands.length=0,s&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new si({stencil:0,pass:Ie.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:Ht.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<a.length;++m){let A=a[m];f&&u.raiseEvent(A),Rat(e,A,t),A.update(e,t,n),c.incrementSelectionCounts(A.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),s){let m=e._backfaceCommands.values,A=m.length;i.length+=A;for(let y=g-1;y>=0;--y)i[d+A+y]=i[d+y];for(let y=0;y<A;++y)i[d+y]=m[y]}g=i.length-r,c.numberOfCommands=g,f&&(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 k0),Nat(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Rge=[];function kat(e,t){let n=t,i=Rge;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&&(zat(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Oge(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function zat(e,t){e._cache.unloadTile(e,t,Oge),t.destroy()}$o.prototype.trimLoadedTiles=function(){this._cache.trim()};function Uat(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,a=i.numberOfPendingRequests,s=i.numberOfTilesProcessing;fp.clone(n,i);let c=o!==a||r!==s;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 Vat(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 jat(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!R.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=R.clone(e.modelMatrix,e._previousModelMatrix)))}function Gat(e,t,n,i){if(t.mode===ie.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,Vat(e),jat(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Sat(e),Fat(e,t,i),fp.clone(o,n),i.isRender){let a=e._credits;if(l(a)&&o.selected!==0)for(let s=0;s<a.length;++s){let c=a[s];t.creditDisplay.addCreditToNextFrame(c)}}return r}function Mge(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(xt.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 xt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}$o.prototype.getTraversal=function(e){let{pass:t}=e;return t===or.MOST_DETAILED_PRELOAD||t===or.MOST_DETAILED_PICK?kU:this.isSkippingLevelOfDetail?VU:zU};$o.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};$o.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===or.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===or.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===or.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 a=or.getPassOptions(n),s=a.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,a.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let d=this._statisticsPerPass[n];(this.show||s)&&(this._pass=n,t.ready=Gat(this,e,d,a)),s&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};$o.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};$o.prototype.isDestroyed=function(){return!1};$o.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=Rge;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,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,fe(this)};$o.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};$o.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!$o.supportedExtensions[e[t]])throw new re(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Hat=new An,Wat=new h,qat=new de;$o.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=te.WGS84);let i=Hat,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,Wat);if(l(r))return n.cartesianToCartographic(r,qat)?.height};$o.prototype.updateHeight=function(e,t,n){n=n??te.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,a=r.length;for(let s=0;s<a;++s)if(r[s]===i){r.splice(s,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var Yat=new ia,Xat=new h;$o.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 u=i[c],f=ui.raySphere(e,u.contentBoundingVolume.boundingSphere,Yat);!l(f)||!l(u.content)||r.push(u)}let a=r.length;r.sort((c,u)=>{let f=ce.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),d=ce.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-d});let s;for(let c=0;c<a;++c){let f=r[c].content.pick(e,t,Xat);if(l(f))return s=h.clone(f,n),s}};$o.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};$o.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var wa=$o;var Kat=new R;function mA(e,t){t.collectionChanged.addEventListener(mA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Nt,this._onCollectionChanged(t,t.values,[],[])}mA.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 a=t[o],s=a._tileset,c,u=n[a.id],f=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),d;f&&(d=a.computeModelMatrix(e,Kat),c=De.createIfNeeded(X.getValueOrUndefined(s._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[a.id],Qat(c,n,a,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(s.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};mA.prototype.isDestroyed=function(){return!1};mA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(mA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)NQ(this,e[i],t,n);return fe(this)};mA.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Tt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ce.clone(i.boundingSphere,t),Tt.DONE):Tt.FAILED:Tt.PENDING};mA.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._entitiesToVisualize,s=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&a.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?a.set(r.id,r):(NQ(this,r,s,c),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],NQ(this,r,s,c),a.remove(r.id)};function NQ(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function Qat(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await wa.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 HU=mA;var $at=U.WHITE,Jat=U.BLACK,Zat=new z(2,2);function cv(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new ye,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(cv.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:pe("evenColor"),oddColor:pe("oddColor"),repeat:pe("repeat")});cv.prototype.getType=function(e){return"Checkerboard"};var est=new Q;cv.prototype.getValue=function(e,t){return l(e)||(e=Q.now(est)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,$at,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,Jat,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,Zat),t};cv.prototype.equals=function(e){return this===e||e instanceof cv&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var yP=cv;var Bge={id:void 0};function xP(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),a=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,a)}while(e._refire);e._firing=!1}}}function Zc(e){this._owner=e,this._entities=new Nt,this._addedEntities=new Nt,this._removedEntities=new Nt,this._changedEntities=new Nt,this._suspendCount=0,this._collectionChanged=new ye,this._id=Hn(),this._show=!0,this._firing=!1,this._refire=!1}Zc.prototype.suspendEvents=function(){this._suspendCount++};Zc.prototype.resumeEvents=function(){this._suspendCount--,xP(this)};Object.defineProperties(Zc.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],a=i[t];r!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});Zc.prototype.computeAvailability=function(){let e=Qe.MAXIMUM_VALUE,t=Qe.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let a=n[i].availability;if(l(a)){let s=a.start,c=a.stop;Q.lessThan(s,e)&&!s.equals(Qe.MINIMUM_VALUE)&&(e=s),Q.greaterThan(c,t)&&!c.equals(Qe.MAXIMUM_VALUE)&&(t=c)}}return Qe.MAXIMUM_VALUE.equals(e)&&(e=Qe.MINIMUM_VALUE),Qe.MINIMUM_VALUE.equals(t)&&(t=Qe.MAXIMUM_VALUE),new wn({start:e,stop:t})};Zc.prototype.add=function(e){e instanceof Yo||(e=new Yo(e));let t=e.id,n=this._entities;if(n.contains(t))throw new _e(`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(Zc.prototype._onEntityDefinitionChanged,this),xP(this),e};Zc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Zc.prototype.contains=function(e){return this._entities.get(e.id)===e};Zc.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(Zc.prototype._onEntityDefinitionChanged,this),xP(this),!0):!1};Zc.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 a=n[r],s=a.id,c=i.get(s);l(c)||(a.definitionChanged.removeEventListener(Zc.prototype._onEntityDefinitionChanged,this),o.set(s,a))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),xP(this)};Zc.prototype.getById=function(e){return this._entities.get(e)};Zc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Bge.id=e,t=new Yo(Bge),this.add(t)),t};Zc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),xP(this)};var Js=Zc;var WU={id:void 0},lv=new Array(2);function FQ(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 Lge(e,t,n,i){lv[0]=n,lv[1]=i.id,t[JSON.stringify(lv)]=i.definitionChanged.addEventListener(ua.prototype._onDefinitionChanged,e)}function Nge(e,t,n,i){lv[0]=n,lv[1]=i.id;let o=JSON.stringify(lv);t[o](),t[o]=void 0}function pA(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,a,s,c,u,f=e._composite,d=new Js(e),p=e._eventHash,g;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(ua.prototype._onCollectionChanged,e),s=u.values,g=u.id,c=s.length-1;c>-1;c--)a=s[c],Nge(e,p,g,a);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(ua.prototype._onCollectionChanged,e),s=u.values,g=u.id,c=s.length-1;c>-1;c--){a=s[c],Lge(e,p,g,a);let A=d.getById(a.id);l(A)||(A=f.getById(a.id),l(A)?FQ(A):(WU.id=a.id,A=new Yo(WU)),d.add(A)),A.merge(a)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function ua(e,t){this._owner=t,this._composite=new Js(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Hn(),this._eventHash={},pA(this),this._shouldRecomposite=!1}Object.defineProperties(ua.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}}});ua.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),pA(this)};ua.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),pA(this),!0):!1};ua.prototype.removeAllCollections=function(){this._collections.length=0,pA(this)};ua.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};ua.prototype.contains=function(e){return this._composite.contains(e)};ua.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};ua.prototype.getCollection=function(e){return this._collections[e]};ua.prototype.getCollectionsLength=function(){return this._collections.length};function qU(e,t){return e.indexOf(t)}function Fge(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,pA(e)}ua.prototype.raiseCollection=function(e){let t=qU(this._collections,e);Fge(this,t,t+1)};ua.prototype.lowerCollection=function(e){let t=qU(this._collections,e);Fge(this,t,t-1)};ua.prototype.raiseCollectionToTop=function(e){let t=qU(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),pA(this))};ua.prototype.lowerCollectionToBottom=function(e){let t=qU(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),pA(this))};ua.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};ua.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(pA(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};ua.prototype.computeAvailability=function(){return this._composite.computeAvailability()};ua.prototype.getById=function(e){return this._composite.getById(e)};ua.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let a,s,c,u,f=n.length,d=this._eventHash,p=e.id;for(a=0;a<f;a++){let m=n[a];Nge(this,d,p,m);let A=m.id;for(s=o-1;s>=0;s--)c=i[s].getById(A),l(c)&&(l(u)||(u=r.getById(A),FQ(u)),u.merge(c));l(u)||r.removeById(A),u=void 0}let g=t.length;for(a=0;a<g;a++){let m=t[a];Lge(this,d,p,m);let A=m.id;for(s=o-1;s>=0;s--)c=i[s].getById(A),l(c)&&(l(u)||(u=r.getById(A),l(u)?FQ(u):(WU.id=A,u=new Yo(WU),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};ua.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,a=o.length,s=e.id,c=r.getById(s),u=c[t],f=!l(u),d=!0;for(let p=a-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var kge=ua;function kQ(){this._removalFunctions=[]}kQ.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)}};kQ.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Yr=kQ;function VQ(e,t){return Q.compare(e.start,t.start)}function fa(e){if(this._intervals=[],this._changedEvent=new ye,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(fa.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}}});fa.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof fa))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(!wn.equals(n[r],i[r],t))return!1;return!0};fa.prototype.get=function(e){return this._intervals[e]};fa.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};fa.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};fa.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};fa.prototype.contains=function(e){return this.indexOf(e)>=0};var zQ=new wn;fa.prototype.indexOf=function(e){let t=this._intervals;zQ.start=e,zQ.stop=e;let n=Ao(t,zQ,VQ);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&&wn.contains(t[n-1],e)?n-1:~n)};fa.prototype.findInterval=function(e){e=e??G.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let a=0,s=r.length;a<s;a++){let c=r[a];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[a]}};fa.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||Q.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Ao(n,e,VQ);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=Q.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)?(Q.greaterThan(e.stop,n[i-1].stop)?e=new wn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new wn({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=Q.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new wn({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 wn({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=Q.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 wn({start:e.start,stop:Q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:Q.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new wn({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)};fa.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Ao(t,e,VQ);n<0&&(n=~n);let i=!1;for(n>0&&(Q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(Q.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 wn({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 wn({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 wn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&Q.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 wn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new wn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(Q.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new wn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};fa.prototype.intersect=function(e,t,n){let i=new fa,o=0,r=0,a=this._intervals,s=e._intervals;for(;o<a.length&&r<s.length;){let c=a[o],u=s[r];if(Q.lessThan(c.stop,u.start))++o;else if(Q.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=wn.intersect(c,u,new wn,n);f.isEmpty||i.addInterval(f,t)}Q.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};fa.fromJulianDateArray=function(e,t){l(t)||(t=new fa);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,a=e.isStopIncluded??!0,s=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;s&&(++f,u=new wn({start:Qe.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new wn({start:p,stop:g,isStartIncluded:t.length===f?r:!0,isStopIncluded:d===i-2?a:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=g}return c&&(u=new wn({start:n[i-1],stop:Qe.MAXIMUM_VALUE,isStartIncluded:!a,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var el=new Wg,bP=[0,31,28,31,30,31,30,31,31,30,31,30,31];function UQ(e,t,n){l(n)||(n=new Q),Q.toGregorianDate(e,el);let i=el.millisecond+t.millisecond,o=el.second+t.second,r=el.minute+t.minute,a=el.hour+t.hour,s=el.day+t.day,c=el.month+t.month,u=el.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&&(a+=Math.floor(r/60),r=r%60),a>=24&&(s+=Math.floor(a/24),a=a%24),bP[2]=hm(u)?29:28;s>bP[c]||c>=13;)s>bP[c]&&(s-=bP[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),bP[2]=hm(u)?29:28;return el.millisecond=i,el.second=o,el.minute=r,el.hour=a,el.day=s,el.month=c,el.year=u,Q.fromGregorianDate(el,n)}var tst=new Q,nst=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function zge(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(nst);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"),Q.toGregorianDate(Q.fromIso8601(e,tst),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var TP=new Wg;fa.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!zge(n[2],TP))r.push(i,o);else{let a=Q.clone(i);for(r.push(a);Q.compare(a,o)<0;)a=UQ(a,TP),Q.compare(o,a)<=0&&Q.clone(o,a),r.push(a)}return fa.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};fa.fromIso8601DateArray=function(e,t){return fa.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return Q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};fa.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],a,s,c=i.length;for(let u=0;u<c;++u)(zge(i[u],TP)||u===0)&&(o&&l(s)?a=UQ(s,TP):a=UQ(n,TP),r.push(a),s=a);return fa.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Ia=fa;function ist(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let a=i.length;for(let s=0;s<a;s++){let c=i.get(s);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function nb(){this._eventHelper=new Yr,this._definitionChanged=new ye,this._intervals=new Ia,this._intervals.changedEvent.addEventListener(nb.prototype._intervalsChanged,this)}Object.defineProperties(nb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var ost=new Q;nb.prototype.getValue=function(e,t){l(e)||(e=Q.now(ost));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};nb.prototype.equals=function(e){return this===e||e instanceof nb&&this._intervals.equals(e._intervals,X.equals)};nb.prototype._intervalsChanged=function(){ist(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Nl=nb;function gA(){this._definitionChanged=new ye,this._composite=new Nl,this._composite.definitionChanged.addEventListener(gA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(gA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});gA.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var rst=new Q;gA.prototype.getValue=function(e,t){l(e)||(e=Q.now(rst));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};gA.prototype.equals=function(e){return this===e||e instanceof gA&&this._composite.equals(e._composite,X.equals)};gA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var CP=gA;function _A(e){this._referenceFrame=e??Ni.FIXED,this._definitionChanged=new ye,this._composite=new Nl,this._composite.definitionChanged.addEventListener(_A.prototype._raiseDefinitionChanged,this)}Object.defineProperties(_A.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 ast=new Q;_A.prototype.getValue=function(e,t){return l(e)||(e=Q.now(ast)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};_A.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};_A.prototype.equals=function(e){return this===e||e instanceof _A&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};_A.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var bc=_A;var Uge={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(Uge);var Ji=Uge;var Zs=[new h,new h],sst=new h,cst=new h,lst=new h,ust=new h,fst=new h,dst=new h,hst=new h,mst=new h,pst=new h,uv=new h,YU=new h,EP={},jQ=new de;function gst(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];jQ=t.cartesianToCartographic(o,jQ),n[i]=jQ.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function GQ(e,t,n,i){let o=e[0],r=e[1],a=h.angleBetween(o,r),s=Math.ceil(a/i),c=new Array(s),u;if(t===n){for(u=0;u<s;u++)c[u]=t;return c.push(n),c}let d=(n-t)/s;for(u=1;u<s;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var XU=new h,KU=new h;function _st(e,t,n,i){let o=new za(n,i),r=o.projectPointOntoPlane(h.add(n,e,XU),XU),a=o.projectPointOntoPlane(h.add(n,t,KU),KU),s=z.angleBetween(r,a);return a.x*r.y-a.y*r.x>=0?-s:s}var Ast=new h(-1,0,0),ib=new R,yst=new R,HQ=new $,xst=$.IDENTITY.clone(),bst=new h,Tst=new se,Vge=new h;function eg(e,t,n,i,o,r,a,s){let c=bst,u=Tst;ib=pt.eastNorthUpToFixedFrame(e,o,ib),c=R.multiplyByPointAsVector(ib,Ast,c),c=h.normalize(c,c);let f=_st(c,t,e,o);HQ=$.fromRotationZ(f,HQ),Vge.z=r,ib=R.multiplyTransformation(ib,R.fromRotationTranslation(HQ,Vge,yst),ib);let d=xst;d[0]=a;for(let p=0;p<s;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=R.multiplyByPoint(ib,u,u),i.push(u.x,u.y,u.z);return i}var Cst=new h;function WQ(e,t,n,i,o,r,a){for(let s=0;s<e.length;s+=3){let c=h.fromArray(e,s,Cst);i=eg(c,t,n,i,o,r[s/3],a,1)}return i}function Est(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,a=t.y+t.height/2,s=e[0];i[o++]=s.x-r,i[o++]=0,i[o++]=s.y-a;for(let c=1;c<n;c++){s=e[c];let u=s.x-r,f=s.y-a;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return s=e[0],i[o++]=s.x-r,i[o++]=0,i[o++]=s.y-a,i}function jge(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,a=t.y+t.height/2;for(let s=0;s<n;s++)i[o++]=e[s].x-r,i[o++]=0,i[o++]=e[s].y-a;return i}var Gge=new Le,Hge=new h,Wge=new $;function qge(e,t,n,i,o,r,a,s,c,u){let f=h.angleBetween(h.subtract(t,e,uv),h.subtract(n,e,YU)),d=i===Ji.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;o?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,uv),f/(d+1),Gge),Wge):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),Gge),Wge);let g,m;if(t=h.clone(t,Hge),d>0){let A=u?2:1;for(let y=0;y<d;y++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,uv),g=h.normalize(g,g),o||(g=h.negate(g,g)),m=r.scaleToGeodeticSurface(t,YU),a=eg(m,g,s,a,r,c,1,A)}else g=h.subtract(t,e,uv),g=h.normalize(g,g),o||(g=h.negate(g,g)),m=r.scaleToGeodeticSurface(t,YU),a=eg(m,g,s,a,r,c,1,1),n=h.clone(n,Hge),g=h.subtract(n,e,uv),g=h.normalize(g,g),o||(g=h.negate(g,g)),m=r.scaleToGeodeticSurface(n,YU),a=eg(m,g,s,a,r,c,1,1);return a}EP.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],a=e[o];z.equals(r,a)||n.push(a)}return n};EP.angleIsGreaterThanPi=function(e,t,n,i){let o=new za(n,i),r=o.projectPointOntoPlane(h.add(n,e,XU),XU),a=o.projectPointOntoPlane(h.add(n,t,KU),KU);return a.x*r.y-a.y*r.x>=0};var vst=new h,Sst=new h;EP.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,a=gst(e,r),s=i._granularity,c=i._cornerType,u=o?Est(t,n):jge(t,n),f=o?jge(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],A=o?[]:void 0,y=sst,x=cst,b=lst,T=ust,E=fst,S=dst,w=hst,P=mst,O=pst,B=e[0],L=e[1];T=r.geodeticSurfaceNormal(B,T),y=h.subtract(L,B,y),y=h.normalize(y,y),P=h.cross(T,y,P),P=h.normalize(P,P);let _=a[0],C=a[1];o&&(A=eg(B,P,f,A,r,_+d,1,1)),O=h.clone(B,O),B=L,x=h.negate(y,x);let v,I;for(let j=1;j<g-1;j++){let k=o?2:1;if(L=e[j+1],B.equals(L)){_t("Positions are too close and are considered equivalent with rounding error.");continue}y=h.subtract(L,B,y),y=h.normalize(y,y),T=r.geodeticSurfaceNormal(B,T);let V=h.multiplyByScalar(T,h.dot(y,T),vst);h.subtract(y,V,V),h.normalize(V,V);let F=h.multiplyByScalar(T,h.dot(x,T),Sst);if(h.subtract(x,F,F),h.normalize(F,F),!D.equalsEpsilon(Math.abs(h.dot(V,F)),1,D.EPSILON7)){b=h.add(y,x,b),b=h.normalize(b,b),b=h.cross(b,T,b),b=h.cross(T,b,b),b=h.normalize(b,b);let q=1/Math.max(.25,h.magnitude(h.cross(b,x,uv))),J=EP.angleIsGreaterThanPi(y,x,B,r);J?(E=h.add(B,h.multiplyByScalar(b,q*p,b),E),S=h.add(E,h.multiplyByScalar(P,p,S),S),Zs[0]=h.clone(O,Zs[0]),Zs[1]=h.clone(S,Zs[1]),v=GQ(Zs,_+d,C+d,s),I=$i.generateArc({positions:Zs,granularity:s,ellipsoid:r}),m=WQ(I,P,u,m,r,v,1),P=h.cross(T,y,P),P=h.normalize(P,P),w=h.add(E,h.multiplyByScalar(P,p,w),w),c===Ji.ROUNDED||c===Ji.BEVELED?qge(E,S,w,c,J,r,m,u,C+d,o):(b=h.negate(b,b),m=eg(B,b,u,m,r,C+d,q,k)),O=h.clone(w,O)):(E=h.add(B,h.multiplyByScalar(b,q*p,b),E),S=h.add(E,h.multiplyByScalar(P,-p,S),S),Zs[0]=h.clone(O,Zs[0]),Zs[1]=h.clone(S,Zs[1]),v=GQ(Zs,_+d,C+d,s),I=$i.generateArc({positions:Zs,granularity:s,ellipsoid:r}),m=WQ(I,P,u,m,r,v,1),P=h.cross(T,y,P),P=h.normalize(P,P),w=h.add(E,h.multiplyByScalar(P,-p,w),w),c===Ji.ROUNDED||c===Ji.BEVELED?qge(E,S,w,c,J,r,m,u,C+d,o):m=eg(B,b,u,m,r,C+d,q,k),O=h.clone(w,O)),x=h.negate(y,x)}else m=eg(O,P,u,m,r,_+d,1,1),O=B;_=C,C=a[j+1],B=L}Zs[0]=h.clone(O,Zs[0]),Zs[1]=h.clone(B,Zs[1]),v=GQ(Zs,_+d,C+d,s),I=$i.generateArc({positions:Zs,granularity:s,ellipsoid:r}),m=WQ(I,P,u,m,r,v,1),o&&(A=eg(B,P,f,A,r,C+d,1,1)),g=m.length;let M=o?g+A.length:g,N=new Float64Array(M);return N.set(m),o&&N.set(A,g),N};var dp=EP;var YQ={},fv=new h,$ge=new h,wst=new h,Yge=new h,Fl=[new h,new h],Jge=new h,Zge=new h,e_e=new h,Ist=new h,Dst=new h,Pst=new h,Rst=new h,Ost=new h,Mst=new h,Bst=new h,Xge=new Le,Kge=new $;function QU(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,fv),h.subtract(n,e,$ge)),a=i===Ji.BEVELED?1:Math.ceil(r/D.toRadians(5))+1,s=a*3,c=new Array(s);c[s-3]=n.x,c[s-2]=n.y,c[s-1]=n.z;let u;o?u=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,fv),r/a,Xge),Kge):u=$.fromQuaternion(Le.fromAxisAngle(e,r/a,Xge),Kge);let f=0;t=h.clone(t,fv);for(let d=0;d<a;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function Lst(e){let t=Jge,n=Zge,i=e_e,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=QU(t,n,i,Ji.ROUNDED,!1),a=e.length-1,s=e[a-1];o=e[a],n=h.fromArray(s,s.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=QU(t,n,i,Ji.ROUNDED,!1);return[r,c]}function Qge(e,t,n,i){let o=fv;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 qQ(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),a=h.multiplyByScalar(t,n,fv),s=h.negate(a,$ge),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,wst),p=h.add(d,s,Yge);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let g=h.add(d,a,Yge);r[u--]=g.z,r[u--]=g.y,r[u--]=g.x}return i.push(o,r),i}YQ.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,a=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=a),l(i)&&(e[i]=a,e[i-1]=r,e[i-2]=o)};var Nst=new h,Fst=new h;YQ.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,a=e.saveAttributes,s=Jge,c=Zge,u=e_e,f=Ist,d=Dst,p=Pst,g=Rst,m=Ost,A=Mst,y=Bst,x=[],b=a?[]:void 0,T=a?[]:void 0,E=n[0],S=n[1];c=h.normalize(h.subtract(S,E,c),c),s=i.geodeticSurfaceNormal(E,s),f=h.normalize(h.cross(s,c,f),f),a&&(b.push(f.x,f.y,f.z),T.push(s.x,s.y,s.z)),g=h.clone(E,g),E=S,u=h.negate(c,u);let w,P=[],O,B=n.length;for(O=1;O<B-1;O++){s=i.geodeticSurfaceNormal(E,s),S=n[O+1],c=h.normalize(h.subtract(S,E,c),c);let _=h.multiplyByScalar(s,h.dot(c,s),Nst);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(s,h.dot(u,s),Fst);if(h.subtract(u,C,C),h.normalize(C,C),!D.equalsEpsilon(Math.abs(h.dot(_,C)),1,D.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,s,d),d=h.cross(s,d,d),d=h.normalize(d,d);let I=o/Math.max(.25,h.magnitude(h.cross(d,u,fv))),M=dp.angleIsGreaterThanPi(c,u,E,i);d=h.multiplyByScalar(d,I,d),M?(m=h.add(E,d,m),y=h.add(m,h.multiplyByScalar(f,o,y),y),A=h.add(m,h.multiplyByScalar(f,o*2,A),A),Fl[0]=h.clone(g,Fl[0]),Fl[1]=h.clone(y,Fl[1]),w=$i.generateArc({positions:Fl,granularity:t,ellipsoid:i}),x=qQ(w,f,o,x),a&&(b.push(f.x,f.y,f.z),T.push(s.x,s.y,s.z)),p=h.clone(A,p),f=h.normalize(h.cross(s,c,f),f),A=h.add(m,h.multiplyByScalar(f,o*2,A),A),g=h.add(m,h.multiplyByScalar(f,o,g),g),r===Ji.ROUNDED||r===Ji.BEVELED?P.push({leftPositions:QU(m,p,A,r,M)}):P.push({leftPositions:Qge(E,h.negate(d,d),A,M)})):(A=h.add(E,d,A),y=h.add(A,h.negate(h.multiplyByScalar(f,o,y),y),y),m=h.add(A,h.negate(h.multiplyByScalar(f,o*2,m),m),m),Fl[0]=h.clone(g,Fl[0]),Fl[1]=h.clone(y,Fl[1]),w=$i.generateArc({positions:Fl,granularity:t,ellipsoid:i}),x=qQ(w,f,o,x),a&&(b.push(f.x,f.y,f.z),T.push(s.x,s.y,s.z)),p=h.clone(m,p),f=h.normalize(h.cross(s,c,f),f),m=h.add(A,h.negate(h.multiplyByScalar(f,o*2,m),m),m),g=h.add(A,h.negate(h.multiplyByScalar(f,o,g),g),g),r===Ji.ROUNDED||r===Ji.BEVELED?P.push({rightPositions:QU(A,p,m,r,M)}):P.push({rightPositions:Qge(E,d,m,M)})),u=h.negate(c,u)}E=S}s=i.geodeticSurfaceNormal(E,s),Fl[0]=h.clone(g,Fl[0]),Fl[1]=h.clone(E,Fl[1]),w=$i.generateArc({positions:Fl,granularity:t,ellipsoid:i}),x=qQ(w,f,o,x),a&&(b.push(f.x,f.y,f.z),T.push(s.x,s.y,s.z));let L;return r===Ji.ROUNDED&&(L=Lst(x)),{positions:x,corners:P,lefts:b,normals:T,endPositions:L}};var oo=YQ;var i_e=new h,o_e=new h,$U=new h,JU=new h,kst=new h,r_e=new h,AA=new h,dv=new h;function a_e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Rh(e,t,n,i,o,r){let a=e.normals,s=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,AA),AA);r.normal&&oo.addAttribute(a,t,i,o),r.tangent&&oo.addAttribute(s,u,i,o),r.bitangent&&oo.addAttribute(c,n,i,o)}function s_e(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,a=e.lefts,s=e.normals,c=new _n,u,f=0,d=0,p,g=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,g+=m*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<o.length;p++){u=o[p];let K=o[p].leftPositions;l(K)?(m=K.length,f+=m,g+=m):(m=o[p].rightPositions.length,d+=m,g+=m)}let A=l(r),y;A&&(y=r[0].length-3,f+=y,d+=y,y/=3,g+=y*6);let x=f+d,b=new Float64Array(x),T=t.normal?new Float32Array(x):void 0,E=t.tangent?new Float32Array(x):void 0,S=t.bitangent?new Float32Array(x):void 0,w={normals:T,tangents:E,bitangents:S},P=0,O=x-1,B,L,_,C,v=i_e,I=o_e,M,N,j=y/2,k=Ue.createTypedArray(x/3,g),V=0;if(A){N=$U,M=JU;let K=r[0];for(v=h.fromArray(s,0,v),I=h.fromArray(a,0,I),p=0;p<j;p++)N=h.fromArray(K,(j-1-p)*3,N),M=h.fromArray(K,(j+p)*3,M),oo.addAttribute(b,M,P),oo.addAttribute(b,N,void 0,O),Rh(w,v,I,P,O,t),L=P/3,C=L+1,B=(O-2)/3,_=B-1,k[V++]=B,k[V++]=L,k[V++]=_,k[V++]=_,k[V++]=L,k[V++]=C,P+=3,O-=3}let F=0,W=0,q=i[F++],J=i[F++];b.set(q,P),b.set(J,O-J.length+1),I=h.fromArray(a,W,I);let H,Z;for(m=J.length-3,p=0;p<m;p+=3)H=n.geodeticSurfaceNormal(h.fromArray(q,p,AA),AA),Z=n.geodeticSurfaceNormal(h.fromArray(J,m-p,dv),dv),v=h.normalize(h.add(H,Z,v),v),Rh(w,v,I,P,O,t),L=P/3,C=L+1,B=(O-2)/3,_=B-1,k[V++]=B,k[V++]=L,k[V++]=_,k[V++]=_,k[V++]=L,k[V++]=C,P+=3,O-=3;for(H=n.geodeticSurfaceNormal(h.fromArray(q,m,AA),AA),Z=n.geodeticSurfaceNormal(h.fromArray(J,m,dv),dv),v=h.normalize(h.add(H,Z,v),v),W+=3,p=0;p<o.length;p++){let K;u=o[p];let le=u.leftPositions,me=u.rightPositions,ae,be,ge=r_e,we=$U,Ee=JU;if(v=h.fromArray(s,W,v),l(le)){for(Rh(w,v,I,void 0,O,t),O-=3,ae=C,be=_,K=0;K<le.length/3;K++)ge=h.fromArray(le,K*3,ge),k[V++]=ae,k[V++]=be-K-1,k[V++]=be-K,oo.addAttribute(b,ge,void 0,O),we=h.fromArray(b,(be-K-1)*3,we),Ee=h.fromArray(b,ae*3,Ee),I=h.normalize(h.subtract(we,Ee,I),I),Rh(w,v,I,void 0,O,t),O-=3;ge=h.fromArray(b,ae*3,ge),we=h.subtract(h.fromArray(b,be*3,we),ge,we),Ee=h.subtract(h.fromArray(b,(be-K)*3,Ee),ge,Ee),I=h.normalize(h.add(we,Ee,I),I),Rh(w,v,I,P,void 0,t),P+=3}else{for(Rh(w,v,I,P,void 0,t),P+=3,ae=_,be=C,K=0;K<me.length/3;K++)ge=h.fromArray(me,K*3,ge),k[V++]=ae,k[V++]=be+K,k[V++]=be+K+1,oo.addAttribute(b,ge,P),we=h.fromArray(b,ae*3,we),Ee=h.fromArray(b,(be+K)*3,Ee),I=h.normalize(h.subtract(we,Ee,I),I),Rh(w,v,I,P,void 0,t),P+=3;ge=h.fromArray(b,ae*3,ge),we=h.subtract(h.fromArray(b,(be+K)*3,we),ge,we),Ee=h.subtract(h.fromArray(b,be*3,Ee),ge,Ee),I=h.normalize(h.negate(h.add(Ee,we,I),I),I),Rh(w,v,I,void 0,O,t),O-=3}for(q=i[F++],J=i[F++],q.splice(0,3),J.splice(J.length-3,3),b.set(q,P),b.set(J,O-J.length+1),m=J.length-3,W+=3,I=h.fromArray(a,W,I),K=0;K<J.length;K+=3)H=n.geodeticSurfaceNormal(h.fromArray(q,K,AA),AA),Z=n.geodeticSurfaceNormal(h.fromArray(J,m-K,dv),dv),v=h.normalize(h.add(H,Z,v),v),Rh(w,v,I,P,O,t),C=P/3,L=C-1,_=(O-2)/3,B=_+1,k[V++]=B,k[V++]=L,k[V++]=_,k[V++]=_,k[V++]=L,k[V++]=C,P+=3,O-=3;P-=3,O+=3}if(v=h.fromArray(s,s.length-3,v),Rh(w,v,I,P,O,t),A){P+=3,O-=3,N=$U,M=JU;let K=r[1];for(p=0;p<j;p++)N=h.fromArray(K,(y-p-1)*3,N),M=h.fromArray(K,p*3,M),oo.addAttribute(b,N,void 0,O),oo.addAttribute(b,M,P),Rh(w,v,I,P,O,t),C=P/3,L=C-1,_=(O-2)/3,B=_+1,k[V++]=B,k[V++]=L,k[V++]=_,k[V++]=_,k[V++]=L,k[V++]=C,P+=3,O-=3}if(c.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),t.st){let K=new Float32Array(x/3*2),le,me,ae=0;if(A){f/=3,d/=3;let be=Math.PI/(y+1);me=1/(f-y+1),le=1/(d-y+1);let ge,we=y/2;for(p=we+1;p<y+1;p++)ge=D.PI_OVER_TWO+be*p,K[ae++]=le*(1+Math.cos(ge)),K[ae++]=.5*(1+Math.sin(ge));for(p=1;p<d-y+1;p++)K[ae++]=p*le,K[ae++]=0;for(p=y;p>we;p--)ge=D.PI_OVER_TWO-p*be,K[ae++]=1-le*(1+Math.cos(ge)),K[ae++]=.5*(1+Math.sin(ge));for(p=we;p>0;p--)ge=D.PI_OVER_TWO-be*p,K[ae++]=1-me*(1+Math.cos(ge)),K[ae++]=.5*(1+Math.sin(ge));for(p=f-y;p>0;p--)K[ae++]=p*me,K[ae++]=1;for(p=1;p<we+1;p++)ge=D.PI_OVER_TWO+be*p,K[ae++]=me*(1+Math.cos(ge)),K[ae++]=.5*(1+Math.sin(ge))}else{for(f/=3,d/=3,me=1/(f-1),le=1/(d-1),p=0;p<d;p++)K[ae++]=p*le,K[ae++]=0;for(p=f;p>0;p--)K[ae++]=(p-1)*me,K[ae++]=1}c.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:K})}return t.normal&&(c.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:w.normals})),t.tangent&&(c.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:w.tangents})),t.bitangent&&(c.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:w.bitangents})),{attributes:c,indices:k}}function zst(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,a=r*3,s=r*2,c=a*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(a*6):void 0,d=t.tangent?new Float32Array(a*6):void 0,p=t.bitangent?new Float32Array(a*6):void 0,g=i_e,m=o_e,A=$U,y=JU,x=kst,b=r_e,T=c;for(u=0;u<a;u+=3){let E=T+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+a,m),A=h.fromArray(n,(u+3)%a,A),m=h.subtract(m,g,m),A=h.subtract(A,g,A),y=h.normalize(h.cross(m,A,y),y),t.normal&&(oo.addAttribute(f,y,E),oo.addAttribute(f,y,E+3),oo.addAttribute(f,y,T),oo.addAttribute(f,y,T+3)),(t.tangent||t.bitangent)&&(b=h.fromArray(i,u,b),t.bitangent&&(oo.addAttribute(p,b,E),oo.addAttribute(p,b,E+3),oo.addAttribute(p,b,T),oo.addAttribute(p,b,T+3)),t.tangent&&(x=h.normalize(h.cross(b,y,x),x),oo.addAttribute(d,x,E),oo.addAttribute(d,x,E+3),oo.addAttribute(d,x,T),oo.addAttribute(d,x,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<a;u+=3)f[u+a]=-i[u],f[u+a+1]=-i[u+1],f[u+a+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,a),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let E=e.tangent.values;d.set(E),d.set(E,a),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(s*6);d.set(f),d.set(f,s);let p=s*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<s;u+=2){let m=f[u],A=f[u+1];d[p++]=m,d[p++]=A,d[p++]=m,d[p++]=A}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function XQ(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],a=e[i+2];n[t++]=o,n[t++]=r,n[t++]=a,n[t++]=o,n[t++]=r,n[t++]=a}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function Ust(e,t){let n=new Ne({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=oo.computePositions(e),r=s_e(o,n,i),a=e.height,s=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=ni.scaleToGeodeticHeight(f,a,i),m=XQ(f,0,m),g=ni.scaleToGeodeticHeight(g,s,i),m=XQ(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=zst(c,t);let A,y=d/3;if(e.shadowVolume){let B=c.normal.values;d=B.length;let L=new Float32Array(d*6);for(A=0;A<d;A++)B[A]=-B[A];L.set(B,d),L=XQ(B,d*4,L),c.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let B=new Uint8Array(y*6);if(e.offsetAttribute===ln.TOP)B=B.fill(1,0,y).fill(1,y*2,y*4);else{let L=e.offsetAttribute===ln.NONE?0:1;B=B.fill(L)}c.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}let x=u.length,b=y+y,T=Ue.createTypedArray(p.length/3,x*2+b*3);T.set(u);let E=x;for(A=0;A<x;A+=3){let B=u[A],L=u[A+1],_=u[A+2];T[E++]=_+y,T[E++]=L+y,T[E++]=B+y}let S,w,P,O;for(A=0;A<b;A+=2)S=A+b,w=S+b,P=S+1,O=w+1,T[E++]=S,T[E++]=w,T[E++]=P,T[E++]=P,T[E++]=w,T[E++]=O;return{attributes:c,indices:T}}var t_e=new h,vP=new h,Td=new de;function n_e(e,t,n,i,o,r){let a=h.subtract(t,e,t_e);h.normalize(a,a);let s=n.geodeticSurfaceNormal(e,vP),c=h.cross(a,s,t_e);h.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,d=r.latitude,p=r.longitude;h.add(e,c,vP),n.cartesianToCartographic(vP,Td);let g=Td.latitude,m=Td.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,vP),n.cartesianToCartographic(vP,Td),g=Td.latitude,m=Td.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=d,r.longitude=p}var bd=new h,SP=new h,Tu=new de,Cu=new de;function c_e(e,t,n,i,o){e=a_e(e,t);let r=Fo(e,h.equalsEpsilon),a=r.length;if(a<2||n<=0)return new oe;let s=n*.5;Tu.latitude=Number.POSITIVE_INFINITY,Tu.longitude=Number.POSITIVE_INFINITY,Cu.latitude=Number.NEGATIVE_INFINITY,Cu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Ji.ROUNDED){let p=r[0];h.subtract(p,r[1],bd),h.normalize(bd,bd),h.multiplyByScalar(bd,s,bd),h.add(p,bd,SP),t.cartesianToCartographic(SP,Td),c=Td.latitude,u=Td.longitude,Tu.latitude=Math.min(Tu.latitude,c),Tu.longitude=Math.min(Tu.longitude,u),Cu.latitude=Math.max(Cu.latitude,c),Cu.longitude=Math.max(Cu.longitude,u)}for(let p=0;p<a-1;++p)n_e(r[p],r[p+1],t,s,Tu,Cu);let f=r[a-1];h.subtract(f,r[a-2],bd),h.normalize(bd,bd),h.multiplyByScalar(bd,s,bd),h.add(f,bd,SP),n_e(f,SP,t,s,Tu,Cu),i===Ji.ROUNDED&&(t.cartesianToCartographic(SP,Td),c=Td.latitude,u=Td.longitude,Tu.latitude=Math.min(Tu.latitude,c),Tu.longitude=Math.min(Tu.longitude,u),Cu.latitude=Math.max(Cu.latitude,c),Cu.longitude=Math.max(Cu.longitude,u));let d=l(o)?o:new oe;return d.north=Cu.latitude,d.south=Tu.latitude,d.east=Cu.longitude,d.west=Tu.longitude,d}function ng(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._vertexFormat=Ne.clone(e.vertexFormat??Ne.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Ji.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+te.packedLength+Ne.packedLength+7}ng.pack=function(e,t,n){n=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 te.pack(e._ellipsoid,t,n),n+=te.packedLength,Ne.pack(e._vertexFormat,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++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var l_e=te.clone(te.UNIT_SPHERE),u_e=new Ne,tg={positions:void 0,ellipsoid:l_e,vertexFormat:u_e,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};ng.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)o[m]=h.unpack(e,t);let r=te.unpack(e,t,l_e);t+=te.packedLength;let a=Ne.unpack(e,t,u_e);t+=Ne.packedLength;let s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=Ne.clone(a,n._vertexFormat),n._width=s,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(tg.positions=o,tg.width=s,tg.height=c,tg.extrudedHeight=u,tg.cornerType=f,tg.granularity=d,tg.shadowVolume=p,tg.offsetAttribute=g===-1?void 0:g,new ng(tg))};ng.computeRectangle=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??te.default,r=e.cornerType??Ji.ROUNDED;return c_e(n,o,i,r,t)};ng.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=a_e(t,i);let o=Fo(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,a=e._extrudedHeight,s=!D.equalsEpsilon(r,a,0,D.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(s)u.height=r,u.extrudedHeight=a,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=Ust(u,c);else{let g=oo.computePositions(u);if(f=s_e(g,c,i),f.attributes.position.values=ni.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let m=e._offsetAttribute===ln.NONE?0:1,A=f.attributes.position.values.length,y=new Uint8Array(A/3).fill(m);f.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let d=f.attributes,p=ce.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new At({attributes:d,indices:f.indices,primitiveType:Re.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};ng.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new ng({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:a,vertexFormat:Ne.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(ng.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=c_e(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var hv=ng;var f_e=new h,d_e=new h,Vst=new h;function jst(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function h_e(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,a=new _n,s,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){s=o[f];let M=o[f].leftPositions;l(M)?(p=M.length,c+=p,d+=p/3*2):(p=o[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(r),m;g&&(m=r[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let A=c+u,y=new Float64Array(A),x=0,b=A-1,T,E,S,w,P,O,B=m/2,L=Ue.createTypedArray(A/3,d+4),_=0;if(L[_++]=x/3,L[_++]=(b-2)/3,g){n.push(x/3),O=f_e,P=d_e;let M=r[0];for(f=0;f<B;f++)O=h.fromArray(M,(B-1-f)*3,O),P=h.fromArray(M,(B+f)*3,P),oo.addAttribute(y,P,x),oo.addAttribute(y,O,void 0,b),E=x/3,w=E+1,T=(b-2)/3,S=T-1,L[_++]=T,L[_++]=S,L[_++]=E,L[_++]=w,x+=3,b-=3}let C=0,v=i[C++],I=i[C++];for(y.set(v,x),y.set(I,b-I.length+1),p=I.length-3,n.push(x/3,(b-2)/3),f=0;f<p;f+=3)E=x/3,w=E+1,T=(b-2)/3,S=T-1,L[_++]=T,L[_++]=S,L[_++]=E,L[_++]=w,x+=3,b-=3;for(f=0;f<o.length;f++){let M;s=o[f];let N=s.leftPositions,j=s.rightPositions,k,V=Vst;if(l(N)){for(b-=3,k=S,n.push(w),M=0;M<N.length/3;M++)V=h.fromArray(N,M*3,V),L[_++]=k-M-1,L[_++]=k-M,oo.addAttribute(y,V,void 0,b),b-=3;n.push(k-Math.floor(N.length/6)),t===Ji.BEVELED&&n.push((b-2)/3+1),x+=3}else{for(x+=3,k=w,n.push(S),M=0;M<j.length/3;M++)V=h.fromArray(j,M*3,V),L[_++]=k+M,L[_++]=k+M+1,oo.addAttribute(y,V,x),x+=3;n.push(k+Math.floor(j.length/6)),t===Ji.BEVELED&&n.push(x/3-1),b-=3}for(v=i[C++],I=i[C++],v.splice(0,3),I.splice(I.length-3,3),y.set(v,x),y.set(I,b-I.length+1),p=I.length-3,M=0;M<I.length;M+=3)w=x/3,E=w-1,S=(b-2)/3,T=S+1,L[_++]=T,L[_++]=S,L[_++]=E,L[_++]=w,x+=3,b-=3;x-=3,b+=3,n.push(x/3,(b-2)/3)}if(g){x+=3,b-=3,O=f_e,P=d_e;let M=r[1];for(f=0;f<B;f++)O=h.fromArray(M,(m-f-1)*3,O),P=h.fromArray(M,f*3,P),oo.addAttribute(y,O,void 0,b),oo.addAttribute(y,P,x),w=x/3,E=w-1,S=(b-2)/3,T=S+1,L[_++]=T,L[_++]=S,L[_++]=E,L[_++]=w,x+=3,b-=3;n.push(x/3)}else n.push(x/3,(b-2)/3);return L[_++]=x/3,L[_++]=(b-2)/3,a.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y}),{attributes:a,indices:L,wallIndices:n}}function Gst(e){let t=e.ellipsoid,n=oo.computePositions(e),i=h_e(n,e.cornerType),o=i.wallIndices,r=e.height,a=e.extrudedHeight,s=i.attributes,c=i.indices,u=s.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=ni.scaleToGeodeticHeight(u,r,t),d=ni.scaleToGeodeticHeight(d,a,t),p.set(u),p.set(d,f),s.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===ln.TOP)T=T.fill(1,0,f);else{let E=e.offsetAttribute===ln.NONE?0:1;T=T.fill(E)}s.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,m=c.length,A=Ue.createTypedArray(p.length/3,(m+o.length)*2);A.set(c);let y=m;for(g=0;g<m;g+=2){let T=c[g],E=c[g+1];A[y++]=T+f,A[y++]=E+f}let x,b;for(g=0;g<o.length;g++)x=o[g],b=x+f,A[y++]=x,A[y++]=b;return{attributes:s,indices:A}}function wP(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Ji.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+te.packedLength+6}wP.pack=function(e,t,n){n=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 te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var m_e=te.clone(te.UNIT_SPHERE),yA={positions:void 0,ellipsoid:m_e,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};wP.unpack=function(e,t,n){t=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=te.unpack(e,t,m_e);t+=te.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._width=a,n._height=s,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(yA.positions=o,yA.width=a,yA.height=s,yA.extrudedHeight=c,yA.cornerType=u,yA.granularity=f,yA.offsetAttribute=d===-1?void 0:d,new wP(yA))};wP.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=jst(t,i);let o=Fo(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,a=e._extrudedHeight,s=!D.equalsEpsilon(r,a,0,D.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(s)c.height=r,c.extrudedHeight=a,c.offsetAttribute=e._offsetAttribute,u=Gst(c);else{let p=oo.computePositions(c);if(u=h_e(p,c.cornerType),u.attributes.position.values=ni.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===ln.NONE?0:1,A=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let f=u.attributes,d=ce.fromVertices(f.position.values,void 0,3);return new At({attributes:f,indices:u.indices,primitiveType:Re.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var ZU=wP;var Hst=new fi(0);function kl(e){Ci.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(kl.prototype=Object.create(Ci.prototype),kl.prototype.constructor=kl);Object.defineProperties(kl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});kl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&ou.isSupported(this._scene)};kl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};kl.prototype._computeCenter=_e.throwInstantiationError;kl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Ci.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))&&_t(_t.geometryZIndex),this._zIndex=o.zIndex??Hst,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,a=o.extrudedHeightReference;if(l(r)||l(a)){let s=new Mm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new SC(this._scene,s,r,a)}};kl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Ci.prototype.destroy.call(this)};kl.getGeometryHeight=function(e,t){if(!l(e)){t!==nt.NONE&&_t(_t.geometryHeightReference);return}return Yf(t)?0:e};kl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==nt.NONE&&_t(_t.geometryExtrudedHeightReference);return}return Yf(t)?kl.CLAMP_TO_GROUND:e};kl.CLAMP_TO_GROUND="clamp";kl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=nt.NONE),(!l(n)||!l(i))&&(i=nt.NONE);let o=0;if(t!==nt.NONE&&o++,i===nt.RELATIVE_TO_GROUND&&o++,o===2)return ln.ALL;if(o===1)return ln.TOP};var Zn=kl;var p_e=new U,g_e=h.ZERO,__e=new h,A_e=new oe;function Wst(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 Oh(e,t){Zn.call(this,{entity:e,scene:t,geometryOptions:new Wst(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Oh.prototype=Object.create(Zn.prototype),Oh.prototype.constructor=Oh);Oh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,p_e)),l(o)||(o=U.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,g_e,__e))),new Bt({id:t,geometry:new hv(this._options),attributes:i})};Oh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,p_e),o={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,g_e,__e))),new Bt({id:t,geometry:new ZU(this._options),attributes:o})};Oh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};Oh.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Ci.prototype._isHidden.call(this,e,t)};Oh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};Oh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Qe.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,nt.NONE),o=X.getValueOrUndefined(t.extrudedHeight,Qe.MINIMUM_VALUE),r=X.getValueOrDefault(t.extrudedHeightReference,Qe.MINIMUM_VALUE,nt.NONE);l(o)&&!l(n)&&(n=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof Wt?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(Qe.MINIMUM_VALUE,a.positions),a.width=t.width.getValue(Qe.MINIMUM_VALUE),a.granularity=X.getValueOrUndefined(t.granularity,Qe.MINIMUM_VALUE),a.cornerType=X.getValueOrUndefined(t.cornerType,Qe.MINIMUM_VALUE),a.offsetAttribute=Zn.computeGeometryOffsetAttribute(n,i,o,r),a.height=Zn.getGeometryHeight(n,i),o=Zn.getGeometryExtrudedHeight(o,r),o===Zn.CLAMP_TO_GROUND&&(o=wi.getMinimumMaximumHeights(hv.computeRectangle(a,A_e)).minimumTerrainHeight),a.extrudedHeight=o};Oh.DynamicGeometryUpdater=mv;function mv(e,t,n){Ti.call(this,e,t,n)}l(Object.create)&&(mv.prototype=Object.create(Ti.prototype),mv.prototype.constructor=mv);mv.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Ti.prototype._isHidden.call(this,e,t,n)};mv.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,nt.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),s=X.getValueOrDefault(t.extrudedHeightReference,n,nt.NONE);l(a)&&!l(o)&&(o=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Zn.computeGeometryOffsetAttribute(o,r,a,s),i.height=Zn.getGeometryHeight(o,r),a=Zn.getGeometryExtrudedHeight(a,s),a===Zn.CLAMP_TO_GROUND&&(a=wi.getMinimumMaximumHeights(hv.computeRectangle(i,A_e)).minimumTerrainHeight),i.extrudedHeight=a};var eV=Oh;function tV(){_e.throwInstantiationError()}Object.defineProperties(tV.prototype,{name:{get:_e.throwInstantiationError},clock:{get:_e.throwInstantiationError},entities:{get:_e.throwInstantiationError},isLoading:{get:_e.throwInstantiationError},changedEvent:{get:_e.throwInstantiationError},errorEvent:{get:_e.throwInstantiationError},loadingEvent:{get:_e.throwInstantiationError},show:{get:_e.throwInstantiationError},clustering:{get:_e.throwInstantiationError}});tV.prototype.update=function(e){_e.throwInstantiationError()};tV.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Da=tV;function hp(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(hp.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 y_e=new h;hp.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,y_e);return QQ(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};hp.prototype.isScaledSpacePointVisible=function(e){return QQ(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var qst=new h;hp.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=qst,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),QQ(e,o,i)};hp.prototype.computeHorizonCullingPoint=function(e,t,n){return T_e(this._ellipsoid,e,t,n)};var x_e=te.clone(te.UNIT_SPHERE);hp.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=b_e(this._ellipsoid,n,x_e);return T_e(o,e,t,i)};hp.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return C_e(this._ellipsoid,e,t,n,i,o)};hp.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let a=b_e(this._ellipsoid,o,x_e);return C_e(a,e,t,n,i,r)};var Yst=[];hp.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=oe.subsample(e,t,0,Yst),o=ce.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var Xst=new h;function b_e(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,Xst);e=te.fromCartesian3(i,n)}return e}function T_e(e,t,n,i){l(i)||(i=new h);let o=S_e(e,t),r=0;for(let a=0,s=n.length;a<s;++a){let c=n[a],u=E_e(e,c,o);if(u<0)return;r=Math.max(r,u)}return v_e(o,r,i)}var nV=new h;function C_e(e,t,n,i,o,r){l(r)||(r=new h),i=i??3,o=o??h.ZERO;let a=S_e(e,t),s=0;for(let c=0,u=n.length;c<u;c+=i){nV.x=n[c]+o.x,nV.y=n[c+1]+o.y,nV.z=n[c+2]+o.z;let f=E_e(e,nV,a);if(f<0)return;s=Math.max(s,f)}return v_e(a,s,r)}function QQ(e,t,n){let i=t,o=n,r=h.subtract(e,i,y_e),a=-h.dot(r,i);return!(o<0?a>0:a>o&&a*a/h.magnitudeSquared(r)>o)}var Kst=new h,Qst=new h;function E_e(e,t,n){let i=e.transformPositionToScaledSpace(t,Kst),o=h.magnitudeSquared(i),r=Math.sqrt(o),a=h.divideByScalar(i,r,Qst);o=Math.max(1,o),r=Math.max(1,r);let s=h.dot(a,n),c=h.magnitude(h.cross(a,n,a)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(s*u-c*f)}function v_e(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var KQ=new h;function S_e(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,KQ),h.normalize(KQ,KQ))}var mp=hp;function Xr(e,t){e=e??G.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=kt.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=U.clone(e.color??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Vr.NONE}var w_e=Xr.SHOW_INDEX=0,P_e=Xr.POSITION_INDEX=1,$st=Xr.COLOR_INDEX=2,Jst=Xr.OUTLINE_COLOR_INDEX=3,Zst=Xr.OUTLINE_WIDTH_INDEX=4,ect=Xr.PIXEL_SIZE_INDEX=5,tct=Xr.SCALE_BY_DISTANCE_INDEX=6,nct=Xr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,ict=Xr.DISTANCE_DISPLAY_CONDITION_INDEX=8,oct=Xr.DISABLE_DEPTH_DISTANCE_INDEX=9,rct=Xr.SPLIT_DIRECTION_INDEX=10;Xr.NUMBER_OF_PROPERTIES=11;function lf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Xr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,lf(this,w_e))}},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),lf(this,P_e))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ut.equals(t,e)||(this._scaleByDistance=Ut.clone(e,t),lf(this,tct))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ut.equals(t,e)||(this._translucencyByDistance=Ut.clone(e,t),lf(this,nct))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,lf(this,ect))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),lf(this,$st))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),lf(this,Jst))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,lf(this,Zst))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){kt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=kt.clone(e,this._distanceDisplayCondition),lf(this,ict))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,lf(this,oct))}},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,lf(this,w_e))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,lf(this,rct))}}});Xr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Xr.prototype._getActualPosition=function(){return this._actualPosition};Xr.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),lf(this,P_e)};var I_e=new se;Xr._computeActualPosition=function(e,t,n){return t.mode===ie.SCENE3D?e:(R.multiplyByPoint(n,e,I_e),io.computeActualEllipsoidPosition(t,I_e))};var D_e=new se;Xr._computeScreenSpacePosition=function(e,t,n,i){let o=R.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,D_e),D_e);return io.worldToWindowCoordinates(n,o,i)};Xr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new z);let i=n.modelMatrix,o=Xr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Xr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,a=t.y-o,s=i,c=i;return l(n)||(n=new Je),n.x=r,n.y=a,n.width=s,n.height=c,n};Xr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&U.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&U.equals(this._outlineColor,e._outlineColor)&&Ut.equals(this._scaleByDistance,e._scaleByDistance)&&Ut.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Xr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Bs=Xr;var ob=`in vec4 v_color;
  10176. in vec4 v_outlineColor;
  10177. in float v_innerPercent;
  10178. in float v_pixelDistance;
  10179. in vec4 v_pickColor;
  10180. in float v_splitDirection;
  10181. void main()
  10182. {
  10183. if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
  10184. if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
  10185. // The distance in UV space from this fragment to the center of the point, at most 0.5.
  10186. float distanceToCenter = length(gl_PointCoord - vec2(0.5));
  10187. // The max distance stops one pixel shy of the edge to leave space for anti-aliasing.
  10188. float maxDistance = max(0.0, 0.5 - v_pixelDistance);
  10189. float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);
  10190. float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);
  10191. vec4 color = mix(v_outlineColor, v_color, innerAlpha);
  10192. color.a *= wholeAlpha;
  10193. // Fully transparent parts of the billboard are not pickable.
  10194. #if !defined(OPAQUE) && !defined(TRANSLUCENT)
  10195. if (color.a < 0.005) // matches 0/255 and 1/255
  10196. {
  10197. discard;
  10198. }
  10199. #else
  10200. // The billboard is rendered twice. The opaque pass discards translucent fragments
  10201. // and the translucent pass discards opaque fragments.
  10202. #ifdef OPAQUE
  10203. if (color.a < 0.995) // matches < 254/255
  10204. {
  10205. discard;
  10206. }
  10207. #else
  10208. if (color.a >= 0.995) // matches 254/255 and 255/255
  10209. {
  10210. discard;
  10211. }
  10212. #endif
  10213. #endif
  10214. out_FragColor = czm_gammaCorrect(color);
  10215. czm_writeLogDepth();
  10216. }
  10217. `;var iV=`uniform float u_maxTotalPointSize;
  10218. in vec4 positionHighAndSize;
  10219. in vec4 positionLowAndOutline;
  10220. in vec4 compressedAttribute0; // color, outlineColor, pick color
  10221. in vec4 compressedAttribute1; // show, translucency by distance, some free space
  10222. in vec4 scaleByDistance; // near, nearScale, far, farScale
  10223. in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection
  10224. out vec4 v_color;
  10225. out vec4 v_outlineColor;
  10226. out float v_innerPercent;
  10227. out float v_pixelDistance;
  10228. out vec4 v_pickColor;
  10229. out float v_splitDirection;
  10230. const float SHIFT_LEFT8 = 256.0;
  10231. const float SHIFT_RIGHT8 = 1.0 / 256.0;
  10232. void main()
  10233. {
  10234. // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition
  10235. // unpack attributes
  10236. vec3 positionHigh = positionHighAndSize.xyz;
  10237. vec3 positionLow = positionLowAndOutline.xyz;
  10238. float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
  10239. float totalSize = positionHighAndSize.w + outlineWidthBothSides;
  10240. float outlinePercent = outlineWidthBothSides / totalSize;
  10241. // Scale in response to browser-zoom.
  10242. totalSize *= czm_pixelRatio;
  10243. float temp = compressedAttribute1.x * SHIFT_RIGHT8;
  10244. float show = floor(temp);
  10245. #ifdef EYE_DISTANCE_TRANSLUCENCY
  10246. vec4 translucencyByDistance;
  10247. translucencyByDistance.x = compressedAttribute1.z;
  10248. translucencyByDistance.z = compressedAttribute1.w;
  10249. translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
  10250. temp = compressedAttribute1.y * SHIFT_RIGHT8;
  10251. translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
  10252. #endif
  10253. ///////////////////////////////////////////////////////////////////////////
  10254. vec4 color = czm_decodeRGB8(compressedAttribute0.x);
  10255. vec4 outlineColor = czm_decodeRGB8(compressedAttribute0.y);
  10256. vec4 pickColor = czm_decodeRGB8(compressedAttribute0.z);
  10257. vec4 alphaPacked = czm_decodeRGB8(compressedAttribute0.w);
  10258. color.a = alphaPacked.x;
  10259. outlineColor.a = alphaPacked.y;
  10260. pickColor.a = alphaPacked.z;
  10261. ///////////////////////////////////////////////////////////////////////////
  10262. vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  10263. vec4 positionEC = czm_modelViewRelativeToEye * p;
  10264. ///////////////////////////////////////////////////////////////////////////
  10265. #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
  10266. float lengthSq;
  10267. if (czm_sceneMode == czm_sceneMode2D)
  10268. {
  10269. // 2D camera distance is a special case
  10270. // treat all billboards as flattened to the z=0.0 plane
  10271. lengthSq = czm_eyeHeight2D.y;
  10272. }
  10273. else
  10274. {
  10275. lengthSq = dot(positionEC.xyz, positionEC.xyz);
  10276. }
  10277. #endif
  10278. #ifdef EYE_DISTANCE_SCALING
  10279. totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
  10280. #endif
  10281. if (totalSize > 0.0) {
  10282. // Add padding for anti-aliasing on both sides.
  10283. totalSize += 3.0;
  10284. }
  10285. // Clamp to max point size.
  10286. totalSize = min(totalSize, u_maxTotalPointSize);
  10287. // If size is too small, push vertex behind near plane for clipping.
  10288. // Note that context.minimumAliasedPointSize "will be at most 1.0".
  10289. if (totalSize < 1.0)
  10290. {
  10291. positionEC.xyz = vec3(0.0);
  10292. totalSize = 1.0;
  10293. }
  10294. float translucency = 1.0;
  10295. #ifdef EYE_DISTANCE_TRANSLUCENCY
  10296. translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
  10297. // push vertex behind near plane for clipping
  10298. if (translucency < 0.004)
  10299. {
  10300. positionEC.xyz = vec3(0.0);
  10301. }
  10302. #endif
  10303. #ifdef DISTANCE_DISPLAY_CONDITION
  10304. float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;
  10305. float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y;
  10306. if (lengthSq < nearSq || lengthSq > farSq) {
  10307. // push vertex behind camera to force it to be clipped
  10308. positionEC.xyz = vec3(0.0, 0.0, 1.0);
  10309. }
  10310. #endif
  10311. gl_Position = czm_projection * positionEC;
  10312. czm_vertexLogDepth();
  10313. #ifdef DISABLE_DEPTH_DISTANCE
  10314. float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z;
  10315. if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
  10316. {
  10317. disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
  10318. }
  10319. if (disableDepthTestDistance != 0.0)
  10320. {
  10321. // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
  10322. float zclip = gl_Position.z / gl_Position.w;
  10323. bool clipped = (zclip < -1.0 || zclip > 1.0);
  10324. if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
  10325. {
  10326. // Position z on the near plane.
  10327. gl_Position.z = -gl_Position.w;
  10328. #ifdef LOG_DEPTH
  10329. czm_vertexLogDepth(vec4(czm_currentFrustum.x));
  10330. #endif
  10331. }
  10332. }
  10333. #endif
  10334. v_color = color;
  10335. v_color.a *= translucency * show;
  10336. v_outlineColor = outlineColor;
  10337. v_outlineColor.a *= translucency * show;
  10338. v_innerPercent = 1.0 - outlinePercent;
  10339. v_pixelDistance = 2.0 / totalSize;
  10340. gl_PointSize = totalSize * show;
  10341. gl_Position *= show;
  10342. v_pickColor = pickColor;
  10343. v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
  10344. }
  10345. `;var act=Bs.SHOW_INDEX,ZQ=Bs.POSITION_INDEX,R_e=Bs.COLOR_INDEX,sct=Bs.OUTLINE_COLOR_INDEX,cct=Bs.OUTLINE_WIDTH_INDEX,lct=Bs.PIXEL_SIZE_INDEX,O_e=Bs.SCALE_BY_DISTANCE_INDEX,M_e=Bs.TRANSLUCENCY_BY_DISTANCE_INDEX,B_e=Bs.DISTANCE_DISPLAY_CONDITION_INDEX,uct=Bs.DISABLE_DEPTH_DISTANCE_INDEX,fct=Bs.SPLIT_DIRECTION_INDEX,e$=Bs.NUMBER_OF_PROPERTIES,tl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Cd(e){e=e??G.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(e$),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=e.show??!0,this.modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this._modelMatrix=R.clone(R.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Oi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=ie.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW,Oe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Cd.prototype,{length:{get:function(){return t$(this),this._pointPrimitives.length}}});function L_e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Cd.prototype.add=function(e){let t=new Bs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Cd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Cd.prototype.removeAll=function(){L_e(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function t$(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 a=n[o];a&&(a._index=r++,t.push(a))}e._pointPrimitives=t}}Cd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Cd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Cd.prototype.get=function(e){return t$(this),this._pointPrimitives[e]};Cd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<e$;++i){let o=n[i]===0?Oe.STATIC_DRAW:Oe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function dct(e,t,n){return new r_(e,[{index:tl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[ZQ]},{index:tl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[ZQ]},{index:tl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[R_e]},{index:tl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[M_e]},{index:tl.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[O_e]},{index:tl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[B_e]}],t)}var $Q=new Tn,oV=new U;function N_e(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ie.SCENE3D&&(ce.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Tn.fromCartesian(r,$Q);let a=i.pixelSize,s=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+s);let c=n[tl.positionHighAndSize],u=$Q.high;c(o,u.x,u.y,u.z,a);let f=n[tl.positionLowAndOutline],d=$Q.low;f(o,d.x,d.y,d.z,s)}var hct=256;function F_e(e,t,n,i){let o=i._index,r=i.color,a=i.outlineColor,s=i.getPickId(t).color;oV.red=r.alpha,oV.green=a.alpha,oV.blue=s.alpha;let c=n[tl.compressedAttribute0];c(o,on.encodeRGB8(r),on.encodeRGB8(a),on.encodeRGB8(s),on.encodeRGB8(oV))}function k_e(e,t,n,i){let o=i._index,r=0,a=1,s=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),a=D.clamp(a,0,1),a=a===1?255:a*255|0;let d=(f?1:0)*hct+a;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[tl.compressedAttribute1];g(o,d,p,r,s)}function z_e(e,t,n,i){let o=i._index,r=n[tl.scaleByDistance],a=0,s=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(a=f.near,s=f.nearValue,c=f.far,u=f.farValue,(s!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,a,s,c,u)}function U_e(e,t,n,i){let o=i._index,r=n[tl.distanceDisplayConditionAndDisableDepthAndSplitDirection],a=0,s=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(a=c.near,s=c.far,a*=a,s*=s,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),r(o,a,s,u,f)}function mct(e,t,n,i){N_e(e,t,n,i),F_e(e,t,n,i),k_e(e,t,n,i),z_e(e,t,n,i),U_e(e,t,n,i)}function JQ(e,t,n,i,o,r){let a;i.mode===ie.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Bs._computeActualPosition(f,i,o);l(d)&&(u._setActualPosition(d),r?s.push(d):ce.expand(a,d,a))}r&&ce.fromPoints(s,a)}function pct(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ie.SCENE3D&&!R.equals(r,e.modelMatrix)?(e._mode=n,R.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ie.SCENE3D||n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&JQ(e,i,i.length,t,r,!0)):n===ie.MORPHING?JQ(e,i,i.length,t,r,!0):(n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&JQ(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function gct(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var _ct=[];Cd.prototype.update=function(e){if(t$(this),!this.show)return;this._maxTotalPointSize=Mt.maximumAliasedPointSize,pct(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,a=this._createVertexArray,s,c=e.context,u=e.passes,f=u.pick;if(a||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let S=0;S<e$;++S)r[S]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=dct(c,n,this._buffersUsage),s=this._vaf.writers;for(let S=0;S<n;++S){let w=this._pointPrimitives[S];w._dirty=!1,mct(this,c,s,w)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let S=_ct;S.length=0,(r[ZQ]||r[cct]||r[lct])&&S.push(N_e),(r[R_e]||r[sct])&&S.push(F_e),(r[act]||r[M_e])&&S.push(k_e),r[O_e]&&S.push(z_e),(r[B_e]||r[uct]||r[fct])&&S.push(U_e);let w=S.length;if(s=this._vaf.writers,o/n>.1){for(let P=0;P<o;++P){let O=i[P];O._dirty=!1;for(let B=0;B<w;++B)S[B](this,c,s,O)}this._vaf.commit()}else{for(let P=0;P<o;++P){let O=i[P];O._dirty=!1;for(let B=0;B<w;++B)S[B](this,c,s,O);this._vaf.subCommit(O._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 d,p=R.IDENTITY;e.mode===ie.SCENE3D?(p=this.modelMatrix,d=ce.clone(this._baseVolumeWC,this._boundingVolume)):d=ce.clone(this._baseVolume2D,this._boundingVolume),gct(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Oi.OPAQUE||this._blendOption===Oi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Oi.TRANSLUCENT||this._blendOption===Oi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!1,blending:Jt.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,A;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new He({sources:[iV]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Oi.OPAQUE_AND_TRANSLUCENT&&(A=new He({defines:["OPAQUE"],sources:[ob]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:A,attributeLocations:tl}),A=new He({defines:["TRANSLUCENT"],sources:[ob]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:A,attributeLocations:tl})),this._blendOption===Oi.OPAQUE&&(A=new He({sources:[ob]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:A,attributeLocations:tl})),this._blendOption===Oi.TRANSLUCENT&&(A=new He({sources:[ob]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:A,attributeLocations:tl})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let y,x,b,T,E=e.commandList;if(u.render||f){let S=this._colorCommands,w=this._blendOption===Oi.OPAQUE,P=this._blendOption===Oi.OPAQUE_AND_TRANSLUCENT;y=this._vaf.va,x=y.length,S.length=x;let O=P?x*2:x;for(T=0;T<O;++T){let B=w||P&&T%2===0;b=S[T],l(b)||(b=S[T]=new tt),b.primitiveType=Re.POINTS,b.pass=B||!P?Ie.OPAQUE:Ie.TRANSLUCENT,b.owner=this;let L=P?Math.floor(T/2):T;b.boundingVolume=d,b.modelMatrix=p,b.shaderProgram=B?this._sp:this._spTranslucent,b.uniformMap=this._uniforms,b.vertexArray=y[L].va,b.renderState=B?this._rsOpaque:this._rsTranslucent,b.debugShowBoundingVolume=this.debugShowBoundingVolume,b.pickId="v_pickColor",E.push(b)}}};Cd.prototype.isDestroyed=function(){return!1};Cd.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(),L_e(this._pointPrimitives),fe(this)};var IP=Cd;var V_e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],n$=1,DP=8,Kr=new Uint32Array(96),RP=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");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!==n$)throw new Error(`Got v${o} data when expected v${n$}.`);let r=V_e[i&15];if(!r)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,a,r,void 0,t)}constructor(t,n=64,i=Float64Array,o=ArrayBuffer,r){if(isNaN(t)||t<0)throw new Error(`Unexpected 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 a=V_e.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-c%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${i}.`);if(r)this.data=r,this.ids=new this.IndexArrayType(r,DP,t),this.coords=new i(r,DP+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new o(DP+s+c+u);this.ids=new this.IndexArrayType(f,DP,t),this.coords=new i(f,DP+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(n$<<4)+a]),new Uint16Array(f,2,1)[0]=n,new Uint32Array(f,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 o$(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:a,nodeSize:s}=this;Kr[0]=0,Kr[1]=r.length-1,Kr[2]=0;let c=3,u=[];for(;c>0;){let f=Kr[--c],d=Kr[--c],p=Kr[--c];if(d-p<=s){for(let y=p;y<=d;y++){let x=a[2*y],b=a[2*y+1];x>=t&&x<=i&&b>=n&&b<=o&&u.push(r[y])}continue}let g=p+d>>1,m=a[2*g],A=a[2*g+1];m>=t&&m<=i&&A>=n&&A<=o&&u.push(r[g]),(f===0?t<=m:n<=A)&&(Kr[c++]=p,Kr[c++]=g-1,Kr[c++]=1-f),(f===0?i>=m:o>=A)&&(Kr[c++]=g+1,Kr[c++]=d,Kr[c++]=1-f)}return u}within(t,n,i){let o=[];return this.withinInto(t,n,i,o),o}withinInto(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:a,nodeSize:s}=this;Kr[0]=0,Kr[1]=r.length-1,Kr[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=Kr[--c],p=Kr[--c],g=Kr[--c];if(p-g<=s){for(let x=g;x<=p;x++)j_e(a[2*x],a[2*x+1],t,n)<=f&&(o[u++]=r[x]);continue}let m=g+p>>1,A=a[2*m],y=a[2*m+1];j_e(A,y,t,n)<=f&&(o[u++]=r[m]),(d===0?t-i<=A:n-i<=y)&&(Kr[c++]=g,Kr[c++]=m-1,Kr[c++]=1-d),(d===0?t+i>=A:n+i>=y)&&(Kr[c++]=m+1,Kr[c++]=p,Kr[c++]=1-d)}return u}};function o$(e,t,n,i,o,r){if(o-i<=n)return;let a=i+o>>1;G_e(e,t,a,i,o,r),o$(e,t,n,i,a-1,1-r),o$(e,t,n,a+1,o,1-r)}function G_e(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),A=Math.min(o,Math.floor(n+(u-f)*p/u+g));G_e(e,t,n,m,A,r)}let a=t[2*n+r],s=i,c=o;for(PP(e,t,i,n),t[2*o+r]>a&&PP(e,t,i,o);s<c;){for(PP(e,t,s,c),s++,c--;t[2*s+r]<a;)s++;for(;t[2*c+r]>a;)c--}t[2*i+r]===a?PP(e,t,i,c):(c++,PP(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function PP(e,t,n,i){i$(e,n,i),i$(t,2*n,2*i),i$(t,2*n+1,2*i+1)}function i$(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function j_e(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Mh(e){e=e??G.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=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 ye,this.show=e.show??!0}function H_e(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var Act=new Je;function W_e(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Bx.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=wo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Bs.getScreenSpaceBoundingBox(e,t,o)),H_e(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Y_e(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(r),s=Bx.getScreenSpaceBoundingBox(a,t,Act);H_e(s,n),o=Je.union(o,s,o)}return o}function yct(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Y_e(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 q_e(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 Y_e(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function r$(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let a=0;a<r;++a){let s=e.get(a);if(s.clusterShow=!1,!s.show||o._scene.mode===ie.SCENE3D&&!i.isPointVisible(s.position))continue;let c=o._clusterLabels&&l(s._labelCollection),u=o._clusterBillboards&&l(s.id._billboard),f=o._clusterPoints&&l(s.id._point);if(c&&(f||u))continue;let d=s.computeScreenSpacePosition(n);l(d)&&t.push({index:a,collection:e,clustered:!1,coord:d})}}var xct=new Je,bct=new Je,Tct=new Je;function Cct(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 a=e._clusterLabelCollection,s=e._clusterBillboardCollection,c=e._clusterPointCollection;l(a)?a.removeAll():a=e._clusterLabelCollection=new k0({scene:n}),l(s)?s.removeAll():s=e._clusterBillboardCollection=new dd({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new IP;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,A=n.ellipsoid,y=n.camera.positionWC,x=new mp(A,y),b=[];e._clusterLabels&&r$(i,b,n,x,e),e._clusterBillboards&&r$(o,b,n,x,e),e._clusterPoints&&r$(r,b,n,x,e);let T,E,S,w,P,O,B,L,_,C,v,I;if(b.length>0){let M=new RP(b.length,64,Float64Array);for(let N=0;N<b.length;++N)M.add(b[N].coord.x,b[N].coord.y);if(M.finish(),m<g)for(S=d.length,T=0;T<S;++T){let N=d[T];if(!x.isPointVisible(N.position))continue;let j=wo._computeScreenSpacePosition(R.IDENTITY,N.position,h.ZERO,z.ZERO,n);if(!l(j))continue;let k=1-m/g,V=N.width=N.width*k,F=N.height=N.height*k;V=Math.max(V,N.minimumWidth),F=Math.max(F,N.minimumHeight);let W=j.x-V*.5,q=j.y-F*.5,J=j.x+V,H=j.y+F;for(P=M.range(W,q,J,H),O=P.length,C=0,_=[],E=0;E<O;++E)B=P[E],L=b[B],L.clustered||(++C,v=L.collection,I=L.index,_.push(v.get(I).id));if(C>=f)for(q_e(N.position,C,_,e),p.push(N),E=0;E<O;++E)b[P[E]].clustered=!0}for(S=b.length,T=0;T<S;++T){let N=b[T];if(N.clustered)continue;N.clustered=!0,v=N.collection,I=N.index;let j=v.get(I);w=W_e(j,N.coord,u,e,xct);let k=Je.clone(w,bct);P=M.range(w.x,w.y,w.x+w.width,w.y+w.height),O=P.length;let V=h.clone(j.position);for(C=1,_=[j.id],E=0;E<O;++E)if(B=P[E],L=b[B],!L.clustered){let F=L.collection.get(L.index),W=W_e(F,L.coord,u,e,Tct);h.add(F.position,V,V),Je.union(k,W,k),++C,_.push(F.id)}if(C>=f){let F=h.multiplyByScalar(V,1/C,V);for(q_e(F,C,_,e),p.push({position:F,width:k.width,height:k.height,minimumWidth:w.width,minimumHeight:w.height}),E=0;E<O;++E)b[P[E]].clustered=!0}else yct(j,e)}}a.length===0&&(a.destroy(),e._clusterLabelCollection=void 0),s.length===0&&(s.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}Mh.prototype._initialize=function(e){this._scene=e;let t=Cct(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Mh.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}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function s$(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let a=this._collectionIndicesByEntity[o.id];if(l(a)||(a=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(a[i]))return r.get(a[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let s,c,u=this[n];u.length>0?(s=u.shift(),c=r.get(s)):(c=r.add(),s=r.length-1),a[i]=s;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function c$(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Mh.prototype.getLabel=s$("_labelCollection",k0,"_unusedLabelIndices","labelIndex");Mh.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,c$(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};Mh.prototype.getBillboard=s$("_billboardCollection",dd,"_unusedBillboardIndices","billboardIndex");Mh.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,c$(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};Mh.prototype.getPoint=s$("_pointCollection",IP,"_unusedPointIndices","pointIndex");Mh.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,c$(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function a$(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Ect(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,a$(e._labelCollection),a$(e._billboardCollection),a$(e._pointCollection))}Mh.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,Ect(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};Mh.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),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(),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 Ed=Mh;function l$(e){this._name=e,this._clock=void 0,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new Js(this),this._entityCluster=new Ed}Object.defineProperties(l$.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){Da.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}}});l$.prototype.update=function(e){return!0};var rV=l$;var X_e={};X_e.computePositions=function(e,t,n,i,o){let r=e*.5,a=-r,s=i+i,c=o?2*s:s,u=new Float64Array(c*3),f,d=0,p=0,g=o?s*3:0,m=o?(s+i)*3:i*3;for(f=0;f<i;f++){let A=f/i*D.TWO_PI,y=Math.cos(A),x=Math.sin(A),b=y*n,T=x*n,E=y*t,S=x*t;u[p+g]=b,u[p+g+1]=T,u[p+g+2]=a,u[p+m]=E,u[p+m+1]=S,u[p+m+2]=r,p+=3,o&&(u[d++]=b,u[d++]=T,u[d++]=a,u[d++]=E,u[d++]=S,u[d++]=r)}return u};var pv=X_e;var u$=new z,vct=new h,Sct=new h,wct=new h,Ict=new h;function ig(e){e=e??G.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??Ne.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Ne.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}ig.packedLength=Ne.packedLength+5;ig.pack=function(e,t,n){return n=n??0,Ne.pack(e._vertexFormat,t,n),n+=Ne.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var K_e=new Ne,gv={vertexFormat:K_e,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};ig.unpack=function(e,t,n){t=t??0;let i=Ne.unpack(e,t,K_e);t+=Ne.packedLength;let o=e[t++],r=e[t++],a=e[t++],s=e[t++],c=e[t];return l(n)?(n._vertexFormat=Ne.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=a,n._slices=s,n._offsetAttribute=c===-1?void 0:c,n):(gv.length=o,gv.topRadius=r,gv.bottomRadius=a,gv.slices=s,gv.offsetAttribute=c===-1?void 0:c,new ig(gv))};ig.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 a=r+r,s=r+a,c=a+a,u=pv.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,d=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,m,A=o.normal||o.tangent||o.bitangent;if(A){let P=o.tangent||o.bitangent,O=0,B=0,L=0,_=Math.atan2(i-n,t),C=vct;C.z=Math.sin(_);let v=Math.cos(_),I=wct,M=Sct;for(m=0;m<r;m++){let N=m/r*D.TWO_PI,j=v*Math.cos(N),k=v*Math.sin(N);A&&(C.x=j,C.y=k,P&&(I=h.normalize(h.cross(h.UNIT_Z,C,I),I)),o.normal&&(d[O++]=C.x,d[O++]=C.y,d[O++]=C.z,d[O++]=C.x,d[O++]=C.y,d[O++]=C.z),o.tangent&&(p[B++]=I.x,p[B++]=I.y,p[B++]=I.z,p[B++]=I.x,p[B++]=I.y,p[B++]=I.z),o.bitangent&&(M=h.normalize(h.cross(C,I,M),M),g[L++]=M.x,g[L++]=M.y,g[L++]=M.z,g[L++]=M.x,g[L++]=M.y,g[L++]=M.z))}for(m=0;m<r;m++)o.normal&&(d[O++]=0,d[O++]=0,d[O++]=-1),o.tangent&&(p[B++]=1,p[B++]=0,p[B++]=0),o.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(m=0;m<r;m++)o.normal&&(d[O++]=0,d[O++]=0,d[O++]=1),o.tangent&&(p[B++]=1,p[B++]=0,p[B++]=0),o.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let y=12*r-12,x=Ue.createTypedArray(c,y),b=0,T=0;for(m=0;m<r-1;m++)x[b++]=T,x[b++]=T+2,x[b++]=T+3,x[b++]=T,x[b++]=T+3,x[b++]=T+1,T+=2;for(x[b++]=a-2,x[b++]=0,x[b++]=1,x[b++]=a-2,x[b++]=1,x[b++]=a-1,m=1;m<r-1;m++)x[b++]=a+m+1,x[b++]=a+m,x[b++]=a;for(m=1;m<r-1;m++)x[b++]=s,x[b++]=s+m,x[b++]=s+m+1;let E=0;if(o.st){let P=Math.max(n,i);for(m=0;m<c;m++){let O=h.fromArray(u,m*3,Ict);f[E++]=(O.x+P)/(2*P),f[E++]=(O.y+P)/(2*P)}}let S=new _n;o.position&&(S.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(S.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:d})),o.tangent&&(S.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(S.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(S.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),u$.x=t*.5,u$.y=Math.max(i,n);let w=new ce(h.ZERO,z.magnitude(u$));if(l(e._offsetAttribute)){t=u.length;let P=e._offsetAttribute===ln.NONE?0:1,O=new Uint8Array(t/3).fill(P);S.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return new At({attributes:S,indices:x,primitiveType:Re.TRIANGLES,boundingSphere:w,offsetAttribute:e._offsetAttribute})};var f$;ig.getUnitCylinder=function(){return l(f$)||(f$=ig.createGeometry(new ig({topRadius:1,bottomRadius:1,length:1,vertexFormat:Ne.POSITION_ONLY}))),f$};var aV=ig;var d$=new z;function _v(e){e=e??G.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(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"}_v.packedLength=6;_v.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var rb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};_v.unpack=function(e,t,n){t=t??0;let i=e[t++],o=e[t++],r=e[t++],a=e[t++],s=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=a,n._numberOfVerticalLines=s,n._offsetAttribute=c===-1?void 0:c,n):(rb.length=i,rb.topRadius=o,rb.bottomRadius=r,rb.slices=a,rb.numberOfVerticalLines=s,rb.offsetAttribute=c===-1?void 0:c,new _v(rb))};_v.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 a=o*2,s=pv.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let A=Math.min(r,o);u=Math.round(o/A),c+=A}let f=Ue.createTypedArray(a,c*2),d=0,p;for(p=0;p<o-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+o,f[d++]=p+1+o;if(f[d++]=o-1,f[d++]=0,f[d++]=o+o-1,f[d++]=o,r>0)for(p=0;p<o;p+=u)f[d++]=p,f[d++]=p+o;let g=new _n;g.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s}),d$.x=t*.5,d$.y=Math.max(i,n);let m=new ce(h.ZERO,z.magnitude(d$));if(l(e._offsetAttribute)){t=s.length;let A=e._offsetAttribute===ln.NONE?0:1,y=new Uint8Array(t/3).fill(A);g.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}return new At({attributes:g,indices:f,primitiveType:Re.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var sV=_v;var Q_e=h.ZERO,$_e=new h,Dct=new h,J_e=new U;function Pct(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 uf(e,t){Ci.call(this,{entity:e,scene:t,geometryOptions:new Pct(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(uf.prototype=Object.create(Ci.prototype),uf.prototype.constructor=uf);Object.defineProperties(uf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});uf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=qn.fromDistanceDisplayCondition(o),a={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Wt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,J_e)),l(s)||(s=U.WHITE),a.color=Yt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Q_e,$_e))),new Bt({id:t,geometry:new aV(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:a})};uf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,J_e),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:qn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Q_e,$_e))),new Bt({id:t,geometry:new sV(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};uf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};uf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Ci.prototype._isHidden.call(this,e,t)};uf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};uf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,nt.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Wt?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Qe.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Qe.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Qe.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,Qe.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Qe.MINIMUM_VALUE),i.offsetAttribute=n!==nt.NONE?ln.ALL:void 0};uf.prototype._onEntityPropertyChanged=g_;uf.DynamicGeometryUpdater=Av;function Av(e,t,n){Ti.call(this,e,t,n)}l(Object.create)&&(Av.prototype=Object.create(Ti.prototype),Av.prototype.constructor=Av);Av.prototype._isHidden=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(e.position,n,Dct);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ti.prototype._isHidden.call(this,e,t,n)};Av.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,nt.NONE),o=this._options;o.length=X.getValueOrUndefined(t.length,n),o.topRadius=X.getValueOrUndefined(t.topRadius,n),o.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),o.slices=X.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==nt.NONE?ln.ALL:void 0};var cV=uf;var Z_e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(Z_e);var Pa=Z_e;var eAe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(eAe);var Bo=eAe;var tAe={NONE:0,HOLD:1,EXTRAPOLATE:2};Object.freeze(tAe);var vd=tAe;var nAe=Na(ju(),1);function Rct(e){let t=new nAe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var xA=Rct;var Oct=D.factorial;function h$(e,t,n,i,o,r){let a=0,s,c,u;if(i>0){for(c=0;c<o;c++){for(s=!1,u=0;u<r.length&&!s;u++)c===r[u]&&(s=!0);s||(r.push(c),a+=h$(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return a}for(a=1,c=0;c<o;c++){for(s=!1,u=0;u<r.length&&!s;u++)c===r[u]&&(s=!0);s||(a*=e-n[t[c]])}return a}var lV={type:"Hermite"};lV.getRequiredDataPoints=function(e,t){return t=t??0,Math.max(Math.floor((e+1)/(t+1)),2)};lV.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,a,s,c,u,f,d=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let y=new Array(d);for(p[r]=y,a=0;a<d;a++)y[a]=[]}let g=d,m=new Array(g);for(r=0;r<g;r++)m[r]=r;let A=d-1;for(c=0;c<i;c++){for(a=0;a<g;a++)f=m[a]*i+c,p[c][0].push(n[f]);for(r=1;r<g;r++){let y=!1;for(a=0;a<g-r;a++){let x=t[m[a]],b=t[m[a+r]],T;b-x<=0?(f=m[a]*i+i*r+c,T=n[f],p[c][r].push(T/Oct(r))):(T=p[c][r-1][a+1]-p[c][r-1][a],p[c][r].push(T/(b-x))),y=y||T!==0}y||(A=r-1)}}for(s=0,u=0;s<=u;s++)for(r=s;r<=A;r++){let y=h$(e,m,t,s,r,[]);for(c=0;c<i;c++){let x=p[c][r][0];o[c+s*i]+=x*y}}return o};var Mct=[];lV.interpolate=function(e,t,n,i,o,r,a){let s=i*(r+1);l(a)||(a=new Array(s));for(let x=0;x<s;x++)a[x]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let x=0;x<o+1;x++)u[f*(o+1)+x]=f;let d=u.length,p=Mct,g=Bct(p,u,t,n,i,o),m=[],A=d*(d+1)/2,y=Math.min(g,r);for(let x=0;x<=y;x++)for(f=x;f<=g;f++){m.length=0;let b=h$(e,u,t,x,f,m),T=Math.floor(f*(1-f)/2)+d*f;for(let E=0;E<i;E++){let S=Math.floor(E*A),w=p[S+T];a[E+x*i]+=w*b}}return a};function Bct(e,t,n,i,o,r){let a,s,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<o;d++){let p=Math.floor(d*f);for(a=0;a<u;a++)s=t[a]*o*(r+1)+d,e[p+a]=i[s];for(let g=1;g<u;g++){let m=0,A=Math.floor(g*(1-g)/2)+u*g,y=!1;for(a=0;a<u-g;a++){let x=n[t[a]],b=n[t[a+g]],T,E;if(b-x<=0)s=t[a]*o*(r+1)+o*g+d,T=i[s],E=T/D.factorial(g),e[p+A+m]=E,m++;else{let S=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+S+a+1]-e[p+S+a],E=T/(b-x),e[p+A+m]=E,m++}y=y||T!==0}y&&(c=Math.max(c,g))}}return c}var uV=lV;var m$={type:"Lagrange"};m$.getRequiredDataPoints=function(e){return Math.max(e+1,2)};m$.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,a,s=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<s;r++){let c=1;for(a=0;a<s;a++)if(a!==r){let u=t[r]-t[a];c*=(e-t[a])/u}for(a=0;a<i;a++)o[a]+=c*n[r*i+a]}return o};var fV=m$;var p$={type:"Linear"};p$.getRequiredDataPoints=function(e){return 2};p$.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,a,s,c=t[0],u=t[1];for(r=0;r<i;r++)a=n[r],s=n[r+i],o[r]=((s-a)*e+u*a-c*s)/(u-c);return o};var yv=p$;function nl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}nl.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new nl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};nl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new nl(e.clock,e.cone,e.magnitude)};nl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new nl(e.clock,e.cone,1)};nl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};nl.equalsEpsilon=function(e,t,n){return n=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};nl.prototype.equals=function(e){return nl.equals(this,e)};nl.prototype.clone=function(e){return nl.clone(this,e)};nl.prototype.equalsEpsilon=function(e,t){return nl.equalsEpsilon(this,e,t)};nl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var dV=nl;var jP=Na(ju(),1);var g$;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?g$=function(){return performance.now()}:g$=function(){return Date.now()};var zi=g$;function _$(e){e=e??G.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=Q.clone(t):l(n)?t=Q.clone(n):l(i)?t=Q.addDays(i,-1,new Q):t=Q.now(),l(n)?n=Q.clone(n):n=Q.clone(t),l(i)?i=Q.clone(i):i=Q.addDays(n,1,new Q),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??Pa.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new ye,this.onStop=new ye,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=zi(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Bo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(_$.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Q.equals(this._currentTime,e)||(this._clockStep===Bo.SYSTEM_CLOCK&&(this._clockStep=Bo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Bo.SYSTEM_CLOCK&&(this._clockStep=Bo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Bo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=Q.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Bo.SYSTEM_CLOCK&&(this._clockStep=Bo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});_$.prototype.tick=function(){let e=zi(),t=Q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Bo.SYSTEM_CLOCK)t=Q.now(t);else{let i=this._multiplier;if(n===Bo.TICK_DEPENDENT)t=Q.addSeconds(t,i,t);else{let s=e-this._lastSystemTime;t=Q.addSeconds(t,i*(s/1e3),t)}let o=this.clockRange,r=this.startTime,a=this.stopTime;if(o===Pa.CLAMPED)Q.lessThan(t,r)?t=Q.clone(r,t):Q.greaterThan(t,a)&&(t=Q.clone(a,t),this.onStop.raiseEvent(this));else if(o===Pa.LOOP_STOP)for(Q.lessThan(t,r)&&(t=Q.clone(r,t));Q.greaterThan(t,a);)t=Q.addSeconds(r,Q.secondsDifference(t,a),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var pp=_$;function ab(){this._definitionChanged=new ye,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(ab.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:su("startTime"),stopTime:su("stopTime"),currentTime:su("currentTime"),clockRange:su("clockRange"),clockStep:su("clockStep"),multiplier:su("multiplier")});ab.prototype.clone=function(e){return l(e)||(e=new ab),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};ab.prototype.equals=function(e){return this===e||l(e)&&Q.equals(this.startTime,e.startTime)&&Q.equals(this.stopTime,e.stopTime)&&Q.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};ab.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};ab.prototype.getValue=function(e){return l(e)||(e=new pp),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var gp=ab;var Lct=U.WHITE,Nct=.1,Fct=new z(8,8),kct=new z(0,0),zct=new z(1,1);function xv(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new ye,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(xv.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:pe("color"),cellAlpha:pe("cellAlpha"),lineCount:pe("lineCount"),lineThickness:pe("lineThickness"),lineOffset:pe("lineOffset")});xv.prototype.getType=function(e){return"Grid"};var Uct=new Q;xv.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Uct)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Lct,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,Nct),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,Fct,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,zct,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,kct,t.lineOffset),t};xv.prototype.equals=function(e){return this===e||e instanceof xv&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var OP=xv;function bv(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(bv.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:pe("color")});bv.prototype.getType=function(e){return"PolylineArrow"};var Vct=new Q;bv.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Vct)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};bv.prototype.equals=function(e){return this===e||e instanceof bv&&X.equals(this._color,e._color)};var MP=bv;var jct=U.WHITE,Gct=U.TRANSPARENT,Hct=16,Wct=255;function Tv(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new ye,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(Tv.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:pe("color"),gapColor:pe("gapColor"),dashLength:pe("dashLength"),dashPattern:pe("dashPattern")});Tv.prototype.getType=function(e){return"PolylineDash"};var qct=new Q;Tv.prototype.getValue=function(e,t){return l(e)||(e=Q.now(qct)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,jct,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,Gct,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,Hct,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,Wct,t.dashPattern),t};Tv.prototype.equals=function(e){return this===e||e instanceof Tv&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var BP=Tv;var Yct=U.WHITE,Xct=.25,Kct=1;function Cv(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new ye,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(Cv.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:pe("color"),glowPower:pe("glowPower"),taperPower:pe("taperPower")});Cv.prototype.getType=function(e){return"PolylineGlow"};var Qct=new Q;Cv.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Qct)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Yct,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,Xct,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,Kct,t.taperPower),t};Cv.prototype.equals=function(e){return this===e||e instanceof Cv&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var LP=Cv;var $ct=U.WHITE,Jct=U.BLACK,Zct=1;function Ev(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new ye,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(Ev.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:pe("color"),outlineColor:pe("outlineColor"),outlineWidth:pe("outlineWidth")});Ev.prototype.getType=function(e){return"PolylineOutline"};var elt=new Q;Ev.prototype.getValue=function(e,t){return l(e)||(e=Q.now(elt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,$ct,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,Jct,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,Zct),t};Ev.prototype.equals=function(e){return this===e||e instanceof Ev&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var sb=Ev;function og(e,t){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new Yr,this._referenceFrame=t??Ni.FIXED,this.setValue(e)}Object.defineProperties(og.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var tlt=new Q;og.prototype.getValue=function(e,t){return l(e)||(e=Q.now(tlt)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};og.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,a=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[a]=c,a++),r++}return n.length=a,n};og.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,og.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};og.prototype.equals=function(e){return this===e||e instanceof og&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};og.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var bA=og;function TA(e){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new Yr,this.setValue(e)}Object.defineProperties(TA.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var nlt=new Q;TA.prototype.getValue=function(e,t){l(e)||(e=Q.now(nlt));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 s=this._value[o].getValue(e,t[o]);l(s)&&(t[r]=s,r++),o++}return t.length=r,t};TA.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,TA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};TA.prototype.equals=function(e){return this===e||e instanceof TA&&X.arrayEquals(this._value,e._value)};TA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var NP=TA;function cb(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(ff.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 ff(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new ye,e.collectionChanged.addEventListener(ff.prototype._onCollectionChanged,this)}Object.defineProperties(ff.prototype,{isConstant:{get:function(){return X.isConstant(cb(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=cb(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 cb(this)}}});ff.fromString=function(e,t){let n,i=[],o=!0,r=!1,a="";for(let s=0;s<t.length;++s){let c=t.charAt(s);r?(a+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=a,o=!1,a=""):!o&&c==="."?(i.push(a),a=""):a+=c}return i.push(a),new ff(e,n,i)};var ilt=new Q;ff.prototype.getValue=function(e,t){let n=cb(this);return l(e)||(e=Q.now(ilt)),l(n)?n.getValue(e,t):void 0};ff.prototype.getValueInReferenceFrame=function(e,t,n){let i=cb(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};ff.prototype.getType=function(e){let t=cb(this);return l(t)?t.getType(e):void 0};ff.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};ff.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};ff.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(ff.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=cb(this),l(i)&&this._definitionChanged.raiseEvent(this))};var CA=ff;var olt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let o;for(let r=0,a=n-t+1;r<a;r++){let s=e[t+r];r===0||Math.abs(o-s)<Math.PI?i[r]=s:i[r]=s-D.TWO_PI,o=s}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+D.TWO_PI:o}},Bh=olt;var iAe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function oAe(e,t,n){let i,o=e.length,r=n.length,a=o+r;if(e.length=a,o!==t){let s=o-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;i<r;i++)e[t++]=n[i]}function rAe(e,t){return e instanceof Q?e:typeof e=="string"?Q.fromIso8601(e):Q.addSeconds(t,e,new Q)}var A$=[],y$=[];function hV(e,t,n,i,o){let r=0,a,s,c,u,f,d;for(;r<i.length;){f=rAe(i[r],e),c=Ao(t,f,Q.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*o,s=void 0,d=t[c];r<i.length&&(f=rAe(i[r],e),!(l(s)&&Q.compare(s,f)>=0||l(d)&&Q.compare(f,d)>=0));){for(A$[p++]=f,r=r+1,a=0;a<o;a++)y$[g++]=i[r],r=r+1;s=f}p>0&&(y$.length=g,oAe(n,u,y$),A$.length=p,oAe(t,c,A$))}else{for(a=0;a<o;a++)r++,n[c*o+a]=i[r];r++}}}function Sd(e,t){let n=e;n===Number&&(n=iAe);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,a;if(l(t)){let s=t.length;a=new Array(s);for(let c=0;c<s;c++){let u=t[c];u===Number&&(u=iAe);let f=u.packedLength;i+=f,o+=u.packedInterpolationLength??f,a[c]=u}r=s}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=yv,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 ye,this._derivativeTypes=t,this._innerDerivativeTypes=a,this._inputOrder=r,this._forwardExtrapolationType=vd.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=vd.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Sd.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 rlt=new Q;Sd.prototype.getValue=function(e,t){l(e)||(e=Q.now(rlt));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,a=this._values,s=Ao(n,e,Q.compare);if(s<0){if(s=~s,s===0){let E=n[s];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===vd.NONE||o!==0&&Q.secondsDifference(E,e)>o)return;if(this._backwardExtrapolationType===vd.HOLD)return r.unpack(a,0,t)}if(s>=i){s=i-1;let E=n[s];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===vd.NONE||o!==0&&Q.secondsDifference(e,E)>o)return;if(this._forwardExtrapolationType===vd.HOLD)return s=i-1,r.unpack(a,s*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let E=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);E!==this._numberOfPoints&&(this._numberOfPoints=E,c.length=E,u.length=E*d)}let g=this._numberOfPoints-1;if(g<1)return;let m=0,A=i-1;if(A-m+1>=g+1){let E=s-(g/2|0)-1;E<m&&(E=m);let S=E+g;S>A&&(S=A,E=S-g,E<m&&(E=m)),m=E,A=S}let x=A-m+1;for(let E=0;E<x;++E)c[E]=Q.secondsDifference(n[m+E],n[A]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(a,m,A,u);else{let E=0,S=this._packedLength,w=m*S,P=(A+1)*S;for(;w<P;)u[E]=a[w],w++,E++}let b=Q.secondsDifference(e,n[A]),T;if(p===0||!l(f.interpolate))T=f.interpolateOrderZero(b,c,u,d,this._interpolationResult);else{let E=Math.floor(d/(p+1));T=f.interpolate(b,c,u,E,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(T,a,m,A,t):r.unpack(T,0,t)}return r.unpack(a,s*this._packedLength,t)};Sd.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))};Sd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,a=[];if(a.push(e),r.pack(t,a,a.length),o){let s=i.length;for(let c=0;c<s;c++)i[c].pack(n[c],a,a.length)}hV(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Sd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,a=e.length,s=[];for(let c=0;c<a;c++)if(s.push(e[c]),r.pack(t[c],s,s.length),o){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],s,s.length)}hV(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Sd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Sd.prototype.addSamplesPackedArray=function(e,t){hV(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Sd.prototype.removeSample=function(e){let t=Ao(this._times,e,Q.compare);return t<0?!1:(aAe(this,t,1),!0)};function aAe(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)}Sd.prototype.removeSamples=function(e){let t=this._times,n=Ao(t,e.start,Q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Ao(t,e.stop,Q.compare);i<0?i=~i:e.isStopIncluded&&++i,aAe(this,n,i-n)};Sd.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,a;if(n){if(a=t.length,a!==i.length)return!1;for(r=0;r<a;r++)if(t[r]!==i[r])return!1}let s=this._times,c=e._times;if(a=s.length,a!==c.length)return!1;for(r=0;r<a;r++)if(!Q.equals(s[r],c[r]))return!1;let u=this._values,f=e._values;for(a=u.length,r=0;r<a;r++)if(u[r]!==f[r])return!1;return!0};Sd._mergeNewSamples=hV;var wd=Sd;function Id(e,t){t=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 wd(h,n),this._definitionChanged=new ye,this._referenceFrame=e??Ni.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Id.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 alt=new Q;Id.prototype.getValue=function(e,t){return l(e)||(e=Q.now(alt)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};Id.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Dm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Id.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Id.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Id.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Id.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Id.prototype.removeSample=function(e){return this._property.removeSample(e)};Id.prototype.removeSamples=function(e){this._property.removeSamples(e)};Id.prototype.equals=function(e){return this===e||e instanceof Id&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Tc=Id;var sAe={HORIZONTAL:0,VERTICAL:1};Object.freeze(sAe);var _p=sAe;var slt=_p.HORIZONTAL,clt=U.WHITE,llt=U.BLACK,ult=0,flt=1;function vv(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new ye,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(vv.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:pe("orientation"),evenColor:pe("evenColor"),oddColor:pe("oddColor"),offset:pe("offset"),repeat:pe("repeat")});vv.prototype.getType=function(e){return"Stripe"};var dlt=new Q;vv.prototype.getValue=function(e,t){return l(e)||(e=Q.now(dlt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,slt)===_p.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,clt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,llt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,ult),t.repeat=X.getValueOrDefault(this._repeat,e,flt),t};vv.prototype.equals=function(e){return this===e||e instanceof vv&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var FP=vv;function EA(e){this._definitionChanged=new ye,this._intervals=new Ia,this._intervals.changedEvent.addEventListener(EA.prototype._intervalsChanged,this),this._referenceFrame=e??Ni.FIXED}Object.defineProperties(EA.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 hlt=new Q;EA.prototype.getValue=function(e,t){return l(e)||(e=Q.now(hlt)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};EA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Dm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};EA.prototype.equals=function(e){return this===e||e instanceof EA&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};EA.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var vA=EA;function lb(){this._definitionChanged=new ye,this._intervals=new Ia,this._intervals.changedEvent.addEventListener(lb.prototype._intervalsChanged,this)}Object.defineProperties(lb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var mlt=new Q;lb.prototype.getValue=function(e,t){l(e)||(e=Q.now(mlt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};lb.prototype.equals=function(e){return this===e||e instanceof lb&&this._intervals.equals(e._intervals,X.equals)};lb.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var SA=lb;function Sv(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new ye,this._normalize=t??!0,this.position=e}Object.defineProperties(Sv.prototype,{isConstant:{get:function(){return X.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 plt=new h,cAe=new h,lAe=new Q,glt=new Q,x$=1/60;Sv.prototype.getValue=function(e,t){return this._getValue(e,t)};Sv.prototype._getValue=function(e,t,n){l(e)||(e=Q.now(glt)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,plt),r=i.getValue(Q.addSeconds(e,x$,lAe),cAe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-x$,lAe),cAe),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let a=h.subtract(r,o,t);return this._normalize?h.normalize(a,t):h.divideByScalar(a,x$,t)};Sv.prototype.equals=function(e){return this===e||e instanceof Sv&&X.equals(this._position,e._position)};var wA=Sv;function kP(e,t){this._velocityVectorProperty=new wA(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new ye,this.ellipsoid=t??te.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(kP.prototype,{isConstant:{get:function(){return X.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 uAe=new h,_lt=new h,fAe=new $,Alt=new Q;kP.prototype.getValue=function(e,t){l(e)||(e=Q.now(Alt));let n=this._velocityVectorProperty._getValue(e,_lt,uAe);if(l(n))return pt.rotationMatrixFromPositionVelocity(uAe,n,this._ellipsoid,fAe),Le.fromRotationMatrix(fAe,t)};kP.prototype.equals=function(e){return this===e||e instanceof kP&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var mV=kP;var rg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};rg.validate=function(e){return e===rg.COMPLETE||e===rg.BELOW_ELLIPSOID_HORIZON||e===rg.ABOVE_ELLIPSOID_HORIZON};rg.toString=function(e){switch(e){case rg.COMPLETE:return"COMPLETE";case rg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case rg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new _e("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var zP=rg;function IA(){}IA.packedLength=h.packedLength;IA.unpack=h.unpack;IA.pack=h.pack;var b$;function UP(e,t){return t[0]==="#"&&(t=b$+t),CA.fromString(e,t)}function dAe(e,t,n){if(l(n.reference))return UP(t,n.reference);if(l(n.velocityReference)){let i=UP(t,n.velocityReference);switch(e){case h:case IA:return new wA(i,e===IA);case Le:return new mV(i)}}throw new re(`${JSON.stringify(n)} is not valid CZML.`)}function ylt(e,t){return new Mm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Zi=new h,zl=new dV,il=new de,ub=new wn,pV=new Le;function xlt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===U.packedLength)return[U.byteToFloat(n[0]),U.byteToFloat(n[1]),U.byteToFloat(n[2]),U.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=U.byteToFloat(n[o+1]),t[o+2]=U.byteToFloat(n[o+2]),t[o+3]=U.byteToFloat(n[o+3]),t[o+4]=U.byteToFloat(n[o+4]);return t}function hAe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function blt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===oe.packedLength)return[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=D.toRadians(n[o+1]),t[o+2]=D.toRadians(n[o+2]),t[o+3]=D.toRadians(n[o+3]),t[o+4]=D.toRadians(n[o+4]);return t}function Tlt(e){let t=e.length;if(zl.magnitude=1,t===2)return zl.clock=e[0],zl.cone=e[1],h.fromSpherical(zl,Zi),[Zi.x,Zi.y,Zi.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],zl.clock=e[i+1],zl.cone=e[i+2],h.fromSpherical(zl,Zi),n[o+1]=Zi.x,n[o+2]=Zi.y,n[o+3]=Zi.z;return n}function Clt(e){let t=e.length;if(t===3)return zl.clock=e[0],zl.cone=e[1],zl.magnitude=e[2],h.fromSpherical(zl,Zi),[Zi.x,Zi.y,Zi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],zl.clock=e[i+1],zl.cone=e[i+2],zl.magnitude=e[i+3],h.fromSpherical(zl,Zi),n[i+1]=Zi.x,n[i+2]=Zi.y,n[i+3]=Zi.z;return n}function Elt(e){let t=e.length;if(t===3)return il.longitude=e[0],il.latitude=e[1],il.height=e[2],te.default.cartographicToCartesian(il,Zi),[Zi.x,Zi.y,Zi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],il.longitude=e[i+1],il.latitude=e[i+2],il.height=e[i+3],te.default.cartographicToCartesian(il,Zi),n[i+1]=Zi.x,n[i+2]=Zi.y,n[i+3]=Zi.z;return n}function vlt(e){let t=e.length;if(t===3)return il.longitude=D.toRadians(e[0]),il.latitude=D.toRadians(e[1]),il.height=e[2],te.default.cartographicToCartesian(il,Zi),[Zi.x,Zi.y,Zi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],il.longitude=D.toRadians(e[i+1]),il.latitude=D.toRadians(e[i+2]),il.height=e[i+3],te.default.cartographicToCartesian(il,Zi),n[i+1]=Zi.x,n[i+2]=Zi.y,n[i+3]=Zi.z;return n}function T$(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 Tlt(o);let r=e.spherical;if(l(r))return Clt(r);let a=e.cartographicRadians;if(l(a))return Elt(a);let s=e.cartographicDegrees;if(l(s))return vlt(s);throw new re(`${JSON.stringify(e)} is not a valid CZML interval.`)}function mAe(e,t){h.unpack(e,t,Zi),h.normalize(Zi,Zi),h.pack(Zi,e,t)}function Slt(e){let t=T$(e);if(t.length===3)return mAe(t,0),t;for(let n=1;n<t.length;n+=4)mAe(t,n);return t}function pAe(e,t){Le.unpack(e,t,pV),Le.normalize(pV,pV),Le.pack(pV,e,t)}function wlt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return pAe(t,0),t;for(let n=1;n<t.length;n+=5)pAe(t,n)}return t}function gAe(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")?Je:e.hasOwnProperty("cartesian2")?z:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?IA:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?U:e.hasOwnProperty("arcType")?rn:e.hasOwnProperty("classificationType")?Yn:e.hasOwnProperty("colorBlendMode")?Pl:e.hasOwnProperty("cornerType")?Ji:e.hasOwnProperty("heightReference")?nt:e.hasOwnProperty("horizontalOrigin")?Bi:e.hasOwnProperty("date")?Q:e.hasOwnProperty("labelStyle")?_r:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Ut:e.hasOwnProperty("distanceDisplayCondition")?kt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("shadowMode")?vn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?_p:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?oe:e.hasOwnProperty("uri")?jP.default:e.hasOwnProperty("verticalOrigin")?zn:Object}function Ilt(e,t,n){switch(e){case rn:return rn[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case Je:return t.boundingRectangle;case z:return t.cartesian2;case h:return T$(t);case IA:return Slt(t);case U:return xlt(t);case Yn:return Yn[t.classificationType??t];case Pl:return Pl[t.colorBlendMode??t];case Ji:return Ji[t.cornerType??t];case nt:return nt[t.heightReference??t];case Bi:return Bi[t.horizontalOrigin??t];case Image:return hAe(t,n);case Q:return Q.fromIso8601(t.date??t);case _r:return _r[t.labelStyle??t];case Number:return t.number??t;case Ut:return t.nearFarScalar;case kt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Le:return wlt(t);case Bh:return t.number??t;case zP:return zP[t.portionToDisplay??t];case vn:return vn[t.shadowMode??t.shadows??t];case String:return t.string??t;case _p:return _p[t.stripeOrientation??t];case oe:return blt(t);case jP.default:return hAe(t,n);case zn:return zn[t.verticalOrigin??t];default:throw new re(`Unknown CzmlDataSource interval type: ${e}`)}}var Dlt={HERMITE:uV,LAGRANGE:fV,LINEAR:yv};function gV(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:Dlt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=vd[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let a=e.backwardExtrapolationType;l(a)&&(t.backwardExtrapolationType=vd[a]);let s=e.backwardExtrapolationDuration;l(s)&&(t.backwardExtrapolationDuration=s)}var _Ae={iso8601:void 0};function Pr(e){if(l(e))return _Ae.iso8601=e,wn.fromIso8601(_Ae)}function C$(e){let t=Qe.MAXIMUM_INTERVAL.clone();return t.data=e,t}function AAe(e){let t=new Nl;return t.intervals.addInterval(C$(e)),t}function yAe(e){let t=new bc(e.referenceFrame);return t.intervals.addInterval(C$(e)),t}function _V(e,t,n,i,o,r,a){let s=Pr(i.interval);l(o)&&(l(s)?s=wn.intersect(s,o,ub):s=o);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(s)&&!s.equals(Qe.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return PAe(t[n],s)}let g=!1;if(d){if(u=Ilt(e,i,r),!l(u))return;c=e.packedLength??1,f=u.length??1,g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==Bh;if(!g&&!p){d?t[n]=new fi(m?e.unpack(u,0):u):t[n]=dAe(e,a,i);return}let A=t[n],y,x=i.epoch;if(l(x)&&(y=Q.fromIso8601(x)),g&&!p){A instanceof wd||(t[n]=A=new wd(e)),A.addSamplesPackedArray(u,y),gV(i,A);return}let b;if(!g&&p){s=s.clone(),d?s.data=m?e.unpack(u,0):u:s.data=dAe(e,a,i),l(A)||(t[n]=A=d?new SA:new Nl),d&&A instanceof SA?A.intervals.addInterval(s):A instanceof Nl?(d&&(s.data=new fi(s.data)),A.intervals.addInterval(s)):(t[n]=A=AAe(A),d&&(s.data=new fi(s.data)),A.intervals.addInterval(s));return}l(A)||(t[n]=A=new Nl),A instanceof Nl||(t[n]=A=AAe(A));let T=A.intervals;b=T.findInterval(s),(!l(b)||!(b.data instanceof wd))&&(b=s.clone(),b.data=new wd(e),T.addInterval(b)),b.data.addSamplesPackedArray(u,y),gV(i,b.data)}function PAe(e,t){if(e instanceof wd){e.removeSamples(t);return}else if(e instanceof SA){e.intervals.removeInterval(t);return}else if(e instanceof Nl){let n=e.intervals;for(let i=0;i<n.length;++i){let o=wn.intersect(n.get(i),t,ub);o.isEmpty||PAe(o.data,t)}n.removeInterval(t);return}}function Te(e,t,n,i,o,r,a){if(l(i))if(Array.isArray(i))for(let s=0,c=i.length;s<c;++s)_V(e,t,n,i[s],o,r,a);else _V(e,t,n,i,o,r,a)}function xAe(e,t,n,i,o,r){let a=Pr(n.interval);l(i)&&(l(a)?a=wn.intersect(a,i,ub):a=i);let s=l(n.cartesianVelocity)?1:0,c=h.packedLength*(s+1),u,f,d=!l(n.reference),p=l(a)&&!a.equals(Qe.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return RAe(e[t],a)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Ni[n.referenceFrame]),g=g??Ni.FIXED,u=T$(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new au(h.unpack(u),g):e[t]=UP(r,n.reference);return}let A=e[t],y,x=n.epoch;if(l(x)&&(y=Q.fromIso8601(x)),m&&!p){(!(A instanceof Tc)||l(g)&&A.referenceFrame!==g)&&(e[t]=A=new Tc(g,s)),A.addSamplesPackedArray(u,y),gV(n,A);return}let b;if(!m&&p){a=a.clone(),d?a.data=h.unpack(u):a.data=UP(r,n.reference),l(A)||(d?A=new vA(g):A=new bc(g),e[t]=A),d&&A instanceof vA&&l(g)&&A.referenceFrame===g?A.intervals.addInterval(a):A instanceof bc?(d&&(a.data=new au(a.data,g)),A.intervals.addInterval(a)):(e[t]=A=yAe(A),d&&(a.data=new au(a.data,g)),A.intervals.addInterval(a));return}l(A)?A instanceof bc||(e[t]=A=yAe(A)):e[t]=A=new bc(g);let T=A.intervals;b=T.findInterval(a),(!l(b)||!(b.data instanceof Tc)||l(g)&&b.data.referenceFrame!==g)&&(b=a.clone(),b.data=new Tc(g,s),T.addInterval(b)),b.data.addSamplesPackedArray(u,y),gV(n,b.data)}function RAe(e,t){if(e instanceof Tc){e.removeSamples(t);return}else if(e instanceof vA){e.intervals.removeInterval(t);return}else if(e instanceof bc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=wn.intersect(n.get(i),t,ub);o.isEmpty||RAe(o.data,t)}n.removeInterval(t);return}}function OAe(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)xAe(e,t,n[a],i,o,r);else xAe(e,t,n,i,o,r)}function bAe(e,t,n,i){l(n.references)?AV(e,t,n.references,n.interval,i,NP,Nl):(l(n.cartesian2)?n.array=z.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=z.unpackArray(n.cartesian)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function TAe(e,t,n,i,o,r){let a=Pr(n.interval);l(i)&&(l(a)?a=wn.intersect(a,i,ub):a=i);let s=e[t],c,u;if(l(a)){s instanceof CP||(s=new CP,e[t]=s);let d=s.intervals;u=d.findInterval({start:a.start,stop:a.stop}),l(u)?c=u.data:(u=a.clone(),d.addInterval(u))}else c=s;let f;l(n.solidColor)?(c instanceof Wt||(c=new Wt),f=n.solidColor,Te(U,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof OP||(c=new OP),f=n.grid,Te(U,c,"color",f.color,void 0,o,r),Te(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),Te(z,c,"lineCount",f.lineCount,void 0,o,r),Te(z,c,"lineThickness",f.lineThickness,void 0,o,r),Te(z,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Ky||(c=new Ky),f=n.image,Te(Image,c,"image",f.image,void 0,o,r),Te(z,c,"repeat",f.repeat,void 0,o,r),Te(U,c,"color",f.color,void 0,o,r),Te(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof FP||(c=new FP),f=n.stripe,Te(_p,c,"orientation",f.orientation,void 0,o,r),Te(U,c,"evenColor",f.evenColor,void 0,o,r),Te(U,c,"oddColor",f.oddColor,void 0,o,r),Te(Number,c,"offset",f.offset,void 0,o,r),Te(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof sb||(c=new sb),f=n.polylineOutline,Te(U,c,"color",f.color,void 0,o,r),Te(U,c,"outlineColor",f.outlineColor,void 0,o,r),Te(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof LP||(c=new LP),f=n.polylineGlow,Te(U,c,"color",f.color,void 0,o,r),Te(Number,c,"glowPower",f.glowPower,void 0,o,r),Te(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof MP||(c=new MP),f=n.polylineArrow,Te(U,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof BP||(c=new BP),f=n.polylineDash,Te(U,c,"color",f.color,void 0,void 0,r),Te(U,c,"gapColor",f.gapColor,void 0,void 0,r),Te(Number,c,"dashLength",f.dashLength,void 0,o,r),Te(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof yP||(c=new yP),f=n.checkerboard,Te(U,c,"evenColor",f.evenColor,void 0,o,r),Te(U,c,"oddColor",f.oddColor,void 0,o,r),Te(z,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function df(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)TAe(e,t,n[a],i,o,r);else TAe(e,t,n,i,o,r)}function Plt(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function Rlt(e,t,n,i){let o=t.description;l(o)&&Te(String,e,"description",o,void 0,i,n)}function Olt(e,t,n,i){let o=t.position;l(o)&&OAe(e,"position",o,void 0,i,n)}function Mlt(e,t,n,i){let o=t.viewFrom;l(o)&&Te(h,e,"viewFrom",o,void 0,i,n)}function Blt(e,t,n,i){let o=t.orientation;l(o)&&Te(Le,e,"orientation",o,void 0,i,n)}function Llt(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new cu);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let a=o[r];if(Array.isArray(a))for(let s=0,c=a.length;s<c;++s)_V(gAe(a[s]),e.properties,r,a[s],void 0,i,n);else _V(gAe(a),e.properties,r,a,void 0,i,n)}}}function AV(e,t,n,i,o,r,a){let s=n.map(function(c){return UP(o,c)});if(l(i)){i=Pr(i);let c=e[t];if(!(c instanceof a)){let u=new a;u.intervals.addInterval(C$(c)),e[t]=c=u}i.data=new r(s),c.intervals.addInterval(i)}else e[t]=new r(s)}function CAe(e,t,n,i){let o=n.references;l(o)?AV(e,t,o,n.interval,i,NP,Nl):Te(Array,e,t,n,void 0,void 0,i)}function EAe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)CAe(e,t,n[o],i);else CAe(e,t,n,i)}function vAe(e,t,n,i){let o=n.references;l(o)?AV(e,t,o,n.interval,i,bA,bc):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,te.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,te.default)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function GP(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)vAe(e,t,n[o],i);else vAe(e,t,n,i)}function Nlt(e){return h.unpackArray(e)}function Flt(e){return h.fromRadiansArrayHeights(e,te.default)}function klt(e){return h.fromDegreesArrayHeights(e,te.default)}function SAe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(a){let s={};return AV(s,"positions",a,n.interval,i,bA,bc),s.positions});e[t]=new bA(r)}else l(n.cartesian)?n.array=n.cartesian.map(Nlt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(Flt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(klt)),l(n.array)&&Te(Array,e,t,n,void 0,void 0,i)}function zlt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)SAe(e,t,n[o],i);else SAe(e,t,n,i)}function Ult(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)bAe(e,t,n[o],i);else bAe(e,t,n,i)}function Vlt(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let a=0,s=o.length;a<s;++a)l(r)||(r=new Ia),r.addInterval(Pr(o[a]));else r=new Ia,r.addInterval(Pr(o));e.availability=r}function jlt(e,t,n,i,o){l(t)&&Te(IA,e,"alignedAxis",t,n,i,o)}function Glt(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=Pr(o.interval),a=e.billboard;l(a)||(e.billboard=a=new bl),Te(Boolean,a,"show",o.show,r,i,n),Te(Image,a,"image",o.image,r,i,n),Te(Number,a,"scale",o.scale,r,i,n),Te(z,a,"pixelOffset",o.pixelOffset,r,i,n),Te(h,a,"eyeOffset",o.eyeOffset,r,i,n),Te(Bi,a,"horizontalOrigin",o.horizontalOrigin,r,i,n),Te(zn,a,"verticalOrigin",o.verticalOrigin,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(U,a,"color",o.color,r,i,n),Te(Bh,a,"rotation",o.rotation,r,i,n),jlt(a,o.alignedAxis,r,i,n),Te(Boolean,a,"sizeInMeters",o.sizeInMeters,r,i,n),Te(Number,a,"width",o.width,r,i,n),Te(Number,a,"height",o.height,r,i,n),Te(Ut,a,"scaleByDistance",o.scaleByDistance,r,i,n),Te(Ut,a,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(Ut,a,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Te(Je,a,"imageSubRegion",o.imageSubRegion,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,a,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Hlt(e,t,n,i){let o=t.box;if(!l(o))return;let r=Pr(o.interval),a=e.box;l(a)||(e.box=a=new mC),Te(Boolean,a,"show",o.show,r,i,n),Te(h,a,"dimensions",o.dimensions,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(Boolean,a,"fill",o.fill,r,i,n),df(a,"material",o.material,r,i,n),Te(Boolean,a,"outline",o.outline,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Wlt(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=Pr(o.interval),a=e.corridor;l(a)||(e.corridor=a=new gC),Te(Boolean,a,"show",o.show,r,i,n),GP(a,"positions",o.positions,n),Te(Number,a,"width",o.width,r,i,n),Te(Number,a,"height",o.height,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Te(nt,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Ji,a,"cornerType",o.cornerType,r,i,n),Te(Number,a,"granularity",o.granularity,r,i,n),Te(Boolean,a,"fill",o.fill,r,i,n),df(a,"material",o.material,r,i,n),Te(Boolean,a,"outline",o.outline,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Yn,a,"classificationType",o.classificationType,r,i,n),Te(Number,a,"zIndex",o.zIndex,r,i,n)}function qlt(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=Pr(o.interval),a=e.cylinder;l(a)||(e.cylinder=a=new _C),Te(Boolean,a,"show",o.show,r,i,n),Te(Number,a,"length",o.length,r,i,n),Te(Number,a,"topRadius",o.topRadius,r,i,n),Te(Number,a,"bottomRadius",o.bottomRadius,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(Boolean,a,"fill",o.fill,r,i,n),df(a,"material",o.material,r,i,n),Te(Boolean,a,"outline",o.outline,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,a,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Te(Number,a,"slices",o.slices,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Ylt(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 re("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new re("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=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function Xlt(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=Pr(o.interval),a=e.ellipse;l(a)||(e.ellipse=a=new AC),Te(Boolean,a,"show",o.show,r,i,n),Te(Number,a,"semiMajorAxis",o.semiMajorAxis,r,i,n),Te(Number,a,"semiMinorAxis",o.semiMinorAxis,r,i,n),Te(Number,a,"height",o.height,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Te(nt,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Bh,a,"rotation",o.rotation,r,i,n),Te(Bh,a,"stRotation",o.stRotation,r,i,n),Te(Number,a,"granularity",o.granularity,r,i,n),Te(Boolean,a,"fill",o.fill,r,i,n),df(a,"material",o.material,r,i,n),Te(Boolean,a,"outline",o.outline,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,a,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Yn,a,"classificationType",o.classificationType,r,i,n),Te(Number,a,"zIndex",o.zIndex,r,i,n)}function Klt(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=Pr(o.interval),a=e.ellipsoid;l(a)||(e.ellipsoid=a=new yC),Te(Boolean,a,"show",o.show,r,i,n),Te(h,a,"radii",o.radii,r,i,n),Te(h,a,"innerRadii",o.innerRadii,r,i,n),Te(Number,a,"minimumClock",o.minimumClock,r,i,n),Te(Number,a,"maximumClock",o.maximumClock,r,i,n),Te(Number,a,"minimumCone",o.minimumCone,r,i,n),Te(Number,a,"maximumCone",o.maximumCone,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(Boolean,a,"fill",o.fill,r,i,n),df(a,"material",o.material,r,i,n),Te(Boolean,a,"outline",o.outline,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,a,"stackPartitions",o.stackPartitions,r,i,n),Te(Number,a,"slicePartitions",o.slicePartitions,r,i,n),Te(Number,a,"subdivisions",o.subdivisions,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Qlt(e,t,n,i){let o=t.label;if(!l(o))return;let r=Pr(o.interval),a=e.label;l(a)||(e.label=a=new Pm),Te(Boolean,a,"show",o.show,r,i,n),Te(String,a,"text",o.text,r,i,n),Te(String,a,"font",o.font,r,i,n),Te(_r,a,"style",o.style,r,i,n),Te(Number,a,"scale",o.scale,r,i,n),Te(Boolean,a,"showBackground",o.showBackground,r,i,n),Te(U,a,"backgroundColor",o.backgroundColor,r,i,n),Te(z,a,"backgroundPadding",o.backgroundPadding,r,i,n),Te(z,a,"pixelOffset",o.pixelOffset,r,i,n),Te(h,a,"eyeOffset",o.eyeOffset,r,i,n),Te(Bi,a,"horizontalOrigin",o.horizontalOrigin,r,i,n),Te(zn,a,"verticalOrigin",o.verticalOrigin,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(U,a,"fillColor",o.fillColor,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(Ut,a,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(Ut,a,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Te(Ut,a,"scaleByDistance",o.scaleByDistance,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,a,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function $lt(e,t,n,i){let o=t.model;if(!l(o))return;let r=Pr(o.interval),a=e.model;l(a)||(e.model=a=new h_),Te(Boolean,a,"show",o.show,r,i,n),Te(jP.default,a,"uri",o.gltf,r,i,n),Te(Number,a,"scale",o.scale,r,i,n),Te(Number,a,"minimumPixelSize",o.minimumPixelSize,r,i,n),Te(Number,a,"maximumScale",o.maximumScale,r,i,n),Te(Boolean,a,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Te(Boolean,a,"runAnimations",o.runAnimations,r,i,n),Te(Boolean,a,"clampAnimations",o.clampAnimations,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(U,a,"silhouetteColor",o.silhouetteColor,r,i,n),Te(Number,a,"silhouetteSize",o.silhouetteSize,r,i,n),Te(U,a,"color",o.color,r,i,n),Te(Pl,a,"colorBlendMode",o.colorBlendMode,r,i,n),Te(Number,a,"colorBlendAmount",o.colorBlendAmount,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let s,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(s=0,c=u.length;s<c;++s)wAe(a,u[s],r,i,n);else wAe(a,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(s=0,c=f.length;s<c;++s)IAe(a,f[s],r,i,n);else IAe(a,f,r,i,n)}function wAe(e,t,n,i,o){let r=Pr(t.interval);l(n)&&(l(r)?r=wn.intersect(r,n,ub):r=n);let a=e.nodeTransformations,s=Object.keys(t);for(let c=0,u=s.length;c<u;++c){let f=s[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(a)||(e.nodeTransformations=a=new cu),a.hasProperty(f)||a.addProperty(f);let p=a[f];l(p)||(a[f]=p=new xC),Te(h,p,"translation",d.translation,r,i,o),Te(Le,p,"rotation",d.rotation,r,i,o),Te(h,p,"scale",d.scale,r,i,o)}}function IAe(e,t,n,i,o){let r=Pr(t.interval);l(n)&&(l(r)?r=wn.intersect(r,n,ub):r=n);let a=e.articulations,s=Object.keys(t);for(let c=0,u=s.length;c<u;++c){let f=s[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(a)||(e.articulations=a=new cu),a.hasProperty(f)||a.addProperty(f),Te(Number,a,f,d,r,i,o))}}function Jlt(e,t,n,i){let o=t.path;if(!l(o))return;let r=Pr(o.interval),a=e.path;l(a)||(e.path=a=new m_),Te(Boolean,a,"show",o.show,r,i,n),Te(Number,a,"leadTime",o.leadTime,r,i,n),Te(Number,a,"trailTime",o.trailTime,r,i,n),Te(Number,a,"width",o.width,r,i,n),Te(Number,a,"resolution",o.resolution,r,i,n),df(a,"material",o.material,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(String,a,"relativeTo",o.relativeTo,r,i,n)}function Zlt(e,t,n,i){let o=t.point;if(!l(o))return;let r=Pr(o.interval),a=e.point;l(a)||(e.point=a=new TC),Te(Boolean,a,"show",o.show,r,i,n),Te(Number,a,"pixelSize",o.pixelSize,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(U,a,"color",o.color,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(Ut,a,"scaleByDistance",o.scaleByDistance,r,i,n),Te(Ut,a,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,a,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function VP(e){this.polygon=e,this._definitionChanged=new ye}Object.defineProperties(VP.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}}});VP.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 Gc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Gc(n,i)};VP.prototype.equals=function(e){return this===e||e instanceof VP&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function eut(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=Pr(o.interval),a=e.polygon;l(a)||(e.polygon=a=new Rm),Te(Boolean,a,"show",o.show,r,i,n),GP(a,"_positions",o.positions,n),zlt(a,"_holes",o.holes,n),(l(a._positions)||l(a._holes))&&(a.hierarchy=new VP(a)),Te(Number,a,"height",o.height,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Te(nt,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Bh,a,"stRotation",o.stRotation,r,i,n),Te(Number,a,"granularity",o.granularity,r,i,n),Te(Boolean,a,"fill",o.fill,r,i,n),df(a,"material",o.material,r,i,n),Te(Boolean,a,"outline",o.outline,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(Boolean,a,"perPositionHeight",o.perPositionHeight,r,i,n),Te(Boolean,a,"closeTop",o.closeTop,r,i,n),Te(Boolean,a,"closeBottom",o.closeBottom,r,i,n),Te(rn,a,"arcType",o.arcType,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Yn,a,"classificationType",o.classificationType,r,i,n),Te(Number,a,"zIndex",o.zIndex,r,i,n)}function tut(e){return e?rn.GEODESIC:rn.NONE}function nut(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=Pr(o.interval),a=e.polyline;if(l(a)||(e.polyline=a=new El),Te(Boolean,a,"show",o.show,r,i,n),GP(a,"positions",o.positions,n),Te(Number,a,"width",o.width,r,i,n),Te(Number,a,"granularity",o.granularity,r,i,n),df(a,"material",o.material,r,i,n),df(a,"depthFailMaterial",o.depthFailMaterial,r,i,n),Te(rn,a,"arcType",o.arcType,r,i,n),Te(Boolean,a,"clampToGround",o.clampToGround,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Yn,a,"classificationType",o.classificationType,r,i,n),Te(Number,a,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let s={};Te(Boolean,s,"followSurface",o.followSurface,r,i,n),a.arcType=ylt(s.followSurface,tut)}}function iut(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=Pr(o.interval),a=e.polylineVolume;l(a)||(e.polylineVolume=a=new CC),GP(a,"positions",o.positions,n),Ult(a,"shape",o.shape,n),Te(Boolean,a,"show",o.show,r,i,n),Te(Ji,a,"cornerType",o.cornerType,r,i,n),Te(Boolean,a,"fill",o.fill,r,i,n),df(a,"material",o.material,r,i,n),Te(Boolean,a,"outline",o.outline,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,a,"granularity",o.granularity,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function out(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=Pr(o.interval),a=e.rectangle;l(a)||(e.rectangle=a=new Om),Te(Boolean,a,"show",o.show,r,i,n),Te(oe,a,"coordinates",o.coordinates,r,i,n),Te(Number,a,"height",o.height,r,i,n),Te(nt,a,"heightReference",o.heightReference,r,i,n),Te(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Te(nt,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Bh,a,"rotation",o.rotation,r,i,n),Te(Bh,a,"stRotation",o.stRotation,r,i,n),Te(Number,a,"granularity",o.granularity,r,i,n),Te(Boolean,a,"fill",o.fill,r,i,n),df(a,"material",o.material,r,i,n),Te(Boolean,a,"outline",o.outline,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Yn,a,"classificationType",o.classificationType,r,i,n),Te(Number,a,"zIndex",o.zIndex,r,i,n)}function rut(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=Pr(o.interval),a=e.tileset;l(a)||(e.tileset=a=new bC),Te(Boolean,a,"show",o.show,r,i,n),Te(jP.default,a,"uri",o.uri,r,i,n),Te(Number,a,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function aut(e,t,n,i){let o=t.wall;if(!l(o))return;let r=Pr(o.interval),a=e.wall;l(a)||(e.wall=a=new p_),Te(Boolean,a,"show",o.show,r,i,n),GP(a,"positions",o.positions,n),EAe(a,"minimumHeights",o.minimumHeights,n),EAe(a,"maximumHeights",o.maximumHeights,n),Te(Number,a,"granularity",o.granularity,r,i,n),Te(Boolean,a,"fill",o.fill,r,i,n),df(a,"material",o.material,r,i,n),Te(Boolean,a,"outline",o.outline,r,i,n),Te(U,a,"outlineColor",o.outlineColor,r,i,n),Te(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Te(vn,a,"shadows",o.shadows,r,i,n),Te(kt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function DAe(e,t,n,i,o){let r=e.id;if(l(r)||(r=Hn()),b$=r,!l(o._version)&&r!=="document")throw new re("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")Ylt(e,o);else{let a=t.getOrCreateEntity(r),s=e.parent;l(s)&&(a.parent=t.getOrCreateEntity(s));for(let c=n.length-1;c>-1;c--)n[c](a,e,t,i)}b$=void 0}function sut(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Qe.MINIMUM_VALUE)){let r=o.start,a=o.stop,s=Q.secondsDifference(a,r),c=Math.round(s/120);return t=new gp,t.startTime=Q.clone(r),t.stopTime=Q.clone(a),t.clockRange=Pa.LOOP_STOP,t.multiplier=c,t.currentTime=Q.clone(r),t.clockStep=Bo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new gp,t.startTime=Qe.MINIMUM_VALUE.clone(),t.stopTime=Qe.MAXIMUM_VALUE.clone(),t.currentTime=Qe.MINIMUM_VALUE.clone(),t.clockRange=Pa.LOOP_STOP,t.clockStep=Bo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Pr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=Q.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=Pa[n.range]??Pa.LOOP_STOP),l(n.step)&&(t.clockStep=Bo[n.step]??Bo.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function MAe(e,t,n,i){n=n??G.EMPTY_OBJECT;let o=t,r=n.sourceUri,a=n.credit;if(typeof a=="string"&&(a=new xt(a)),e._credit=a,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let s=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)s.push(c[f])}}return r=De.createIfNeeded(r),Da.setLoading(e,!0),Promise.resolve(o).then(function(s){return cut(e,s,r,i)}).catch(function(s){return Da.setLoading(e,!1),e._error.raiseEvent(e,s),console.log(s),Promise.reject(s)})}function cut(e,t,n,i){Da.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new BAe,o.removeAll()),Wa._processCzml(t,o,n,void 0,e);let r=sut(e),a=e._documentPacket;return l(a.name)&&e._name!==a.name?(e._name=a.name,r=!0):!l(e._name)&&l(n)&&(e._name=xA(n.getUrlComponent()),r=!0),Da.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function BAe(){this.name=void 0,this.clock=void 0}function Wa(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._clock=void 0,this._documentPacket=new BAe,this._version=void 0,this._entityCollection=new Js(this),this._entityCluster=new Ed,this._credit=void 0,this._resourceCredits=[]}Wa.load=function(e,t){return new Wa().load(e,t)};Object.defineProperties(Wa.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}}});Wa.updaters=[Glt,Hlt,Wlt,qlt,Xlt,Klt,Qlt,$lt,Plt,Rlt,Jlt,Zlt,eut,nut,iut,Llt,out,Olt,rut,Mlt,aut,Blt,Vlt];Wa.registerUpdater=function(e){Wa.updaters.includes(e)||Wa.updaters.push(e)};Wa.unregisterUpdater=function(e){if(Wa.updaters.includes(e)){let t=Wa.updaters.indexOf(e);Wa.updaters.splice(t,1)}};Wa.prototype.process=function(e,t){return MAe(this,e,t,!1)};Wa.prototype.load=function(e,t){return MAe(this,e,t,!0)};Wa.prototype.update=function(e){return!0};Wa.processPacketData=Te;Wa.processPositionPacketData=OAe;Wa.processMaterialPacketData=df;Wa._processCzml=function(e,t,n,i,o){if(i=i??Wa.updaters,Array.isArray(e))for(let r=0,a=e.length;r<a;++r)DAe(e[r],t,i,n,o);else DAe(e,t,i,n,o)};var yV=Wa;function Ul(){this._dataSources=[],this._dataSourceAdded=new ye,this._dataSourceRemoved=new ye,this._dataSourceMoved=new ye}Object.defineProperties(Ul.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}}});Ul.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})};Ul.prototype.remove=function(e,t){t=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};Ul.prototype.removeAll=function(e){e=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=[]};Ul.prototype.contains=function(e){return this.indexOf(e)!==-1};Ul.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Ul.prototype.get=function(e){return this._dataSources[e]};Ul.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function xV(e,t){return e.indexOf(t)}function LAe(e,t,n){let i=e._dataSources,o=i.length-1;if(t=D.clamp(t,0,o),n=D.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}Ul.prototype.raise=function(e){let t=xV(this._dataSources,e);LAe(this,t,t+1)};Ul.prototype.lower=function(e){let t=xV(this._dataSources,e);LAe(this,t,t-1)};Ul.prototype.raiseToTop=function(e){let t=xV(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))};Ul.prototype.lowerToBottom=function(e){let t=xV(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Ul.prototype.isDestroyed=function(){return!1};Ul.prototype.destroy=function(){return this.removeAll(!0),fe(this)};var bV=Ul;function ec(e){e=e??G.EMPTY_OBJECT,this._primitives=[],this._guid=Hn(),this._primitiveAdded=new ye,this._primitiveRemoved=new ye,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(ec.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});ec.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._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};ec.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._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};ec.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};ec.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};ec.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function TV(e,t){return e._primitives.indexOf(t)}ec.prototype.raise=function(e){if(l(e)){let t=TV(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};ec.prototype.raiseToTop=function(e){if(l(e)){let t=TV(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};ec.prototype.lower=function(e){if(l(e)){let t=TV(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};ec.prototype.lowerToBottom=function(e){if(l(e)){let t=TV(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};ec.prototype.get=function(e){return this._primitives[e]};ec.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};ec.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)}};ec.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)}};ec.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)}};ec.prototype.isDestroyed=function(){return!1};ec.prototype.destroy=function(){return this.removeAll(),fe(this)};var Eu=ec;function Ap(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Ap.prototype,{length:{get:function(){return this._length}}});Ap.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Eu({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};Ap.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Ap.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};Ap.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};Ap.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Ap.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Ap.prototype.isDestroyed=function(){return!1};Ap.prototype.destroy=function(){return this.removeAll(),fe(this)};var CV=Ap;function wv(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Nt}wv.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};wv.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};wv.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};wv.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};wv.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Tt.FAILED};var Iv=wv;var v$={},EV=new h,NAe=new h,FAe=new Le,kAe=new $;function Dv(e,t,n,i,o,r,a,s,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),EV),h.multiplyByScalar(n,Math.sin(f),NAe),h.add(EV,NAe,EV);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(a*d+o*p)/s;return Le.fromAxisAngle(EV,m,FAe),$.fromQuaternion(FAe,kAe),$.multiplyByVector(kAe,c,u),h.normalize(u,u),h.multiplyByScalar(u,s,u),u}var zAe=new h,UAe=new h,E$=new h,lut=new h;v$.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,a=n?e.length/3*2:e.length/3,s=new Float64Array(a*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,zAe);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,UAe),A=i.geodeticSurfaceNormal(g,lut),y=h.multiplyByScalar(A,o,E$);h.add(g,y,g),n&&(h.multiplyByScalar(A,r,y),h.add(m,y,m),s[f+u]=m.x,s[d+u]=m.y,s[p+u]=m.z),s[f]=g.x,s[d]=g.y,s[p]=g.z}return s};var uut=new h,fut=new h,dut=new h;v$.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,a=e.center,s=e.granularity*8,c=i*i,u=o*o,f=o*i,d=h.magnitude(a),p=h.normalize(a,uut),g=h.cross(h.UNIT_Z,a,fut);g=h.normalize(g,g);let m=h.cross(p,g,dut),A=1+Math.ceil(D.PI_OVER_TWO/s),y=D.PI_OVER_TWO/(A-1),x=D.PI_OVER_TWO-A*y;x<0&&(A-=Math.ceil(Math.abs(x)/y));let b=2*(A*(A+2)),T=t?new Array(b*3):void 0,E=0,S=zAe,w=UAe,P=A*4*3,O=P-1,B=0,L=n?new Array(P):void 0,_,C,v,I,M;for(x=D.PI_OVER_TWO,S=Dv(x,r,m,g,c,f,u,d,p,S),t&&(T[E++]=S.x,T[E++]=S.y,T[E++]=S.z),n&&(L[O--]=S.z,L[O--]=S.y,L[O--]=S.x),x=D.PI_OVER_TWO-y,_=1;_<A+1;++_){if(S=Dv(x,r,m,g,c,f,u,d,p,S),w=Dv(Math.PI-x,r,m,g,c,f,u,d,p,w),t){for(T[E++]=S.x,T[E++]=S.y,T[E++]=S.z,v=2*_+2,C=1;C<v-1;++C)I=C/(v-1),M=h.lerp(S,w,I,E$),T[E++]=M.x,T[E++]=M.y,T[E++]=M.z;T[E++]=w.x,T[E++]=w.y,T[E++]=w.z}n&&(L[O--]=S.z,L[O--]=S.y,L[O--]=S.x,L[B++]=w.x,L[B++]=w.y,L[B++]=w.z),x=D.PI_OVER_TWO-(_+1)*y}for(_=A;_>1;--_){if(x=D.PI_OVER_TWO-(_-1)*y,S=Dv(-x,r,m,g,c,f,u,d,p,S),w=Dv(x+Math.PI,r,m,g,c,f,u,d,p,w),t){for(T[E++]=S.x,T[E++]=S.y,T[E++]=S.z,v=2*(_-1)+2,C=1;C<v-1;++C)I=C/(v-1),M=h.lerp(S,w,I,E$),T[E++]=M.x,T[E++]=M.y,T[E++]=M.z;T[E++]=w.x,T[E++]=w.y,T[E++]=w.z}n&&(L[O--]=S.z,L[O--]=S.y,L[O--]=S.x,L[B++]=w.x,L[B++]=w.y,L[B++]=w.z)}x=D.PI_OVER_TWO,S=Dv(-x,r,m,g,c,f,u,d,p,S);let N={};return t&&(T[E++]=S.x,T[E++]=S.y,T[E++]=S.z,N.positions=T,N.numPts=A),n&&(L[O--]=S.z,L[O--]=S.y,L[O--]=S.x,N.outerPositions=L),N};var hf=v$;var Pv=new h,S$=new h,w$=new h,VAe=new h,ms=new z,jAe=new $,hut=new $,I$=new Le,GAe=new h,HAe=new h,WAe=new h,wV=new de,qAe=new h,YAe=new z,XAe=new z;function KAe(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,a=t.semiMinorAxis,s=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,A=f?new Float32Array(u*3):void 0,y=0,x=GAe,b=HAe,T=WAe,E=new Hi(s),S=E.project(s.cartesianToCartographic(o,wV),qAe),w=s.scaleToGeodeticSurface(o,Pv);s.geodeticSurfaceNormal(w,w);let P=jAe,O=hut;if(c!==0){let M=Le.fromAxisAngle(w,c,I$);P=$.fromQuaternion(M,P),M=Le.fromAxisAngle(w,-c,I$),O=$.fromQuaternion(M,O)}else P=$.clone($.IDENTITY,P),O=$.clone($.IDENTITY,O);let B=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,YAe),L=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,XAe),_=e.length,C=n?_:0,v=C/3*2;for(let M=0;M<_;M+=3){let N=M+1,j=M+2,k=h.fromArray(e,M,Pv);if(i.st){let V=$.multiplyByVector(P,k,S$),F=E.project(s.cartesianToCartographic(V,wV),w$);h.subtract(F,S,F),ms.x=(F.x+r)/(2*r),ms.y=(F.y+a)/(2*a),B.x=Math.min(ms.x,B.x),B.y=Math.min(ms.y,B.y),L.x=Math.max(ms.x,L.x),L.y=Math.max(ms.y,L.y),n&&(d[y+v]=ms.x,d[y+1+v]=ms.y),d[y++]=ms.x,d[y++]=ms.y}(i.normal||i.tangent||i.bitangent||f)&&(x=s.geodeticSurfaceNormal(k,x),f&&(A[M+C]=-x.x,A[N+C]=-x.y,A[j+C]=-x.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(b=h.normalize(h.cross(h.UNIT_Z,x,b),b),$.multiplyByVector(O,b,b)),i.normal&&(p[M]=x.x,p[N]=x.y,p[j]=x.z,n&&(p[M+C]=-x.x,p[N+C]=-x.y,p[j+C]=-x.z)),i.tangent&&(g[M]=b.x,g[N]=b.y,g[j]=b.z,n&&(g[M+C]=-b.x,g[N+C]=-b.y,g[j+C]=-b.z)),i.bitangent&&(T=h.normalize(h.cross(x,b,T),T),m[M]=T.x,m[N]=T.y,m[j]=T.z,n&&(m[M+C]=T.x,m[N+C]=T.y,m[j+C]=T.z))))}if(i.st){_=d.length;for(let M=0;M<_;M+=2)d[M]=(d[M]-B.x)/(L.x-B.x),d[M+1]=(d[M+1]-B.y)/(L.y-B.y)}let I=new _n;if(i.position){let M=hf.raisePositionsToHeight(e,t,n);I.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:M})}if(i.st&&(I.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(I.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),n&&l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===ln.TOP)M=M.fill(1,0,u/2);else{let N=t.offsetAttribute===ln.NONE?0:1;M=M.fill(N)}I.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return I}function QAe(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,a,s;for(i=0,r=1,a=0;a<3;a++)t[n++]=r++,t[n++]=i,t[n++]=r;for(a=2;a<e+1;++a){for(r=a*(a+1)-1,i=(a-1)*a-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*a,s=0;s<o-1;++s)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,a=0;a<o-1;++a)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,a=e-1;a>1;--a){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*a,s=0;s<o-1;++s)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(a=0;a<3;a++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var fb=new h;function mut(e){let t=e.center;fb=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,fb),e.height,fb),fb=h.add(t,fb,fb);let n=new ce(fb,e.semiMajorAxis),i=hf.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,a=KAe(o,e,!1),s=QAe(r);return s=Ue.createTypedArray(o.length/3,s),{boundingSphere:n,attributes:a,indices:s}}function put(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,a=t.ellipsoid,s=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,A=n.bitangent?new Float32Array(f*3):void 0,y=t.shadowVolume,x=y?new Float32Array(f*3):void 0,b=0,T=GAe,E=HAe,S=WAe,w=new Hi(a),P=w.project(a.cartesianToCartographic(i,wV),qAe),O=a.scaleToGeodeticSurface(i,Pv);a.geodeticSurfaceNormal(O,O);let B=Le.fromAxisAngle(O,u,I$),L=$.fromQuaternion(B,jAe),_=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,YAe),C=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,XAe),v=e.length,I=v/3*2;for(let N=0;N<v;N+=3){let j=N+1,k=N+2,V=h.fromArray(e,N,Pv),F;if(n.st){let q=$.multiplyByVector(L,V,S$),J=w.project(a.cartesianToCartographic(q,wV),w$);h.subtract(J,P,J),ms.x=(J.x+o)/(2*o),ms.y=(J.y+r)/(2*r),_.x=Math.min(ms.x,_.x),_.y=Math.min(ms.y,_.y),C.x=Math.max(ms.x,C.x),C.y=Math.max(ms.y,C.y),p[b+I]=ms.x,p[b+1+I]=ms.y,p[b++]=ms.x,p[b++]=ms.y}V=a.scaleToGeodeticSurface(V,V),F=h.clone(V,S$),T=a.geodeticSurfaceNormal(V,T),y&&(x[N+v]=-T.x,x[j+v]=-T.y,x[k+v]=-T.z);let W=h.multiplyByScalar(T,s,VAe);if(V=h.add(V,W,V),W=h.multiplyByScalar(T,c,W),F=h.add(F,W,F),n.position&&(d[N+v]=F.x,d[j+v]=F.y,d[k+v]=F.z,d[N]=V.x,d[j]=V.y,d[k]=V.z),n.normal||n.tangent||n.bitangent){S=h.clone(T,S);let q=h.fromArray(e,(N+3)%v,VAe);h.subtract(q,V,q);let J=h.subtract(F,V,w$);T=h.normalize(h.cross(J,q,T),T),n.normal&&(g[N]=T.x,g[j]=T.y,g[k]=T.z,g[N+v]=T.x,g[j+v]=T.y,g[k+v]=T.z),n.tangent&&(E=h.normalize(h.cross(S,T,E),E),m[N]=E.x,m[j]=E.y,m[k]=E.z,m[N+v]=E.x,m[N+1+v]=E.y,m[N+2+v]=E.z),n.bitangent&&(A[N]=S.x,A[j]=S.y,A[k]=S.z,A[N+v]=S.x,A[j+v]=S.y,A[k+v]=S.z)}}if(n.st){v=p.length;for(let N=0;N<v;N+=2)p[N]=(p[N]-_.x)/(C.x-_.x),p[N+1]=(p[N+1]-_.y)/(C.y-_.y)}let M=new _n;if(n.position&&(M.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(M.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(M.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(M.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(M.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),y&&(M.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),l(t.offsetAttribute)){let N=new Uint8Array(f);if(t.offsetAttribute===ln.TOP)N=N.fill(1,0,f/2);else{let j=t.offsetAttribute===ln.NONE?0:1;N=N.fill(j)}M.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return M}function gut(e){let t=e.length/3,n=Ue.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,a=o+t,s=(r+1)%t,c=s+t;n[i++]=r,n[i++]=a,n[i++]=s,n[i++]=s,n[i++]=a,n[i++]=c}return n}var vV=new ce,SV=new ce;function _ut(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,Pv),e.height,Pv);vV.center=h.add(t,o,vV.center),vV.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),SV.center=h.add(t,o,SV.center),SV.radius=i;let r=hf.computeEllipsePositions(e,!0,!0),a=r.positions,s=r.numPts,c=r.outerPositions,u=ce.union(vV,SV),f=KAe(a,e,!0),d=QAe(s),p=d.length;d.length=p*2;let g=a.length/3;for(let E=0;E<p;E+=3)d[E+p]=d[E+2]+g,d[E+1+p]=d[E+1]+g,d[E+2+p]=d[E]+g;let m=Ue.createTypedArray(g*2/3,d),A=new At({attributes:f,indices:m,primitiveType:Re.TRIANGLES}),y=put(c,e);d=gut(c);let x=Ue.createTypedArray(c.length*2/3,d),b=new At({attributes:y,indices:x,primitiveType:Re.TRIANGLES}),T=kn.combineInstances([new Bt({geometry:A}),new Bt({geometry:b})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function $Ae(e,t,n,i,o,r,a){let c=hf.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=oe.fromCartesianArray(f,r,a);return d.width>D.PI&&(d.north=d.north>0?D.PI_OVER_TWO-D.EPSILON7:d.north,d.south=d.south<0?D.EPSILON7-D.PI_OVER_TWO:d.south,d.east=D.PI,d.west=-D.PI),d}function xp(e){e=e??G.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,a=e.vertexFormat??Ne.DEFAULT,s=e.height??0,c=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,s),this._granularity=r,this._vertexFormat=Ne.clone(a),this._extrudedHeight=Math.min(c,s),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}xp.packedLength=h.packedLength+te.packedLength+Ne.packedLength+9;xp.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,Ne.pack(e._vertexFormat,t,n),n+=Ne.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]=e._offsetAttribute??-1,t};var JAe=new h,ZAe=new te,eye=new Ne,yp={center:JAe,ellipsoid:ZAe,vertexFormat:eye,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};xp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,JAe);t+=h.packedLength;let o=te.unpack(e,t,ZAe);t+=te.packedLength;let r=Ne.unpack(e,t,eye);t+=Ne.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=Ne.clone(r,n._vertexFormat),n._semiMajorAxis=a,n._semiMinorAxis=s,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(yp.height=f,yp.extrudedHeight=p,yp.granularity=d,yp.stRotation=u,yp.rotation=c,yp.semiMajorAxis=a,yp.semiMinorAxis=s,yp.shadowVolume=g,yp.offsetAttribute=m===-1?void 0:m,new xp(yp))};xp.computeRectangle=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??te.default,o=e.semiMajorAxis,r=e.semiMinorAxis,a=e.granularity??D.RADIANS_PER_DEGREE,s=e.rotation??0;return $Ae(n,o,r,s,a,i,t)};xp.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.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=_ut(o);else if(r=mut(o),l(e._offsetAttribute)){let a=r.attributes.position.values.length,s=e._offsetAttribute===ln.NONE?0:1,c=new Uint8Array(a/3).fill(s);r.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new At({attributes:r.attributes,indices:r.indices,primitiveType:Re.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};xp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new xp({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:a,vertexFormat:Ne.POSITION_ONLY,shadowVolume:!0})};function Aut(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=hf.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 a=e._ellipsoid,s=e.rectangle;return At._textureCoordinateRotationPoints(r,t,a,s)}Object.defineProperties(xp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=$Ae(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Aut(this)),this._textureCoordinateRotationPoints}}});var vu=xp;var tye=new h,db=new h;function yut(e){let t=e.center;db=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,db),e.height,db),db=h.add(t,db,db);let n=new ce(db,e.semiMajorAxis),i=hf.computeEllipsePositions(e,!1,!0).outerPositions,o=new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:hf.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,a=Ue.createTypedArray(r,r*2),s=0;for(let c=0;c<r;++c)a[s++]=c,a[s++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:a}}var IV=new ce,DV=new ce;function xut(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,tye),e.height,tye);IV.center=h.add(t,o,IV.center),IV.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),DV.center=h.add(t,o,DV.center),DV.radius=i;let r=hf.computeEllipsePositions(e,!1,!0).outerPositions,a=new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:hf.raisePositionsToHeight(r,e,!0)})});r=a.position.values;let s=ce.union(IV,DV),c=r.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===ln.TOP)m=m.fill(1,0,c/2);else{let A=e.offsetAttribute===ln.NONE?0:1;m=m.fill(A)}a.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=D.clamp(u,0,c/2);let f=Ue.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let A=Math.min(g*u,c);for(p=0;p<A;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:s,attributes:a,indices:f}}function Rv(e){e=e??G.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,a=e.height??0,s=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._height=Math.max(s,a),this._granularity=r,this._extrudedHeight=Math.min(s,a),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}Rv.packedLength=h.packedLength+te.packedLength+8;Rv.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.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]=e._offsetAttribute??-1,t};var nye=new h,iye=new te,ag={center:nye,ellipsoid:iye,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};Rv.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,nye);t+=h.packedLength;let o=te.unpack(e,t,iye);t+=te.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=a,n._rotation=s,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(ag.height=c,ag.extrudedHeight=f,ag.granularity=u,ag.rotation=s,ag.semiMajorAxis=r,ag.semiMinorAxis=a,ag.numberOfVerticalLines=d,ag.offsetAttribute=p===-1?void 0:p,new Rv(ag))};Rv.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.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=xut(o);else if(r=yut(o),l(e._offsetAttribute)){let a=r.attributes.position.values.length,s=e._offsetAttribute===ln.NONE?0:1,c=new Uint8Array(a/3).fill(s);r.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new At({attributes:r.attributes,indices:r.indices,primitiveType:Re.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Dd=Rv;var oye=new U,rye=h.ZERO,aye=new h,sye=new oe;function but(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 Lh(e,t){Zn.call(this,{entity:e,scene:t,geometryOptions:new but(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Lh.prototype=Object.create(Zn.prototype),Lh.prototype.constructor=Lh);Lh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,oye)),l(o)||(o=U.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,rye,aye))),new Bt({id:t,geometry:new vu(this._options),attributes:i})};Lh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,oye),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:qn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,rye,aye))),new Bt({id:t,geometry:new Dd(this._options),attributes:r})};Lh.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Lh.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Ci.prototype._isHidden.call(this,e,t)};Lh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};Lh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Qe.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,nt.NONE),o=X.getValueOrUndefined(t.extrudedHeight,Qe.MINIMUM_VALUE),r=X.getValueOrDefault(t.extrudedHeightReference,Qe.MINIMUM_VALUE,nt.NONE);l(o)&&!l(n)&&(n=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof Wt?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat,a.center=e.position.getValue(Qe.MINIMUM_VALUE,a.center),a.semiMajorAxis=t.semiMajorAxis.getValue(Qe.MINIMUM_VALUE,a.semiMajorAxis),a.semiMinorAxis=t.semiMinorAxis.getValue(Qe.MINIMUM_VALUE,a.semiMinorAxis),a.rotation=X.getValueOrUndefined(t.rotation,Qe.MINIMUM_VALUE),a.granularity=X.getValueOrUndefined(t.granularity,Qe.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,Qe.MINIMUM_VALUE),a.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Qe.MINIMUM_VALUE),a.offsetAttribute=Zn.computeGeometryOffsetAttribute(n,i,o,r),a.height=Zn.getGeometryHeight(n,i),o=Zn.getGeometryExtrudedHeight(o,r),o===Zn.CLAMP_TO_GROUND&&(o=wi.getMinimumMaximumHeights(vu.computeRectangle(a,sye)).minimumTerrainHeight),a.extrudedHeight=o};Lh.DynamicGeometryUpdater=Ov;function Ov(e,t,n){Ti.call(this,e,t,n)}l(Object.create)&&(Ov.prototype=Object.create(Ti.prototype),Ov.prototype.constructor=Ov);Ov.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Ti.prototype._isHidden.call(this,e,t,n)};Ov.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,nt.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),s=X.getValueOrDefault(t.extrudedHeightReference,n,nt.NONE);l(a)&&!l(o)&&(o=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Zn.computeGeometryOffsetAttribute(o,r,a,s),i.height=Zn.getGeometryHeight(o,r),a=Zn.getGeometryExtrudedHeight(a,s),a===Zn.CLAMP_TO_GROUND&&(a=wi.getMinimumMaximumHeights(vu.computeRectangle(i,sye)).minimumTerrainHeight),i.extrudedHeight=a};var PV=Lh;var Tut=new h,Cut=new h,Eut=new h,vut=new h,Sut=new h,wut=new h(1,1,1),cye=Math.cos,lye=Math.sin;function sg(e){e=e??G.EMPTY_OBJECT;let t=e.radii??wut,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,a=e.maximumCone??D.PI,s=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??Ne.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=c,this._vertexFormat=Ne.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}sg.packedLength=2*h.packedLength+Ne.packedLength+7;sg.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Ne.pack(e._vertexFormat,t,n),n+=Ne.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._offsetAttribute??-1,t};var uye=new h,fye=new h,dye=new Ne,DA={radii:uye,innerRadii:fye,vertexFormat:dye,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};sg.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,uye);t+=h.packedLength;let o=h.unpack(e,t,fye);t+=h.packedLength;let r=Ne.unpack(e,t,dye);t+=Ne.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=Ne.clone(r,n._vertexFormat),n._minimumClock=a,n._maximumClock=s,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(DA.minimumClock=a,DA.maximumClock=s,DA.minimumCone=c,DA.maximumCone=u,DA.stackPartitions=f,DA.slicePartitions=d,DA.offsetAttribute=p===-1?void 0:p,new sg(DA))};sg.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,a=e._maximumCone,s=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/D.TWO_PI),u=Math.round(u*Math.abs(a-r)/D.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[r],m=[i];for(f=0;f<u;f++)g.push(r+f*(a-r)/(u-1));for(g.push(a),d=0;d<c;d++)m.push(i+d*(o-i)/(c-1));m.push(o);let A=g.length,y=m.length,x=0,b=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,E=!1,S=!1,w=!1;T&&(b=2,r>0&&(E=!0,x+=c-1),a<Math.PI&&(S=!0,x+=c-1),(o-i)%D.TWO_PI?(w=!0,x+=(u-1)*2+1):x+=1);let P=y*A*b,O=new Float64Array(P*3),B=new Array(P).fill(!1),L=new Array(P).fill(!1),_=c*u*b,C=6*(_+x+1-(c+u)*b),v=Ue.createTypedArray(_,C),I=s.normal?new Float32Array(P*3):void 0,M=s.tangent?new Float32Array(P*3):void 0,N=s.bitangent?new Float32Array(P*3):void 0,j=s.st?new Float32Array(P*2):void 0,k=new Array(A),V=new Array(A);for(f=0;f<A;f++)k[f]=lye(g[f]),V[f]=cye(g[f]);let F=new Array(y),W=new Array(y);for(d=0;d<y;d++)W[d]=cye(m[d]),F[d]=lye(m[d]);for(f=0;f<A;f++)for(d=0;d<y;d++)O[p++]=t.x*k[f]*W[d],O[p++]=t.y*k[f]*F[d],O[p++]=t.z*V[f];let q=P/2;if(T)for(f=0;f<A;f++)for(d=0;d<y;d++)O[p++]=n.x*k[f]*W[d],O[p++]=n.y*k[f]*F[d],O[p++]=n.z*V[f],B[q]=!0,f>0&&f!==A-1&&d!==0&&d!==y-1&&(L[q]=!0),q++;p=0;let J,H;for(f=1;f<A-2;f++)for(J=f*y,H=(f+1)*y,d=1;d<y-2;d++)v[p++]=H+d,v[p++]=H+d+1,v[p++]=J+d+1,v[p++]=H+d,v[p++]=J+d+1,v[p++]=J+d;if(T){let Ge=A*y;for(f=1;f<A-2;f++)for(J=Ge+f*y,H=Ge+(f+1)*y,d=1;d<y-2;d++)v[p++]=H+d,v[p++]=J+d,v[p++]=J+d+1,v[p++]=H+d,v[p++]=J+d+1,v[p++]=H+d+1}let Z,K;if(T){if(E)for(K=A*y,f=1;f<y-2;f++)v[p++]=f,v[p++]=f+1,v[p++]=K+f+1,v[p++]=f,v[p++]=K+f+1,v[p++]=K+f;if(S)for(Z=A*y-y,K=A*y*b-y,f=1;f<y-2;f++)v[p++]=Z+f+1,v[p++]=Z+f,v[p++]=K+f,v[p++]=Z+f+1,v[p++]=K+f,v[p++]=K+f+1}if(w){for(f=1;f<A-2;f++)K=y*A+y*f,Z=y*f,v[p++]=K,v[p++]=Z+y,v[p++]=Z,v[p++]=K,v[p++]=K+y,v[p++]=Z+y;for(f=1;f<A-2;f++)K=y*A+y*(f+1)-1,Z=y*(f+1)-1,v[p++]=Z+y,v[p++]=K,v[p++]=Z,v[p++]=Z+y,v[p++]=K+y,v[p++]=K}let le=new _n;s.position&&(le.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:O}));let me=0,ae=0,be=0,ge=0,we=P/2,Ee,Be=te.fromCartesian3(t),ke=te.fromCartesian3(n);if(s.st||s.normal||s.tangent||s.bitangent){for(f=0;f<P;f++){Ee=B[f]?ke:Be;let Ge=h.fromArray(O,f*3,Tut),rt=Ee.geodeticSurfaceNormal(Ge,Cut);if(L[f]&&h.negate(rt,rt),s.st){let et=z.negate(rt,Sut);j[me++]=Math.atan2(et.y,et.x)/D.TWO_PI+.5,j[me++]=Math.asin(rt.z)/Math.PI+.5}if(s.normal&&(I[ae++]=rt.x,I[ae++]=rt.y,I[ae++]=rt.z),s.tangent||s.bitangent){let et=Eut,Pe=0,Ye;if(B[f]&&(Pe=we),!E&&f>=Pe&&f<Pe+y*2?Ye=h.UNIT_X:Ye=h.UNIT_Z,h.cross(Ye,rt,et),h.normalize(et,et),s.tangent&&(M[be++]=et.x,M[be++]=et.y,M[be++]=et.z),s.bitangent){let ut=h.cross(rt,et,vut);h.normalize(ut,ut),N[ge++]=ut.x,N[ge++]=ut.y,N[ge++]=ut.z}}}s.st&&(le.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:j})),s.normal&&(le.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:I})),s.tangent&&(le.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:M})),s.bitangent&&(le.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:N}))}if(l(e._offsetAttribute)){let Ge=O.length,rt=e._offsetAttribute===ln.NONE?0:1,et=new Uint8Array(Ge/3).fill(rt);le.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:et})}return new At({attributes:le,indices:v,primitiveType:Re.TRIANGLES,boundingSphere:ce.fromEllipsoid(Be),offsetAttribute:e._offsetAttribute})};var D$;sg.getUnitEllipsoid=function(){return l(D$)||(D$=sg.createGeometry(new sg({radii:new h(1,1,1),vertexFormat:Ne.POSITION_ONLY}))),D$};var tc=sg;var Iut=new Wt(U.WHITE),P$=h.ZERO,R$=new h,Dut=new h,Put=new h,O$=new U,Rut=new h(1,1,1);function Out(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 mf(e,t){Ci.call(this,{entity:e,scene:t,geometryOptions:new Out(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(mf.prototype=Object.create(Ci.prototype),mf.prototype.constructor=mf);Object.defineProperties(mf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});mf.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,a=new En(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),c=qn.fromDistanceDisplayCondition(s),u={show:a,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Wt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,O$)),l(f)||(f=U.WHITE),r=Yt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,P$,R$))),new Bt({id:i,geometry:new tc(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};mf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,O$),a=this._distanceDisplayConditionProperty.getValue(e),s={show:new En(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(r),distanceDisplayCondition:qn.fromDistanceDisplayCondition(a),offset:void 0};return l(this._options.offsetAttribute)&&(s.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,P$,R$))),new Bt({id:i,geometry:new xd(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:s})};mf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};mf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Ci.prototype._isHidden.call(this,e,t)};mf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};mf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,nt.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Wt?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Qe.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,Qe.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,Qe.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,Qe.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,Qe.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,Qe.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,Qe.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,Qe.MINIMUM_VALUE),i.offsetAttribute=n!==nt.NONE?ln.ALL:void 0};mf.prototype._onEntityPropertyChanged=g_;mf.DynamicGeometryUpdater=HP;function HP(e,t,n){Ti.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new R,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(Ti.prototype),HP.prototype.constructor=HP);HP.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,Dut),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=X.getValueOrDefault(n.fill,e,!0),a=X.getValueOrDefault(n.outline,e,!1),s=X.getValueOrClonedDefault(n.outlineColor,e,U.BLACK,O$),c=vr.getValue(e,n.material??Iut,this._material),u=X.getValueOrUndefined(n.innerRadii,e,Put),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),A=X.getValueOrUndefined(n.slicePartitions,e),y=X.getValueOrUndefined(n.subdivisions,e),x=X.getValueOrDefault(n.outlineWidth,e,1),b=X.getValueOrDefault(n.heightReference,e,nt.NONE),T=b!==nt.NONE?ln.ALL:void 0,E=this._scene.mode,S=E===ie.SCENE3D&&b===nt.NONE,w=this._options,P=this._geometryUpdater.shadowsProperty.getValue(e),B=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,P$,R$);if(!S||this._lastSceneMode!==E||!l(this._primitive)||w.stackPartitions!==m||w.slicePartitions!==A||l(u)&&!h.equals(w.innerRadii!==u)||w.minimumClock!==f||w.maximumClock!==d||w.minimumCone!==p||w.maximumCone!==g||w.subdivisions!==y||this._lastOutlineWidth!==x||w.offsetAttribute!==T){let C=this._primitives;C.removeAndDestroy(this._primitive),C.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=x,w.stackPartitions=m,w.slicePartitions=A,w.subdivisions=y,w.offsetAttribute=T,w.radii=h.clone(S?Rut:i,w.radii),l(u)?S?w.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,w.innerRadii):w.innerRadii=h.clone(u,w.innerRadii):w.innerRadii=void 0,w.minimumClock=f,w.maximumClock=d,w.minimumCone=p,w.maximumCone=g;let v=new go({material:c,translucent:c.isTranslucent(),closed:!0});w.vertexFormat=v.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,S,this._modelMatrix);this._primitive=C.add(new Pn({geometryInstances:I,appearance:v,asynchronous:!1,shadows:P}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,S,this._modelMatrix);this._outlinePrimitive=C.add(new Pn({geometryInstances:M,appearance:new hn({flat:!0,translucent:M.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(x)}}),asynchronous:!1,shadows:P})),this._lastShow=r,this._lastOutlineShow=a,this._lastOutlineColor=U.clone(s,this._lastOutlineColor),this._lastDistanceDisplayCondition=B,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let C=this._primitive,v=this._outlinePrimitive;C.show=!0,v.show=!0,C.appearance.material=c;let I=this._attributes;l(I)||(I=C.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=En.toValue(r,I.show),this._lastShow=r);let M=this._outlineAttributes;l(M)||(M=v.getGeometryInstanceAttributes(t),this._outlineAttributes=M),a!==this._lastOutlineShow&&(M.show=En.toValue(a,M.show),this._lastOutlineShow=a),U.equals(s,this._lastOutlineColor)||(M.color=Yt.toValue(s,M.color),U.clone(s,this._lastOutlineColor)),kt.equals(B,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=qn.toValue(B,I.distanceDisplayCondition),M.distanceDisplayCondition=qn.toValue(B,M.distanceDisplayCondition),kt.clone(B,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(I.offset=po.toValue(L,I.offset),M.offset=po.toValue(L,I.offset),h.clone(L,this._lastOffset))}S&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=R.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var RV=mf;function Mv(e){e=e??G.EMPTY_OBJECT;let t=e.vertexFormat??Ne.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}Mv.packedLength=Ne.packedLength;Mv.pack=function(e,t,n){return n=n??0,Ne.pack(e._vertexFormat,t,n),t};var hye=new Ne,Mut={vertexFormat:hye};Mv.unpack=function(e,t,n){t=t??0;let i=Ne.unpack(e,t,hye);return l(n)?(n._vertexFormat=Ne.clone(i,n._vertexFormat),n):new Mv(Mut)};var OV=new h(-.5,-.5,0),MV=new h(.5,.5,0);Mv.createGeometry=function(e){let t=e._vertexFormat,n=new _n,i,o;if(t.position){if(o=new Float64Array(12),o[0]=OV.x,o[1]=OV.y,o[2]=0,o[3]=MV.x,o[4]=OV.y,o[5]=0,o[6]=MV.x,o[7]=MV.y,o[8]=0,o[9]=OV.x,o[10]=MV.y,o[11]=0,n.position=new Me({componentDatatype:Y.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 Me({componentDatatype:Y.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 Me({componentDatatype:Y.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 Me({componentDatatype:Y.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 Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new At({attributes:n,indices:i,primitiveType:Re.TRIANGLES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var BV=Mv;function Bv(){this._workerName="createPlaneOutlineGeometry"}Bv.packedLength=0;Bv.pack=function(e,t){return t};Bv.unpack=function(e,t,n){return l(n)?n:new Bv};var PA=new h(-.5,-.5,0),LV=new h(.5,.5,0);Bv.createGeometry=function(){let e=new _n,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=PA.x,n[1]=PA.y,n[2]=PA.z,n[3]=LV.x,n[4]=PA.y,n[5]=PA.z,n[6]=LV.x,n[7]=LV.y,n[8]=PA.z,n[9]=PA.x,n[10]=LV.y,n[11]=PA.z,e.position=new Me({componentDatatype:Y.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 At({attributes:e,indices:t,primitiveType:Re.LINES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var NV=Bv;var But=new h,mye=new U;function Lut(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Pd(e,t){Ci.call(this,{entity:e,scene:t,geometryOptions:new Lut(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Pd.prototype=Object.create(Ci.prototype),Pd.prototype.constructor=Pd);Pd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=qn.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof Wt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,mye)),l(g)||(g=U.WHITE),o=Yt.fromColor(g),i={show:r,distanceDisplayCondition:s,color:o}}else i={show:r,distanceDisplayCondition:s};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=M$(d,p,f,f),new Bt({id:t,geometry:new BV(this._options),modelMatrix:f,attributes:i})};Pd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,mye),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,a=this._options,s=t.computeModelMatrix(e),c=X.getValueOrDefault(r.plane,e,a.plane),u=X.getValueOrUndefined(r.dimensions,e,a.dimensions);return a.plane=c,a.dimensions=u,s=M$(c,u,s,s),new Bt({id:t,geometry:new NV,modelMatrix:s,attributes:{show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:qn.fromDistanceDisplayCondition(o)}})};Pd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Ci.prototype._isHidden.call(this,e,t)};Pd.prototype._getIsClosed=function(e){return!1};Pd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Pd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Wt,i=this._options;i.vertexFormat=n?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Qe.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Qe.MINIMUM_VALUE,i.dimensions)};Pd.DynamicGeometryUpdater=Lv;function Lv(e,t,n){Ti.call(this,e,t,n)}l(Object.create)&&(Lv.prototype=Object.create(Ti.prototype),Lv.prototype.constructor=Lv);Lv.prototype._isHidden=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(e.position,n,But);return!l(o)||!l(i.plane)||!l(i.dimensions)||Ti.prototype._isHidden.call(this,e,t,n)};Lv.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var Nut=new h,Fut=new h,kut=new h,zut=new h,Uut=new $,Vut=new $,jut=new R;function M$(e,t,n,i){let o=e.normal,r=e.distance,a=h.multiplyByScalar(o,-r,kut),s=h.clone(h.UNIT_Z,Fut);D.equalsEpsilon(Math.abs(h.dot(s,o)),1,D.EPSILON8)&&(s=h.clone(h.UNIT_Y,s));let c=h.cross(s,o,Nut);s=h.cross(o,c,s),h.normalize(c,c),h.normalize(s,s);let u=Uut;$.setColumn(u,0,c,u),$.setColumn(u,1,s,u),$.setColumn(u,2,o,u);let f=h.fromElements(t.x,t.y,1,zut),d=$.multiplyByScale(u,f,Vut),p=R.fromRotationTranslation(d,a,jut);return R.multiplyTransformation(n,p,i)}Pd.createPrimitiveMatrix=M$;var FV=Pd;var Gut=new h,Hut=new Je,Wut=new z,qut=new z,Yut=new h,Xut=new h,Kut=new h,WP=new h,Qut=new h,$ut=new h,pye=new Le,Jut=new $,Zut=new $,eft=new h;function tft(e,t,n,i,o,r,a,s,c){let u=e.positions,f=ni.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=Ue.createTypedArray(u.length,f.length);d.set(f);let p=Jut;if(i!==0){let _=Le.fromAxisAngle(a,i,pye);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(a,-i,pye);let C=$.fromQuaternion(_,Zut);s=h.normalize($.multiplyByVector(C,s,s),s),t.bitangent&&(c=h.normalize(h.cross(a,s,c),c))}}else p=$.clone($.IDENTITY,p);let g=qut;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,A=m*3,y=new Float64Array(A),x=t.normal?new Float32Array(A):void 0,b=t.tangent?new Float32Array(A):void 0,T=t.bitangent?new Float32Array(A):void 0,E=t.st?new Float32Array(m*2):void 0,S=0,w=0,P=0,O=0,B=0;for(let _=0;_<m;_++){let C=u[_];if(y[S++]=C.x,y[S++]=C.y,y[S++]=C.z,t.st)if(l(o)&&o.positions.length===m)E[B++]=o.positions[_].x,E[B++]=o.positions[_].y;else{let v=$.multiplyByVector(p,C,Gut),I=r(v,Wut);z.subtract(I,g,I);let M=D.clamp(I.x/n.width,0,1),N=D.clamp(I.y/n.height,0,1);E[B++]=M,E[B++]=N}t.normal&&(x[w++]=a.x,x[w++]=a.y,x[w++]=a.z),t.tangent&&(b[O++]=s.x,b[O++]=s.y,b[O++]=s.z),t.bitangent&&(T[P++]=c.x,T[P++]=c.y,T[P++]=c.z)}let L=new _n;return t.position&&(L.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y})),t.normal&&(L.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(L.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),t.bitangent&&(L.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(L.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:E})),new At({attributes:L,indices:d,primitiveType:Re.TRIANGLES})}function hb(e){e=e??G.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Ne.DEFAULT;this._vertexFormat=Ne.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Kn.computeHierarchyPackedLength(t,h)+Ne.packedLength+te.packedLength+(l(n)?Kn.computeHierarchyPackedLength(n,z):1)+2}hb.fromPositions=function(e){e=e??G.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new hb(t)};hb.pack=function(e,t,n){return n=n??0,n=Kn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,Ne.pack(e._vertexFormat,t,n),n+=Ne.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Kn.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var nft=te.clone(te.UNIT_SPHERE),ift=new Ne,oft={polygonHierarchy:{}};hb.unpack=function(e,t,n){t=t??0;let i=Kn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,nft);t+=te.packedLength;let r=Ne.unpack(e,t,ift);t+=Ne.packedLength;let a=e[t++],s=e[t]===-1?void 0:Kn.unpackPolygonHierarchy(e,t,z);l(s)?(t=s.startingIndex,delete s.startingIndex):t++;let c=e[t++];return l(n)||(n=new hb(oft)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=Ne.clone(r,n._vertexFormat),n._stRotation=a,n._textureCoordinates=s,n.packedLength=c,n};hb.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),a=n.positions;if(a=Fo(a,h.equalsEpsilon,!0),a.length<3)return;let s=Yut,c=Xut,u=Kut,f=Qut,d=$ut;if(!lA.computeProjectTo2DArguments(a,WP,f,d))return;if(s=h.cross(f,d,s),s=h.normalize(s,s),!h.equalsEpsilon(WP,h.ZERO,D.EPSILON6)){let B=e._ellipsoid.geodeticSurfaceNormal(WP,eft);h.dot(s,B)<0&&(s=h.negate(s,s),f=h.negate(f,f))}let g=lA.createProjectPointsTo2DFunction(WP,f,d),m=lA.createProjectPointTo2DFunction(WP,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let A=Kn.polygonsFromHierarchy(n,r,g,!1),y=A.hierarchy,x=A.polygons,b=function(B){return B},T=r?Kn.polygonsFromHierarchy(o,!0,b,!1).polygons:void 0;if(y.length===0)return;a=y[0].outerRing;let E=ce.fromPoints(a),S=Kn.computeBoundingRectangle(s,m,a,i,Hut),w=[];for(let B=0;B<x.length;B++){let L=new Bt({geometry:tft(x[B],t,S,i,r?T[B]:void 0,m,s,c,u)});w.push(L)}let P=kn.combineInstances(w)[0];P.attributes.position.values=new Float64Array(P.attributes.position.values),P.indices=Ue.createTypedArray(P.attributes.position.values.length/3,P.indices);let O=P.attributes;return t.position||delete O.position,new At({attributes:O,indices:P.indices,primitiveType:P.primitiveType,boundingSphere:E})};var kV=hb;var gye=[],zV=[];function rft(e,t,n,i,o){let a=za.fromPoints(t,e).projectPointsOntoPlane(t,gye);ni.computeWindingOrder2D(a)===ns.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],A=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=A.x,c[d++]=A.y,c[d++]=A.z}else{let m=0;if(o===rn.GEODESIC)for(u=0;u<f;u++)m+=Kn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===rn.RHUMB)for(u=0;u<f;u++)m+=Kn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let A;o===rn.GEODESIC?A=Kn.subdivideLine(t[u],t[(u+1)%f],n,zV):o===rn.RHUMB&&(A=Kn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,zV));let y=A.length;for(let x=0;x<y;++x)c[d++]=A[x]}}f=c.length/3;let p=f*2,g=Ue.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d++]=0,new Bt({geometry:new At({attributes:new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Re.LINES})})}function aft(e,t,n,i,o){let a=za.fromPoints(t,e).projectPointsOntoPlane(t,gye);ni.computeWindingOrder2D(a)===ns.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let y=t[u],x=t[(u+1)%f];c[p++]=y.x,c[p++]=y.y,c[p++]=y.z,c[p++]=x.x,c[p++]=x.y,c[p++]=x.z}else{let y=0;if(o===rn.GEODESIC)for(u=0;u<f;u++)y+=Kn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===rn.RHUMB)for(u=0;u<f;u++)y+=Kn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(y*3*2),u=0;u<f;++u){d[u]=p/3;let x;o===rn.GEODESIC?x=Kn.subdivideLine(t[u],t[(u+1)%f],n,zV):o===rn.RHUMB&&(x=Kn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,zV));let b=x.length;for(let T=0;T<b;++T)c[p++]=x[T]}}f=c.length/6;let g=d.length,m=(f*2+g)*2,A=Ue.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)A[p++]=u,A[p++]=(u+1)%f,A[p++]=u+f,A[p++]=(u+1)%f+f;for(u=0;u<g;u++){let y=d[u];A[p++]=y,A[p++]=y+f}return new Bt({geometry:new At({attributes:new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:A,primitiveType:Re.LINES})})}function mb(e){let t=e.polygonHierarchy,n=e.ellipsoid??te.default,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),a=e.arcType??rn.GEODESIC,s=e.height??0,c=e.extrudedHeight??s;if(!r){let u=Math.max(s,c);c=Math.min(s,c),s=u}this._ellipsoid=te.clone(n),this._granularity=i,this._height=s,this._extrudedHeight=c,this._arcType=a,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Kn.computeHierarchyPackedLength(t,h)+te.packedLength+8}mb.pack=function(e,t,n){return n=n??0,n=Kn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.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++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var sft=te.clone(te.UNIT_SPHERE),cft={polygonHierarchy:{}};mb.unpack=function(e,t,n){t=t??0;let i=Kn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,sft);t+=te.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new mb(cft)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=a,n._granularity=s,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};mb.fromPositions=function(e){e=e??G.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 mb(t)};mb.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,a=Kn.polygonOutlinesFromHierarchy(i,!o,t);if(a.length===0)return;let s,c=[],u=D.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!D.equalsEpsilon(f,d,0,D.EPSILON2),g,m;if(p)for(m=0;m<a.length;m++){if(s=aft(t,a[m],u,o,r),s.geometry=Kn.scaleToGeodeticHeightExtruded(s.geometry,f,d,t,o),l(e._offsetAttribute)){let x=s.geometry.attributes.position.values.length/3,b=new Uint8Array(x);e._offsetAttribute===ln.TOP?b=b.fill(1,0,x/2):(g=e._offsetAttribute===ln.NONE?0:1,b=b.fill(g)),s.geometry.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}c.push(s)}else for(m=0;m<a.length;m++){if(s=rft(t,a[m],u,o,r),s.geometry.attributes.position.values=ni.scaleToGeodeticHeight(s.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let x=s.geometry.attributes.position.values.length;g=e._offsetAttribute===ln.NONE?0:1;let b=new Uint8Array(x/3).fill(g);s.geometry.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}c.push(s)}let A=kn.combineInstances(c)[0],y=ce.fromVertices(A.attributes.position.values);return new At({attributes:A.attributes,indices:A.indices,primitiveType:A.primitiveType,boundingSphere:y,offsetAttribute:e._offsetAttribute})};var UV=mb;var _ye="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Aye="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",yye=new U,xye=h.ZERO,bye=new h,Tye=new oe,lft=[],uft=new z;function fft(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 pf(e,t){Zn.call(this,{entity:e,scene:t,geometryOptions:new fft(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(pf.prototype=Object.create(Zn.prototype),pf.prototype.constructor=pf);pf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,yye)),l(a)||(a=U.WHITE),o.color=Yt.fromColor(a)}l(i.offsetAttribute)&&(o.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,xye,bye)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new kV(i):r=new F_(i),new Bt({id:t,geometry:r,attributes:o})};pf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,yye),r=this._distanceDisplayConditionProperty.getValue(e),a={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(o),distanceDisplayCondition:qn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(a.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,xye,bye)));let s;return i.perPositionHeight&&!l(i.extrudedHeight)?s=new Dh(i):s=new UV(i),new Bt({id:t,geometry:s,attributes:a})};pf.prototype._computeCenter=function(e,t){let n=X.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=za.fromPoints(i,o),a=r.projectPointsOntoPlane(i,lft),s=a.length,c=0,u=s-1,f=new z;for(let p=0;p<s;u=p++){let g=a[p],m=a[u],A=g.x*m.y-m.x*g.y,y=z.add(g,m,uft);y=z.multiplyByScalar(y,A,y),f=z.add(f,y,f),c+=A}let d=1/(c*3);return f=z.multiplyByScalar(f,d,f),r.projectPointOntoEllipsoid(f,t)};pf.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Ci.prototype._isHidden.call(this,e,t)};pf.prototype._isOnTerrain=function(e,t){let n=Zn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Qe.MINIMUM_VALUE):!0);return n&&!o};pf.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};pf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Wt,i=this._options;i.vertexFormat=n?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Qe.MINIMUM_VALUE),r=X.getValueOrUndefined(t.height,Qe.MINIMUM_VALUE),a=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,nt.NONE),s=X.getValueOrUndefined(t.extrudedHeight,Qe.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,Qe.MINIMUM_VALUE,nt.NONE),u=X.getValueOrDefault(t.perPositionHeight,Qe.MINIMUM_VALUE,!1);r=Zn.getGeometryHeight(r,a);let f;if(u?(l(r)&&(r=void 0,_t(_ye)),a!==nt.NONE&&u&&(r=void 0,_t(Aye))):(l(s)&&!l(r)&&(r=0),f=Zn.computeGeometryOffsetAttribute(r,a,s,c)),i.polygonHierarchy=o,i.granularity=X.getValueOrUndefined(t.granularity,Qe.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,Qe.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,Qe.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,Qe.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,Qe.MINIMUM_VALUE,rn.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,Qe.MINIMUM_VALUE),s=Zn.getGeometryExtrudedHeight(s,c),s===Zn.CLAMP_TO_GROUND){let d=F_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Tye);s=wi.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=s};pf.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)};pf.DynamicGeometryUpdater=Nv;function Nv(e,t,n){Ti.call(this,e,t,n)}l(Object.create)&&(Nv.prototype=Object.create(Ti.prototype),Nv.prototype.constructor=Nv);Nv.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Ti.prototype._isHidden.call(this,e,t,n)};Nv.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,nt.NONE),a=X.getValueOrDefault(t.extrudedHeightReference,n,nt.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);o=Zn.getGeometryHeight(o,a);let u;if(c?(l(o)&&(o=void 0,_t(_ye)),r!==nt.NONE&&c&&(o=void 0,_t(Aye))):(l(s)&&!l(o)&&(o=0),u=Zn.computeGeometryOffsetAttribute(o,r,s,a)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,n,rn.GEODESIC),s=Zn.getGeometryExtrudedHeight(s,a),s===Zn.CLAMP_TO_GROUND){let f=F_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Tye);s=wi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=s};var VV=pf;function dft(e,t,n,i){let o=new _n;i.position&&(o.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,a=e.length/3,s=(a-r*2)/(r*2),c=ni.triangulate(t),u=(s-1)*r*6+c.length*2,f=Ue.createTypedArray(a,u),d,p,g,m,A,y,x=r*2,b=0;for(d=0;d<s-1;d++){for(p=0;p<r-1;p++)g=p*2+d*r*2,y=g+x,m=g+1,A=m+x,f[b++]=m,f[b++]=g,f[b++]=A,f[b++]=A,f[b++]=g,f[b++]=y;g=r*2-2+d*r*2,m=g+1,A=m+x,y=g+x,f[b++]=m,f[b++]=g,f[b++]=A,f[b++]=A,f[b++]=g,f[b++]=y}if(i.st||i.tangent||i.bitangent){let S=new Float32Array(a*2),w=1/(s-1),P=1/n.height,O=n.height/2,B,L,_=0;for(d=0;d<s;d++){for(B=d*w,L=P*(t[0].y+O),S[_++]=B,S[_++]=L,p=1;p<r;p++)L=P*(t[p].y+O),S[_++]=B,S[_++]=L,S[_++]=B,S[_++]=L;L=P*(t[0].y+O),S[_++]=B,S[_++]=L}for(p=0;p<r;p++)B=0,L=P*(t[p].y+O),S[_++]=B,S[_++]=L;for(p=0;p<r;p++)B=(s-1)*w,L=P*(t[p].y+O),S[_++]=B,S[_++]=L;o.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:new Float32Array(S)})}let T=a-r*2;for(d=0;d<c.length;d+=3){let S=c[d]+T,w=c[d+1]+T,P=c[d+2]+T;f[b++]=S,f[b++]=w,f[b++]=P,f[b++]=P+r,f[b++]=w+r,f[b++]=S+r}let E=new At({attributes:o,indices:f,boundingSphere:ce.fromVertices(e),primitiveType:Re.TRIANGLES});if(i.normal&&(E=kn.computeNormal(E)),i.tangent||i.bitangent){try{E=kn.computeTangentAndBitangent(E)}catch{_t("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(E.attributes.tangent=void 0),i.bitangent||(E.attributes.bitangent=void 0),i.st||(E.attributes.st=void 0)}return E}function YP(e){e=e??G.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??Ji.ROUNDED,this._vertexFormat=Ne.clone(e.vertexFormat??Ne.DEFAULT),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+te.packedLength+Ne.packedLength+2}YP.pack=function(e,t,n){n=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 a=e._shape;for(r=a.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Ne.pack(e._vertexFormat,t,n),n+=Ne.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Cye=te.clone(te.UNIT_SPHERE),Eye=new Ne,qP={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Cye,vertexFormat:Eye,cornerType:void 0,granularity:void 0};YP.unpack=function(e,t,n){t=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 a=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)a[i]=z.unpack(e,t);let s=te.unpack(e,t,Cye);t+=te.packedLength;let c=Ne.unpack(e,t,Eye);t+=Ne.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._vertexFormat=Ne.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(qP.polylinePositions=r,qP.shapePositions=a,qP.cornerType=u,qP.granularity=f,new YP(qP))};var hft=new Je;YP.createGeometry=function(e){let t=e._positions,n=Fo(t,h.equalsEpsilon),i=e._shape;if(i=dp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ni.computeWindingOrder2D(i)===ns.CLOCKWISE&&i.reverse();let o=Je.fromPoints(i,hft),r=dp.computePositions(n,i,o,e,!0);return dft(r,i,o,e._vertexFormat)};var jV=YP;function mft(e,t){let n=new _n;n.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,a=e.length/3/i,s=Ue.createTypedArray(o,2*i*(a+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)s[f++]=u+d,s[f++]=u+d+1;for(s[f++]=i-1+d,s[f++]=d,c=a-1,d=c*i,u=0;u<i-1;u++)s[f++]=u+d,s[f++]=u+d+1;for(s[f++]=i-1+d,s[f++]=d,c=0;c<a-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)s[f++]=u+g,s[f++]=u+m}return new At({attributes:n,indices:Ue.createTypedArray(o,s),boundingSphere:ce.fromVertices(e),primitiveType:Re.LINES})}function KP(e){e=e??G.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??Ji.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+te.packedLength+2}KP.pack=function(e,t,n){n=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 a=e._shape;for(r=a.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var vye=te.clone(te.UNIT_SPHERE),XP={polylinePositions:void 0,shapePositions:void 0,ellipsoid:vye,height:void 0,cornerType:void 0,granularity:void 0};KP.unpack=function(e,t,n){t=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 a=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)a[i]=z.unpack(e,t);let s=te.unpack(e,t,vye);t+=te.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(XP.polylinePositions=r,XP.shapePositions=a,XP.cornerType=c,XP.granularity=u,new KP(XP))};var pft=new Je;KP.createGeometry=function(e){let t=e._positions,n=Fo(t,h.equalsEpsilon),i=e._shape;if(i=dp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ni.computeWindingOrder2D(i)===ns.CLOCKWISE&&i.reverse();let o=Je.fromPoints(i,pft),r=dp.computePositions(n,i,o,e,!1);return mft(r,i)};var GV=KP;var Sye=new U;function gft(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 bp(e,t){Ci.call(this,{entity:e,scene:t,geometryOptions:new gft(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(bp.prototype=Object.create(Ci.prototype),bp.prototype.constructor=bp);bp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=qn.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof Wt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Sye)),l(c)||(c=U.WHITE),o=Yt.fromColor(c),i={show:r,distanceDisplayCondition:s,color:o}}else i={show:r,distanceDisplayCondition:s};return new Bt({id:t,geometry:new jV(this._options),attributes:i})};bp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Sye),o=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new GV(this._options),attributes:{show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:qn.fromDistanceDisplayCondition(o)}})};bp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Ci.prototype._isHidden.call(this,e,t)};bp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};bp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Wt;o.vertexFormat=r?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Qe.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Qe.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Qe.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Qe.MINIMUM_VALUE):void 0};bp.DynamicGeometryUpdater=Fv;function Fv(e,t,n){Ti.call(this,e,t,n)}l(Object.create)&&(Fv.prototype=Object.create(Ti.prototype),Fv.prototype.constructor=Fv);Fv.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Ti.prototype._isHidden.call(this,e,t,n)};Fv.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var HV=bp;var B$=new h,Dye=new h,Pye=new h,Rye=new h,Oye=new oe,_ft=new z,Aft=new ce,yft=new ce;function Mye(e,t){let n=new At({attributes:new _n,primitiveType:Re.TRIANGLES});return n.attributes.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function xft(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,a=t.tangent?new Float32Array(o):void 0,s=t.bitangent?new Float32Array(o):void 0,c=0,u=Rye,f=Pye,d=Dye;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=h.fromArray(e,p,B$),m=c+1,A=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(r[c]=d.x,r[m]=d.y,r[A]=d.z),t.tangent&&(a[c]=f.x,a[m]=f.y,a[A]=f.z),t.bitangent&&(s[c]=u.x,s[m]=u.y,s[A]=u.z),c+=3}return Mye(t,{positions:e,normals:r,tangents:a,bitangents:s})}var L$=new h,Bye=new h;function bft(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,a=t.bitangent?new Float32Array(i):void 0,s=0,c=0,u=0,f=!0,d=Rye,p=Pye,g=Dye;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let A=h.fromArray(e,m,B$),y=h.fromArray(e,(m+6)%i,L$);if(f){let x=h.fromArray(e,(m+3)%i,Bye);h.subtract(y,A,y),h.subtract(x,A,x),g=h.normalize(h.cross(x,y,g),g),f=!1}h.equalsEpsilon(y,A,D.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(A,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(o[s++]=g.x,o[s++]=g.y,o[s++]=g.z,o[s++]=g.x,o[s++]=g.y,o[s++]=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&&(a[u++]=d.x,a[u++]=d.y,a[u++]=d.z,a[u++]=d.x,a[u++]=d.y,a[u++]=d.z)}return Mye(t,{positions:e,normals:o,tangents:r,bitangents:a})}function Lye(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,a=t.northCap,s=t.southCap,c=0,u=o,f=o,d=0;a&&(c=1,f-=1,d+=1),s&&(u-=1,f-=1,d+=1),d+=r*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,A=0,y=B$,x=_ft,b=Number.MAX_VALUE,T=Number.MAX_VALUE,E=-Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let C=c;C<u;++C)for(let v=0;v<r;++v)Ms.computePosition(t,i,n.st,C,v,y,x),p[m++]=y.x,p[m++]=y.y,p[m++]=y.z,n.st&&(g[A++]=x.x,g[A++]=x.y,b=Math.min(b,x.x),T=Math.min(T,x.y),E=Math.max(E,x.x),S=Math.max(S,x.y));if(a&&(Ms.computePosition(t,i,n.st,0,0,y,x),p[m++]=y.x,p[m++]=y.y,p[m++]=y.z,n.st&&(g[A++]=x.x,g[A++]=x.y,b=x.x,T=x.y,E=x.x,S=x.y)),s&&(Ms.computePosition(t,i,n.st,o-1,0,y,x),p[m++]=y.x,p[m++]=y.y,p[m]=y.z,n.st&&(g[A++]=x.x,g[A]=x.y,b=Math.min(b,x.x),T=Math.min(T,x.y),E=Math.max(E,x.x),S=Math.max(S,x.y))),n.st&&(b<0||T<0||E>1||S>1))for(let C=0;C<g.length;C+=2)g[C]=(g[C]-b)/(E-b),g[C+1]=(g[C+1]-T)/(S-T);let w=xft(p,n,i,t.tangentRotationMatrix),P=6*(r-1)*(f-1);a&&(P+=3*(r-1)),s&&(P+=3*(r-1));let O=Ue.createTypedArray(d,P),B=0,L=0,_;for(_=0;_<f-1;++_){for(let C=0;C<r-1;++C){let v=B,I=v+r,M=I+1,N=v+1;O[L++]=v,O[L++]=I,O[L++]=N,O[L++]=N,O[L++]=I,O[L++]=M,++B}++B}if(a||s){let C=d-1,v=d-1;a&&s&&(C=d-2);let I,M;if(B=0,a)for(_=0;_<r-1;_++)I=B,M=I+1,O[L++]=C,O[L++]=I,O[L++]=M,++B;if(s)for(B=(f-1)*r,_=0;_<r-1;_++)I=B,M=I+1,O[L++]=I,O[L++]=v,O[L++]=M,++B}return w.indices=O,n.st&&(w.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),w}function kv(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 zv(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 N$=new Ne;function Tft(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,a=e._surfaceHeight,s=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Pe=Ne.clone(o,N$);Pe.normal=!0,e._vertexFormat=Pe}let d=Lye(e,t);n&&(e._vertexFormat=o);let p=ni.scaleToGeodeticHeight(d.attributes.position.values,a,s,!1);p=new Float64Array(p);let g=p.length,m=g*2,A=new Float64Array(m);A.set(p);let y=ni.scaleToGeodeticHeight(d.attributes.position.values,r,s);A.set(y,g),d.attributes.position.values=A;let x=o.normal?new Float32Array(m):void 0,b=o.tangent?new Float32Array(m):void 0,T=o.bitangent?new Float32Array(m):void 0,E=o.st?new Float32Array(m/3*2):void 0,S,w;if(o.normal){for(w=d.attributes.normal.values,x.set(w),f=0;f<g;f++)w[f]=-w[f];x.set(w,g),d.attributes.normal.values=x}if(n){w=d.attributes.normal.values,o.normal||(d.attributes.normal=void 0);let Pe=new Float32Array(m);for(f=0;f<g;f++)w[f]=-w[f];Pe.set(w,g),d.attributes.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:Pe})}let P,O=l(i);if(O){let Pe=g/3*2,Ye=new Uint8Array(Pe);i===ln.TOP?Ye=Ye.fill(1,0,Pe/2):(P=i===ln.NONE?0:1,Ye=Ye.fill(P)),d.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ye})}if(o.tangent){let Pe=d.attributes.tangent.values;for(b.set(Pe),f=0;f<g;f++)Pe[f]=-Pe[f];b.set(Pe,g),d.attributes.tangent.values=b}if(o.bitangent){let Pe=d.attributes.bitangent.values;T.set(Pe),T.set(Pe,g),d.attributes.bitangent.values=T}o.st&&(S=d.attributes.st.values,E.set(S),E.set(S,g/3*2),d.attributes.st.values=E);let B=d.indices,L=B.length,_=g/3,C=Ue.createTypedArray(m/3,L*2);for(C.set(B),f=0;f<L;f+=3)C[f+L]=B[f+2]+_,C[f+1+L]=B[f+1]+_,C[f+2+L]=B[f]+_;d.indices=C;let v=t.northCap,I=t.southCap,M=c,N=2,j=0,k=4,V=4;v&&(N-=1,M-=1,j+=1,k-=2,V-=1),I&&(N-=1,M-=1,j+=1,k-=2,V-=1),j+=N*u+2*M-k;let F=(j+V)*2,W=new Float64Array(F*3),q=n?new Float32Array(F*3):void 0,J=O?new Uint8Array(F):void 0,H=o.st?new Float32Array(F*2):void 0,Z=i===ln.TOP;O&&!Z&&(P=i===ln.ALL?1:0,J=J.fill(P));let K=0,le=0,me=0,ae=0,be=u*M,ge;for(f=0;f<be;f+=u)ge=f*3,W=kv(W,K,ge,p,y),K+=6,o.st&&(H=zv(H,le,f*2,S),le+=4),n&&(me+=3,q[me++]=w[ge],q[me++]=w[ge+1],q[me++]=w[ge+2]),Z&&(J[ae++]=1,ae+=1);if(I){let Pe=v?be+1:be;for(ge=Pe*3,f=0;f<2;f++)W=kv(W,K,ge,p,y),K+=6,o.st&&(H=zv(H,le,Pe*2,S),le+=4),n&&(me+=3,q[me++]=w[ge],q[me++]=w[ge+1],q[me++]=w[ge+2]),Z&&(J[ae++]=1,ae+=1)}else for(f=be-u;f<be;f++)ge=f*3,W=kv(W,K,ge,p,y),K+=6,o.st&&(H=zv(H,le,f*2,S),le+=4),n&&(me+=3,q[me++]=w[ge],q[me++]=w[ge+1],q[me++]=w[ge+2]),Z&&(J[ae++]=1,ae+=1);for(f=be-1;f>0;f-=u)ge=f*3,W=kv(W,K,ge,p,y),K+=6,o.st&&(H=zv(H,le,f*2,S),le+=4),n&&(me+=3,q[me++]=w[ge],q[me++]=w[ge+1],q[me++]=w[ge+2]),Z&&(J[ae++]=1,ae+=1);if(v){let Pe=be;for(ge=Pe*3,f=0;f<2;f++)W=kv(W,K,ge,p,y),K+=6,o.st&&(H=zv(H,le,Pe*2,S),le+=4),n&&(me+=3,q[me++]=w[ge],q[me++]=w[ge+1],q[me++]=w[ge+2]),Z&&(J[ae++]=1,ae+=1)}else for(f=u-1;f>=0;f--)ge=f*3,W=kv(W,K,ge,p,y),K+=6,o.st&&(H=zv(H,le,f*2,S),le+=4),n&&(me+=3,q[me++]=w[ge],q[me++]=w[ge+1],q[me++]=w[ge+2]),Z&&(J[ae++]=1,ae+=1);let we=bft(W,o,s);o.st&&(we.attributes.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:H})),n&&(we.attributes.extrudeDirection=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:q})),O&&(we.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:J}));let Ee=Ue.createTypedArray(F,j*6),Be,ke,Ge,rt;g=W.length/3;let et=0;for(f=0;f<g-1;f+=2){Be=f,rt=(Be+2)%g;let Pe=h.fromArray(W,Be*3,L$),Ye=h.fromArray(W,rt*3,Bye);h.equalsEpsilon(Pe,Ye,D.EPSILON10)||(ke=(Be+1)%g,Ge=(ke+2)%g,Ee[et++]=Be,Ee[et++]=ke,Ee[et++]=rt,Ee[et++]=rt,Ee[et++]=ke,Ee[et++]=Ge)}return we.indices=Ee,we=kn.combineInstances([new Bt({geometry:d}),new Bt({geometry:we})]),we[0]}var Cft=[new h,new h,new h,new h],Nye=new de,Eft=new de;function F$(e,t,n,i,o){if(n===0)return oe.clone(e,o);let r=Ms.computeOptions(e,t,n,0,Oye,Nye),a=r.height,s=r.width,c=Cft;return Ms.computePosition(r,i,!1,0,0,c[0]),Ms.computePosition(r,i,!1,0,s-1,c[1]),Ms.computePosition(r,i,!1,a-1,0,c[2]),Ms.computePosition(r,i,!1,a-1,s-1,c[3]),oe.fromCartesianArray(c,i,o)}function Tp(e){e=e??G.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=oe.clone(t),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Ne.clone(e.vertexFormat??Ne.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Tp.packedLength=oe.packedLength+te.packedLength+Ne.packedLength+7;Tp.pack=function(e,t,n){return n=n??0,oe.pack(e._rectangle,t,n),n+=oe.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,Ne.pack(e._vertexFormat,t,n),n+=Ne.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]=e._offsetAttribute??-1,t};var Fye=new oe,kye=te.clone(te.UNIT_SPHERE),RA={rectangle:Fye,ellipsoid:kye,vertexFormat:N$,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Tp.unpack=function(e,t,n){t=t??0;let i=oe.unpack(e,t,Fye);t+=oe.packedLength;let o=te.unpack(e,t,kye);t+=te.packedLength;let r=Ne.unpack(e,t,N$);t+=Ne.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=oe.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=Ne.clone(r,n._vertexFormat),n._granularity=a,n._surfaceHeight=s,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(RA.granularity=a,RA.height=s,RA.rotation=c,RA.stRotation=u,RA.extrudedHeight=f,RA.shadowVolume=d,RA.offsetAttribute=p===-1?void 0:p,new Tp(RA))};Tp.computeRectangle=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.ellipsoid??te.default,r=e.rotation??0;return F$(n,i,r,o,t)};var vft=new $,wye=new Le,Sft=new de;Tp.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,a=Ms.computeOptions(t,e._granularity,i,o,Oye,Nye,Eft),s=vft;if(o!==0||i!==0){let g=oe.center(t,Sft),m=n.geodeticSurfaceNormalCartographic(g,L$);Le.fromAxisAngle(m,-o,wye),$.fromQuaternion(wye,s)}else $.clone($.IDENTITY,s);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.EPSILON2);a.lonScalar=1/e._rectangle.width,a.latScalar=1/e._rectangle.height,a.tangentRotationMatrix=s;let d,p;if(t=e._rectangle,f){d=Tft(e,a);let g=ce.fromRectangle3D(t,n,c,yft),m=ce.fromRectangle3D(t,n,u,Aft);p=ce.union(g,m)}else{if(d=Lye(e,a),d.attributes.position.values=ni.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===ln.NONE?0:1,A=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}p=ce.fromRectangle3D(t,n,c)}return r.position||delete d.attributes.position,new At({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Tp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new Tp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:a,height:r,vertexFormat:Ne.POSITION_ONLY,shadowVolume:!0})};var Iye=new oe,wft=[new z,new z,new z],Ift=new Wi,Dft=new de;function Pft(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=oe.clone(e._rectangle,Iye),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=F$(t,n,o,i,Iye),a=wft;a[0].x=r.west,a[0].y=r.south,a[1].x=r.west,a[1].y=r.north,a[2].x=r.east,a[2].y=r.south;let s=e.rectangle,c=Wi.fromRotation(e._stRotation,Ift),u=oe.center(s,Dft);for(let m=0;m<3;++m){let A=a[m];A.x-=u.longitude,A.y-=u.latitude,Wi.multiplyByVector(c,A,A),A.x+=u.longitude,A.y+=u.latitude,A.x=(A.x-s.west)/s.width,A.y=(A.y-s.south)/s.height}let f=a[0],d=a[1],p=a[2],g=new Array(6);return z.pack(f,g),z.pack(d,g,2),z.pack(p,g,4),g}Object.defineProperties(Tp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=F$(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Pft(this)),this._textureCoordinateRotationPoints}}});var Uv=Tp;var zye=new U,Uye=h.ZERO,Vye=new h,jye=new oe,Rft=new oe,Oft=new de;function Mft(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 Nh(e,t){Zn.call(this,{entity:e,scene:t,geometryOptions:new Mft(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Nh.prototype=Object.create(Zn.prototype),Nh.prototype.constructor=Nh);Nh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,zye)),l(o)||(o=U.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Uye,Vye))),new Bt({id:t,geometry:new Uv(this._options),attributes:i})};Nh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,zye),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:qn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=po.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Uye,Vye))),new Bt({id:t,geometry:new $E(this._options),attributes:r})};Nh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,Rft);if(!l(n))return;let i=oe.center(n,Oft);return de.toCartesian(i,te.default,t)};Nh.prototype._isHidden=function(e,t){return!l(t.coordinates)||Ci.prototype._isHidden.call(this,e,t)};Nh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};Nh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Wt,i=X.getValueOrUndefined(t.height,Qe.MINIMUM_VALUE),o=X.getValueOrDefault(t.heightReference,Qe.MINIMUM_VALUE,nt.NONE),r=X.getValueOrUndefined(t.extrudedHeight,Qe.MINIMUM_VALUE),a=X.getValueOrDefault(t.extrudedHeightReference,Qe.MINIMUM_VALUE,nt.NONE);l(r)&&!l(i)&&(i=0);let s=this._options;s.vertexFormat=n?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat,s.rectangle=t.coordinates.getValue(Qe.MINIMUM_VALUE,s.rectangle),s.granularity=X.getValueOrUndefined(t.granularity,Qe.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,Qe.MINIMUM_VALUE),s.rotation=X.getValueOrUndefined(t.rotation,Qe.MINIMUM_VALUE),s.offsetAttribute=Zn.computeGeometryOffsetAttribute(i,o,r,a),s.height=Zn.getGeometryHeight(i,o),r=Zn.getGeometryExtrudedHeight(r,a),r===Zn.CLAMP_TO_GROUND&&(r=wi.getMinimumMaximumHeights(Uv.computeRectangle(s,jye)).minimumTerrainHeight),s.extrudedHeight=r};Nh.DynamicGeometryUpdater=Vv;function Vv(e,t,n){Ti.call(this,e,t,n)}l(Object.create)&&(Vv.prototype=Object.create(Ti.prototype),Vv.prototype.constructor=Vv);Vv.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ti.prototype._isHidden.call(this,e,t,n)};Vv.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,nt.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),s=X.getValueOrDefault(t.extrudedHeightReference,n,nt.NONE);l(a)&&!l(o)&&(o=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Zn.computeGeometryOffsetAttribute(o,r,a,s),i.height=Zn.getGeometryHeight(o,r),a=Zn.getGeometryExtrudedHeight(a,s),a===Zn.CLAMP_TO_GROUND&&(a=wi.getMinimumMaximumHeights(Uv.computeRectangle(i,jye)).minimumTerrainHeight),i.extrudedHeight=a};var WV=Nh;var Gye={};function Bft(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var Lft=new de,Nft=new de;function Fft(e,t,n,i){t=Fo(t,h.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),a=l(n),s=new Array(o),c=new Array(o),u=new Array(o),f=t[0];s[0]=f;let d=e.cartesianToCartographic(f,Lft);a&&(d.height=n[0]),c[0]=d.height,r?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,A=1;for(let y=1;y<o;++y){let x=t[y],b=e.cartesianToCartographic(x,Nft);a&&(b.height=n[y]),m=m&&b.height===0,Bft(d,b)?d.height<b.height&&(c[A-1]=b.height):(s[A]=x,c[A]=b.height,r?u[A]=i[y]:u[A]=0,m=m&&c[A]===u[A],de.clone(b,d),++A)}if(!(m||A<2))return s.length=A,c.length=A,u.length=A,{positions:s,topHeights:c,bottomHeights:u}}var kft=new Array(2),zft=new Array(2),Uft={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Gye.computePositions=function(e,t,n,i,o,r){let a=Fft(e,t,n,i);if(!l(a))return;t=a.positions,n=a.topHeights,i=a.bottomHeights;let s=t.length,c=s-2,u,f,d=D.chordLength(o,e.maximumRadius),p=Uft;if(p.minDistance=d,p.ellipsoid=e,r){let g=0,m;for(m=0;m<s-1;m++)g+=$i.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let A=kft,y=zft;p.positions=A,p.height=y;let x=0;for(m=0;m<s-1;m++){A[0]=t[m],A[1]=t[m+1],y[0]=n[m],y[1]=n[m+1];let b=$i.generateArc(p);u.set(b,x),y[0]=i[m],y[1]=i[m+1],f.set($i.generateArc(p),x),x+=b.length}}else p.positions=t,p.height=n,u=new Float64Array($i.generateArc(p)),p.height=i,f=new Float64Array($i.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var jv=Gye;var k$=new h,qV=new h,Vft=new h,Hye=new h,jft=new h,Gft=new h,Hft=new h;function pb(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??Ne.DEFAULT,r=e.granularity??D.RADIANS_PER_DEGREE,a=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Ne.clone(o),this._granularity=r,this._ellipsoid=te.clone(a),this._workerName="createWallGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+te.packedLength+Ne.packedLength+1}pb.pack=function(e,t,n){n=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 a=e._minimumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];let s=e._maximumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Ne.pack(e._vertexFormat,t,n),n+=Ne.packedLength,t[n]=e._granularity,t};var Wye=te.clone(te.UNIT_SPHERE),qye=new Ne,QP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Wye,vertexFormat:qye,granularity:void 0};pb.unpack=function(e,t,n){t=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 a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];let c=te.unpack(e,t,Wye);t+=te.packedLength;let u=Ne.unpack(e,t,qye);t+=Ne.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=te.clone(c,n._ellipsoid),n._vertexFormat=Ne.clone(u,n._vertexFormat),n._granularity=f,n):(QP.positions=r,QP.minimumHeights=a,QP.maximumHeights=s,QP.granularity=f,new pb(QP))};pb.fromConstantHeights=function(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,a=l(o),s=l(r);if(a||s){let u=t.length;n=a?new Array(u):void 0,i=s?new Array(u):void 0;for(let f=0;f<u;++f)a&&(n[f]=o),s&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new pb(c)};pb.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,a=e._ellipsoid,s=jv.computePositions(a,t,i,n,r,!0);if(!l(s))return;let c=s.bottomPositions,u=s.topPositions,f=s.numCorners,d=u.length,p=d*2,g=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,A=o.tangent?new Float32Array(p):void 0,y=o.bitangent?new Float32Array(p):void 0,x=o.st?new Float32Array(p/3*2):void 0,b=0,T=0,E=0,S=0,w=0,P=Hft,O=Gft,B=jft,L=!0;d/=3;let _,C=0,v=1/(d-f-1);for(_=0;_<d;++_){let k=_*3,V=h.fromArray(u,k,k$),F=h.fromArray(c,k,qV);if(o.position&&(g[b++]=F.x,g[b++]=F.y,g[b++]=F.z,g[b++]=V.x,g[b++]=V.y,g[b++]=V.z),o.st&&(x[w++]=C,x[w++]=0,x[w++]=C,x[w++]=1),o.normal||o.tangent||o.bitangent){let W=h.clone(h.ZERO,Hye),q=h.subtract(V,a.geodeticSurfaceNormal(V,qV),qV);if(_+1<d&&(W=h.fromArray(u,k+3,Hye)),L){let J=h.subtract(W,V,Vft),H=h.subtract(q,V,k$);P=h.normalize(h.cross(H,J,P),P),L=!1}h.equalsEpsilon(V,W,D.EPSILON10)?L=!0:(C+=v,o.tangent&&(O=h.normalize(h.subtract(W,V,O),O)),o.bitangent&&(B=h.normalize(h.cross(P,O,B),B))),o.normal&&(m[T++]=P.x,m[T++]=P.y,m[T++]=P.z,m[T++]=P.x,m[T++]=P.y,m[T++]=P.z),o.tangent&&(A[S++]=O.x,A[S++]=O.y,A[S++]=O.z,A[S++]=O.x,A[S++]=O.y,A[S++]=O.z),o.bitangent&&(y[E++]=B.x,y[E++]=B.y,y[E++]=B.z,y[E++]=B.x,y[E++]=B.y,y[E++]=B.z)}}let I=new _n;o.position&&(I.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(I.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),o.bitangent&&(I.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),o.st&&(I.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:x}));let M=p/3;p-=6*(f+1);let N=Ue.createTypedArray(M,p),j=0;for(_=0;_<M-2;_+=2){let k=_,V=_+2,F=h.fromArray(g,k*3,k$),W=h.fromArray(g,V*3,qV);if(h.equalsEpsilon(F,W,D.EPSILON10))continue;let q=_+1,J=_+3;N[j++]=q,N[j++]=k,N[j++]=J,N[j++]=J,N[j++]=k,N[j++]=V}return new At({attributes:I,indices:N,primitiveType:Re.TRIANGLES,boundingSphere:ce.fromVertices(g)})};var YV=pb;var Yye=new h,Xye=new h;function gb(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=te.clone(r),this._workerName="createWallOutlineGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+te.packedLength+1}gb.pack=function(e,t,n){n=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 a=e._minimumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];let s=e._maximumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n]=e._granularity,t};var Kye=te.clone(te.UNIT_SPHERE),$P={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Kye,granularity:void 0};gb.unpack=function(e,t,n){t=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 a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];let c=te.unpack(e,t,Kye);t+=te.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=te.clone(c,n._ellipsoid),n._granularity=u,n):($P.positions=r,$P.minimumHeights=a,$P.maximumHeights=s,$P.granularity=u,new gb($P))};gb.fromConstantHeights=function(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,a=l(o),s=l(r);if(a||s){let u=t.length;n=a?new Array(u):void 0,i=s?new Array(u):void 0;for(let f=0;f<u;++f)a&&(n[f]=o),s&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new gb(c)};gb.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,a=jv.computePositions(r,t,i,n,o,!1);if(!l(a))return;let s=a.bottomPositions,c=a.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let b=g*3,T=h.fromArray(c,b,Yye),E=h.fromArray(s,b,Xye);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let m=new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})}),A=f/3;f=2*A-4+A;let y=Ue.createTypedArray(A,f),x=0;for(g=0;g<A-2;g+=2){let b=g,T=g+2,E=h.fromArray(d,b*3,Yye),S=h.fromArray(d,T*3,Xye);if(h.equalsEpsilon(E,S,D.EPSILON10))continue;let w=g+1,P=g+3;y[x++]=w,y[x++]=b,y[x++]=w,y[x++]=P,y[x++]=b,y[x++]=T}return y[x++]=A-2,y[x++]=A-1,new At({attributes:m,indices:y,primitiveType:Re.LINES,boundingSphere:ce.fromVertices(d)})};var XV=gb;var Qye=new U;function Wft(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 Fh(e,t){Ci.call(this,{entity:e,scene:t,geometryOptions:new Wft(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Fh.prototype=Object.create(Ci.prototype),Fh.prototype.constructor=Fh);Fh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=qn.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof Wt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Qye)),l(c)||(c=U.WHITE),o=Yt.fromColor(c),i={show:r,distanceDisplayCondition:s,color:o}}else i={show:r,distanceDisplayCondition:s};return new Bt({id:t,geometry:new YV(this._options),attributes:i})};Fh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Qye),o=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new XV(this._options),attributes:{show:new En(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:qn.fromDistanceDisplayCondition(o)}})};Fh.prototype._isHidden=function(e,t){return!l(t.positions)||Ci.prototype._isHidden.call(this,e,t)};Fh.prototype._getIsClosed=function(e){return!1};Fh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};Fh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Wt,a=this._options;a.vertexFormat=r?hn.VERTEX_FORMAT:go.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(Qe.MINIMUM_VALUE,a.positions),a.minimumHeights=l(n)?n.getValue(Qe.MINIMUM_VALUE,a.minimumHeights):void 0,a.maximumHeights=l(i)?i.getValue(Qe.MINIMUM_VALUE,a.maximumHeights):void 0,a.granularity=l(o)?o.getValue(Qe.MINIMUM_VALUE):void 0};Fh.DynamicGeometryUpdater=Gv;function Gv(e,t,n){Ti.call(this,e,t,n)}l(Object.create)&&(Gv.prototype=Object.create(Ti.prototype),Gv.prototype.constructor=Gv);Gv.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ti.prototype._isHidden.call(this,e,t,n)};Gv.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var KV=Fh;var _b=[RF,cV,eV,PV,RV,FV,VV,HV,WV,KV];function Ab(e,t){this.entity=e,this.scene=t;let n=new Array(_b.length),i=new ye,o=new Yr;for(let r=0;r<n.length;r++){let a=new _b[r](e,t);o.add(a.geometryChanged,s=>{i.raiseEvent(s)}),n[r]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(Ab.prototype._onEntityPropertyChanged,this)}Ab.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)};Ab.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};Ab.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),fe(this)};Ab.registerUpdater=function(e){_b.includes(e)||_b.push(e)};Ab.unregisterUpdater=function(e){if(_b.includes(e)){let t=_b.indexOf(e);_b.splice(t,1)}};var Hv=Ab;var $ye=new U,qft=new kt,Yft=new kt,Xft=h.ZERO,Kft=new h;function kh(e,t,n,i,o,r,a){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=a,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Nt,this.updaters=new Nt,this.updatersWithAttributes=new Nt,this.attributes=new Nt,this.subscriptions=new Nt,this.showsUpdated=new Nt,this.itemsToRemove=[],this.invalidated=!1;let s;l(o)&&(s=o.definitionChanged.addEventListener(kh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}kh.prototype.onMaterialChanged=function(){this.invalidated=!0};kh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};kh.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};kh.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};kh.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=vr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new Pn({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new u({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 Wt)&&(this.depthFailMaterial=vr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(r=0;r<s;r++){let u=a[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,x=X.getValueOrDefault(y,e,U.WHITE,$ye);U.equals(d._lastColor,x)||(d._lastColor=U.clone(x,d._lastColor),d.color=Yt.toValue(x,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Wt&&(!u.depthFailMaterialProperty.isConstant||c)){let y=u.depthFailMaterialProperty.color,x=X.getValueOrDefault(y,e,U.WHITE,$ye);U.equals(d._lastDepthFailColor,x)||(d._lastDepthFailColor=U.clone(x,d._lastDepthFailColor),d.depthFailColor=Yt.toValue(x,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=En.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Yft,qft);kt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=kt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=qn.toValue(y,d.distanceDisplayCondition))}let A=u.terrainOffsetProperty;if(!X.isConstant(A)){let y=X.getValueOrDefault(A,e,Xft,Kft);h.equals(y,d._lastOffset)||(d._lastOffset=h.clone(y,d._lastOffset),d.offset=po.toValue(y,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};kh.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),a=this.attributes.get(r.id.id);l(a)||(a=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,a));let s=o.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=En.toValue(s,a.show),r.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};kh.prototype.contains=function(e){return this.updaters.contains(e.id)};kh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Tt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Tt.FAILED:(i.boundingSphere.clone(t),Tt.DONE)};kh.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 Wv(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}Wv.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 s=0;s<r;s++){let c=n[s];if(c.isMaterial(t)){c.add(t,o);return}}let a=new kh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(t,o),n.push(a)};function Jye(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}Wv.prototype.remove=function(e){Jye(this._solidItems,e)||Jye(this._translucentItems,e)};function Zye(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let a=t[r],s=a.itemsToRemove,c=s.length;if(c>0)for(r=0;r<c;r++){let u=s[r];a.remove(u),e.add(n,u),i=!0}}return i}function QV(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let a=t[r];if(a.invalidated){t.splice(r,1);let s=a.updaters.values,c=s.length;for(let u=0;u<c;u++)e.add(n,s[u]);a.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}Wv.prototype.update=function(e){let t=QV(this,this._solidItems,e,!0);t=QV(this,this._translucentItems,e,t)&&t;let n=Zye(this,this._solidItems,e),i=Zye(this,this._translucentItems,e);return(n||i)&&(t=QV(this,this._solidItems,e,t)&&t,t=QV(this,this._translucentItems,e,t)&&t),t};function exe(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 Tt.FAILED}Wv.prototype.getBoundingSphere=function(e,t){let n=exe(this._solidItems,e,t);return n===Tt.FAILED?exe(this._translucentItems,e,t):n};function txe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}Wv.prototype.removeAllPrimitives=function(){txe(this._solidItems),txe(this._translucentItems)};var zh=Wv;var Qft=new kt,$ft=new kt,Jft=h.ZERO,Zft=new h;function Uh(e,t,n,i,o,r,a){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=a,this.updaters=new Nt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Nt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Nt,this.attributes=new Nt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Uh.prototype.onMaterialChanged,this),this.subscriptions=new Nt,this.showsUpdated=new Nt}Uh.prototype.onMaterialChanged=function(){this.invalidated=!0};Uh.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};Uh.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||!X.isConstant(t.distanceDisplayConditionProperty)||!X.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};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};var edt=new U;Uh.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=vr.getValue(e,this.materialProperty,this.material);let s;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=vr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;s=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new Pn({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:s,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),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=vr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Wt)&&(this.depthFailMaterial=vr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let a=this.updatersWithAttributes.values,s=a.length;for(r=0;r<s;r++){let c=a[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Wt&&!c.depthFailMaterialProperty.isConstant){let y=c.depthFailMaterialProperty.color,x=X.getValueOrDefault(y,e,U.WHITE,edt);U.equals(d._lastDepthFailColor,x)||(d._lastDepthFailColor=U.clone(x,d._lastDepthFailColor),d.depthFailColor=Yt.toValue(x,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=En.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,$ft,Qft);kt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=kt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=qn.toValue(y,d.distanceDisplayCondition))}let A=c.terrainOffsetProperty;if(!X.isConstant(A)){let y=X.getValueOrDefault(A,e,Jft,Zft);h.equals(y,d._lastOffset)||(d._lastOffset=h.clone(y,d._lastOffset),d.offset=po.toValue(y,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return 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=o.entity,a=this.geometry.get(o.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=r.isShowing,u=s.show[0]===1;c!==u&&(s.show=En.toValue(c,s.show),a.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 Tt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Tt.FAILED:(i.boundingSphere.clone(t),Tt.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),this.removeMaterialSubscription()};function qv(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}qv.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let a=n[r];if(a.isMaterial(t)){a.add(e,t);return}}let o=new Uh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};qv.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}}};qv.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 a=r.updaters.values,s=a.length;for(let c=0;c<s;c++)this.add(e,a[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};qv.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 Tt.FAILED};qv.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 Vh=qv;function $V(e,t,n=0,i=e.length-1,o=tdt){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/c+p)),m=Math.min(i,Math.floor(t+(c-u)*d/c+p));$V(e,t,g,m,o)}let r=e[t],a=n,s=i;for(JP(e,n,t),o(e[i],r)>0&&JP(e,n,i);a<s;){for(JP(e,a,s),a++,s--;o(e[a],r)<0;)a++;for(;o(e[s],r)>0;)s--}o(e[n],r)===0?JP(e,n,s):(s++,JP(e,s,i)),s<=t&&(n=s+1),t<=s&&(i=s-1)}}function JP(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function tdt(e,t){return e<t?-1:e>t?1:0}var t1=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!ZV(t,n))return i;let o=this.toBBox,r=[];for(;n;){for(let a=0;a<n.children.length;a++){let s=n.children[a],c=n.leaf?o(s):s;ZV(t,c)&&(n.leaf?i.push(s):U$(t,c)?this._all(s,i):r.push(s))}n=r.pop()}return i}collides(t){let n=this.data;if(!ZV(t,n))return!1;let i=[];for(;n;){for(let o=0;o<n.children.length;o++){let r=n.children[o],a=n.leaf?this.toBBox(r):r;if(ZV(t,a)){if(n.leaf||U$(t,a))return!0;i.push(r)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Xv([]),this}remove(t,n){if(!t)return this;let i=this.data,o=this.toBBox(t),r=[],a=[],s,c,u;for(;i||r.length;){if(i||(i=r.pop(),c=r[r.length-1],s=a.pop(),u=!0),i.leaf){let f=ndt(t,i.children,n);if(f!==-1)return i.children.splice(f,1),r.push(i),this._condense(r),this}!u&&!i.leaf&&U$(i,o)?(r.push(i),a.push(s),s=0,c=i,i=i.children[0]):c?(s++,i=c.children[s],u=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,o){let r=i-n+1,a=this._maxEntries,s;if(r<=a)return s=Xv(t.slice(n,i+1)),Yv(s,this.toBBox),s;o||(o=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,o-1))),s=Xv([]),s.leaf=!1,s.height=o;let c=Math.ceil(r/a),u=c*Math.ceil(Math.sqrt(a));nxe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);nxe(t,f,d,c,this.compareMinY);for(let p=f;p<=d;p+=c){let g=Math.min(p+c-1,d);s.children.push(this._build(t,p,g,o-1))}}return Yv(s,this.toBBox),s}_chooseSubtree(t,n,i,o){for(;o.push(n),!(n.leaf||o.length-1===i);){let r=1/0,a=1/0,s;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=z$(u),d=rdt(t,u)-f;d<a?(a=d,r=f<r?f:r,s=u):d===a&&f<r&&(r=f,s=u)}n=s||n.children[0]}return n}_insert(t,n,i){let o=i?t:this.toBBox(t),r=[],a=this._chooseSubtree(o,this.data,n,r);for(a.children.push(t),e1(a,o);n>=0&&r[n].children.length>this._maxEntries;)this._split(r,n),n--;this._adjustParentBBoxes(o,r,n)}_split(t,n){let i=t[n],o=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,o);let a=this._chooseSplitIndex(i,r,o),s=Xv(i.children.splice(a,i.children.length-a));s.height=i.height,s.leaf=i.leaf,Yv(i,this.toBBox),Yv(s,this.toBBox),n?t[n-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,n){this.data=Xv([t,n]),this.data.height=t.height+1,this.data.leaf=!1,Yv(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let o,r=1/0,a=1/0;for(let s=n;s<=i-n;s++){let c=ZP(t,0,s,this.toBBox),u=ZP(t,s,i,this.toBBox),f=adt(c,u),d=z$(c)+z$(u);f<r?(r=f,o=s,a=d<a?d:a):f===r&&d<a&&(a=d,o=s)}return o||i-n}_chooseSplitAxis(t,n,i){let o=t.leaf?this.compareMinX:idt,r=t.leaf?this.compareMinY:odt,a=this._allDistMargin(t,n,i,o),s=this._allDistMargin(t,n,i,r);a<s&&t.children.sort(o)}_allDistMargin(t,n,i,o){t.children.sort(o);let r=this.toBBox,a=ZP(t,0,n,r),s=ZP(t,i-n,i,r),c=JV(a)+JV(s);for(let u=n;u<i-n;u++){let f=t.children[u];e1(a,t.leaf?r(f):f),c+=JV(a)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];e1(s,t.leaf?r(f):f),c+=JV(s)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)e1(n[o],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():Yv(t[n],this.toBBox)}};function ndt(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function Yv(e,t){ZP(e,0,e.children.length,t,e)}function ZP(e,t,n,i,o){o||(o=Xv(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(let r=t;r<n;r++){let a=e.children[r];e1(o,e.leaf?i(a):a)}return o}function e1(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function idt(e,t){return e.minX-t.minX}function odt(e,t){return e.minY-t.minY}function z$(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function JV(e){return e.maxX-e.minX+(e.maxY-e.minY)}function rdt(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function adt(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),o=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,o-n)*Math.max(0,r-i)}function U$(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function ZV(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Xv(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function nxe(e,t,n,i,o){let r=[t,n];for(;r.length;){if(n=r.pop(),t=r.pop(),n-t<=i)continue;let a=t+Math.ceil((n-t)/i/2)*i;$V(e,a,t,n,o),r.push(t,a,a,n)}}function e4(){this._tree=new t1}function yb(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}yb.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};e4.prototype.insert=function(e,t){let n=yb.fromRectangleAndId(e,t,new yb);this._tree.insert(n)};function sdt(e,t){return e.id===t.id}var cdt=new yb;e4.prototype.remove=function(e,t){let n=yb.fromRectangleAndId(e,t,cdt);this._tree.remove(n,sdt)};var ldt=new yb;e4.prototype.collides=function(e){let t=yb.fromRectangleAndId("",e,ldt);return this._tree.collides(t)};var Kv=e4;var udt=new U,fdt=new kt,ddt=new kt;function cg(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 Nt,this.updaters=new Nt,this.updatersWithAttributes=new Nt,this.attributes=new Nt,this.subscriptions=new Nt,this.showsUpdated=new Nt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new Kv}cg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};cg.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||!X.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};cg.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};cg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new ou({show:!1,asynchronous:!0,geometryInstances:a.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 a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(r=0;r<s;r++){let u=a[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let A=u.fillMaterialProperty.color,y=X.getValueOrDefault(A,e,U.WHITE,udt);U.equals(d._lastColor,y)||(d._lastColor=U.clone(y,d._lastColor),d.color=Yt.toValue(y,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=En.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,ddt,fdt);kt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=kt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=qn.toValue(A,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};cg.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),a=this.attributes.get(r.id.id);l(a)||(a=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,a));let s=o.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=En.toValue(s,a.show),r.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};cg.prototype.contains=function(e){return this.updaters.contains(e.id)};cg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Tt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Tt.DONE):Tt.FAILED};cg.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 Qv(e,t){this._batches=[],this._primitives=e,this._classificationType=t}Qv.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=X.getValueOrDefault(t.zIndex,0),r,a=i.length;for(let s=0;s<a;++s){let c=i[s];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new cg(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};Qv.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};Qv.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 a=o[t],s=a.itemsToRemove,c=s.length;for(let u=0;u<c;u++){n=s[u],a.remove(n);let f=this.add(e,n);a.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let a=o[t];a.isDirty&&(i=o[t].update(e)&&i,a.isDirty=!1),a.geometry.length===0&&o.splice(t,1)}return i};Qv.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 Tt.FAILED};Qv.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var n1=Qv;var hdt=new kt,mdt=new kt;function Cp(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Nt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Nt,this.material=void 0,this.updatersWithAttributes=new Nt,this.attributes=new Nt,this.subscriptions=new Nt,this.showsUpdated=new Nt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new Kv}Cp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Cp.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Wt&&t instanceof Wt?!0:l(t)&&t.equals(n)};Cp.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,a,s,c){a==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Cp.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};Cp.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=vr.getValue(e,this.materialProperty,this.material);let s=this.appearanceType;n=new ou({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new s({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),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=vr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let a=this.updatersWithAttributes.values,s=a.length;for(r=0;r<s;r++){let c=a[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=En.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,mdt,hdt);kt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=kt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=qn.toValue(A,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Cp.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,a=this.geometry.get(o.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=r.isShowing,u=s.show[0]===1;c!==u&&(s.show=En.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Cp.prototype.contains=function(e){return this.updaters.contains(e.id)};Cp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Tt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Tt.FAILED:(i.boundingSphere.clone(t),Tt.DONE)};Cp.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function $v(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}$v.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Qf.shouldUseSphericalCoordinates(o.geometry.rectangle),a=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===a&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let s=new Cp(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,a);s.add(e,t,o),n.push(s)};$v.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};$v.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];r.updaters.length===0&&(n.splice(t,1),r.destroy())}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};$v.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 Tt.FAILED};$v.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 t4=$v;var pdt=new U,gdt=new kt,_dt=new kt,Adt=h.ZERO,ydt=new h;function lg(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 Nt,this.updaters=new Nt,this.updatersWithAttributes=new Nt,this.attributes=new Nt,this.itemsToRemove=[],this.subscriptions=new Nt,this.showsUpdated=new Nt}lg.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};lg.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};lg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Pn({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new hn({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 a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(r=0;r<s;r++){let u=a[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let y=u.outlineColorProperty,x=X.getValueOrDefault(y,e,U.WHITE,pdt);U.equals(d._lastColor,x)||(d._lastColor=U.clone(x,d._lastColor),d.color=Yt.toValue(x,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=En.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,_dt,gdt);kt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=kt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=qn.toValue(y,d.distanceDisplayCondition))}let A=u.terrainOffsetProperty;if(!X.isConstant(A)){let y=X.getValueOrDefault(A,e,Adt,ydt);h.equals(y,d._lastOffset)||(d._lastOffset=h.clone(y,d._lastOffset),d.offset=po.toValue(y,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};lg.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),a=this.attributes.get(r.id.id);l(a)||(a=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,a));let s=o.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=En.toValue(s,a.show),r.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};lg.prototype.contains=function(e){return this.updaters.contains(e.id)};lg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Tt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Tt.FAILED:(i.boundingSphere.clone(t),Tt.DONE)};lg.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 Jv(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Nt,this._translucentBatches=new Nt}Jv.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 lg(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 lg(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};Jv.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};Jv.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,a=r.length,s=this._translucentBatches.values,c=s.length,u,f=!0,d=!1;do{for(d=!1,n=0;n<a;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=s[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(d);return f};Jv.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let s=i[n];if(s.contains(e))return s.getBoundingSphere(e,t)}let r=this._translucentBatches.values,a=r.length;for(n=0;n<a;n++){let s=r[n];if(s.contains(e))return s.getBoundingSphere(e,t)}return Tt.FAILED};Jv.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 i1=Jv;var xdt=[];function Su(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Nt,this._removedObjects=new Nt,this._changedObjects=new Nt;let o=vn.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=Yo.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let a;for(a=0;a<o;++a)this._outlineBatches[a]=new i1(n,e,a,!1),this._outlineBatches[o+a]=new i1(n,e,a,!0),this._closedColorBatches[a]=new zh(n,hn,void 0,!0,a,!0),this._closedColorBatches[o+a]=new zh(n,hn,void 0,!0,a,!1),this._closedMaterialBatches[a]=new Vh(n,go,void 0,!0,a,!0),this._closedMaterialBatches[o+a]=new Vh(n,go,void 0,!0,a,!1),this._openColorBatches[a]=new zh(n,hn,void 0,!1,a,!0),this._openColorBatches[o+a]=new zh(n,hn,void 0,!1,a,!1),this._openMaterialBatches[a]=new Vh(n,go,void 0,!1,a,!0),this._openMaterialBatches[o+a]=new Vh(n,go,void 0,!1,a,!1);let s=Yn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(s),u=[];if(r)for(a=0;a<s;++a)u.push(new t4(i,a,go)),c[a]=new n1(i,a);else for(a=0;a<s;++a)c[a]=new n1(i,a);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new Iv(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Nt,this._updaterSets=new Nt,this._entityCollection=t,t.collectionChanged.addEventListener(Su.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,xdt)}Su.registerUpdater=function(e){Hv.registerUpdater(e)};Su.unregisterUpdater=function(e){Hv.unregisterUpdater(e)};Su.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,a=r.values,s,c,u,f,d=this;for(s=a.length-1;s>-1;s--)c=a[s],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(A){d._removeUpdater(A),d._insertUpdaterIntoBatch(e,A)}):(o.push(c),n.push(c));for(s=o.length-1;s>-1;s--)c=o[s],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(s=n.length-1;s>-1;s--)c=n[s],u=c.id,f=new Hv(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(A){d._insertUpdaterIntoBatch(e,A)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Su._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,m=g.length;for(s=0;s<m;s++)p=g[s].update(e)&&p;return p};var bdt=[],Tdt=new ce;Su.prototype.getBoundingSphere=function(e,t){let n=bdt,i=Tdt,o=0,r=Tt.DONE,a=this._batches,s=a.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<s;p++){if(r=a[p].getBoundingSphere(d,i),r===Tt.PENDING)return Tt.PENDING;r===Tt.DONE&&(n[o]=ce.clone(i,n[o]),o++)}}return o===0?Tt.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),Tt.DONE)};Su.prototype.isDestroyed=function(){return!1};Su.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Su.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(),fe(this)};Su.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Su.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=vn.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 Wt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Wt?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 Wt?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)};Su._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)};Su.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(o.set(s,c),r.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,o.remove(s)?r.set(s,c):i.set(s,c)};var n4=Su;var Cdt=1,Edt="30px sans-serif",vdt=_r.FILL,Sdt=U.WHITE,wdt=U.BLACK,Idt=1,Ddt=!1,Pdt=new U(.165,.165,.165,.8),Rdt=new z(7,5),Odt=z.ZERO,Mdt=h.ZERO,Bdt=nt.NONE,Ldt=Bi.CENTER,Ndt=zn.CENTER,Fdt=new h,kdt=new U,zdt=new U,Udt=new U,Vdt=new z,jdt=new h,Gdt=new z,Hdt=new Ut,Wdt=new Ut,qdt=new Ut,Ydt=new kt;function ixe(e){this.entity=e,this.label=void 0,this.index=void 0}function OA(e,t){t.collectionChanged.addEventListener(OA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Nt,this._onCollectionChanged(t,t.values,[],[])}OA.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],a=r.entity,s=a._label,c,u=r.label,f=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(a._position,e,Fdt),c=X.getValueOrUndefined(s._text,e),f=l(d)&&l(c)),!f){V$(r,a,n);continue}X.isConstant(a._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(s._heightReference,e,Bdt);l(u)||(u=n.getLabel(a),u.id=a,r.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(s._scale,e,Cdt),u.font=X.getValueOrDefault(s._font,e,Edt),u.style=X.getValueOrDefault(s._style,e,vdt),u.fillColor=X.getValueOrDefault(s._fillColor,e,Sdt,kdt),u.outlineColor=X.getValueOrDefault(s._outlineColor,e,wdt,zdt),u.outlineWidth=X.getValueOrDefault(s._outlineWidth,e,Idt),u.showBackground=X.getValueOrDefault(s._showBackground,e,Ddt),u.backgroundColor=X.getValueOrDefault(s._backgroundColor,e,Pdt,Udt),u.backgroundPadding=X.getValueOrDefault(s._backgroundPadding,e,Rdt,Vdt),u.pixelOffset=X.getValueOrDefault(s._pixelOffset,e,Odt,Gdt),u.eyeOffset=X.getValueOrDefault(s._eyeOffset,e,Mdt,jdt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(s._horizontalOrigin,e,Ldt),u.verticalOrigin=X.getValueOrDefault(s._verticalOrigin,e,Ndt),u.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,Hdt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,Wdt),u.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,qdt),u.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,Ydt),u.disableDepthTestDistance=X.getValueOrUndefined(s._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};OA.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Tt.FAILED;let i=n.label;return t.center=h.clone(i._clampedPosition??i.position,t.center),t.radius=0,Tt.DONE};OA.prototype.isDestroyed=function(){return!1};OA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(OA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return fe(this)};OA.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._items,s=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&a.set(r.id,new ixe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?a.contains(r.id)||a.set(r.id,new ixe(r)):(V$(a.get(r.id),r,s),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],V$(a.get(r.id),r,s),a.remove(r.id)};function V$(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var i4=OA;var Xdt=1,Kdt=!0,Qdt=0,$dt=!0,Jdt=!0,Zdt=vn.ENABLED,eht=nt.NONE,tht=U.RED,nht=0,iht=U.WHITE,oht=Pl.HIGHLIGHT,rht=.5,aht=new z(1,1),oxe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},sht=new R,cht=new R,rxe=new U,axe=new Array(4),lht=new h;function MA(e,t){t.collectionChanged.addEventListener(MA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Nt,this._onCollectionChanged(t,t.values,[],[])}async function uht(e,t,n,i,o){let r=e._primitives,a=e._modelHash;try{let s=await cd.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(a[t.id]))return;s.id=t,r.add(s),a[t.id].modelPrimitive=s,s.errorEvent.addEventListener(c=>{l(a[t.id])&&(console.log(c),c.name!=="TextureError"&&s.incrementallyLoadTextures&&(a[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(a[t.id]))return;console.log(s),a[t.id].loadFailed=!0}}MA.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 a=t[o],s=a._model,c,u=n[a.id],f=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),d;if(f&&(d=a.computeModelMatrix(e,sht),c=De.createIfNeeded(X.getValueOrUndefined(s._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[a.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...oxe}},n[a.id]=u;let m=X.getValueOrDefault(s._incrementallyLoadTextures,e,$dt),A=X.getValueOrDefault(s._environmentMapOptions,e,oxe,u.environmentMapOptionsScratch);uht(this,a,c,m,A)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=X.getValueOrDefault(s._scale,e,Xdt),p.enableVerticalExaggeration=X.getValueOrDefault(s._enableVerticalExaggeration,e,Kdt),p.minimumPixelSize=X.getValueOrDefault(s._minimumPixelSize,e,Qdt),p.maximumScale=X.getValueOrUndefined(s._maximumScale,e),p.modelMatrix=R.clone(d,p.modelMatrix),p.shadows=X.getValueOrDefault(s._shadows,e,Zdt),p.heightReference=X.getValueOrDefault(s._heightReference,e,eht),p.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e),p.silhouetteColor=X.getValueOrDefault(s._silhouetteColor,e,tht,rxe),p.silhouetteSize=X.getValueOrDefault(s._silhouetteSize,e,nht),p.color=X.getValueOrDefault(s._color,e,iht,rxe),p.colorBlendMode=X.getValueOrDefault(s._colorBlendMode,e,oht),p.colorBlendAmount=X.getValueOrDefault(s._colorBlendAmount,e,rht),p.clippingPlanes=X.getValueOrUndefined(s._clippingPlanes,e),p.clampAnimations=X.getValueOrDefault(s._clampAnimations,e,Jdt),p.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(s._imageBasedLightingFactor,e,aht);let g=X.getValueOrUndefined(s._lightColor,e);if(l(g)&&(U.pack(g,axe,0),g=h.unpack(axe,0,lht)),p.lightColor=g,p.customShader=X.getValueOrUndefined(s._customShader,e),n[a.id].modelUpdated=!0,p.ready){let m=X.getValueOrDefault(s._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:ef.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let A=X.getValueOrUndefined(s._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let b=Object.keys(A);for(let T=0,E=b.length;T<E;++T){let S=b[T],w=A[S];if(!l(w))continue;let P=p.getNode(S);if(!l(P))continue;let O=R.fromTranslationRotationScale(w,cht);P.matrix=R.multiply(P.originalMatrix,O,O)}}let y=!1,x=X.getValueOrUndefined(s._articulations,e,u.articulationsScratch);if(l(x)){let b=Object.keys(x);for(let T=0,E=b.length;T<E;++T){let S=b[T],w=x[S];l(w)&&(y=!0,p.setArticulationStage(S,w))}}y&&p.applyArticulations()}}return!0};MA.prototype.isDestroyed=function(){return!1};MA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(MA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)j$(this,e[i],t,n);return fe(this)};var o4=new h,fht=new de;MA.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Tt.FAILED;if(n.loadFailed)return Tt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Tt.PENDING;if(!i.ready||!n.modelUpdated)return Tt.PENDING;let o=this._scene,r=o.ellipsoid??te.default;if(i.heightReference!==nt.NONE){let s=i.modelMatrix;o4.x=s[12],o4.y=s[13],o4.z=s[14];let c=r.cartesianToCartographic(o4,fht),u=o.getHeight(c,i.heightReference);return l(u)&&(Yf(i.heightReference)?c.height=u:c.height+=u),ce.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),Tt.DONE}return ce.clone(i.boundingSphere,t),Tt.DONE};MA.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._entitiesToVisualize,s=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&a.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(dht(r,s),a.set(r.id,r)):(j$(this,r,s,c),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],j$(this,r,s,c),a.remove(r.id)};function j$(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function dht(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var r4=MA;function BA(e){this._definitionChanged=new ye,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(BA.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Ni.FIXED}}});var hht=new Q;BA.prototype.getValue=function(e,t){return l(e)||(e=Q.now(hht)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};BA.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))};BA.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?te.default.scaleToGeodeticSurface(n,n):void 0};BA.prototype.equals=function(e){return this===e||e instanceof BA&&this._value===e._value};BA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ug=BA;var sxe=new $,cxe=new $,lxe=new $,mht=new h,uxe=new h,pht=new h,ght=new h,a4=new Le,s4=new R,c4=new $;function o1(e,t,n,i,o){if(!(!l(t)||!l(n))){if(h.subtract(t,n,o),l(i.orientation))i.orientation.getValue(e,a4)&&(Le.conjugate(a4,a4),$.fromQuaternion(a4,c4),$.multiplyByVector(c4,o,o));else if(l(W$(e,i.position,s4)))R.inverse(s4,s4),R.getRotation(s4,c4),$.multiplyByVector(c4,o,o);else return;return o}}function W$(e,t,n){let i=t.getValue(e,mht);if(l(i)){let o=Q.addSeconds(e,.01,new Q),r=t.getValue(o,uxe);if(l(r)&&!h.equalsEpsilon(i,r,D.EPSILON16)){let a=pt.computeFixedToIcrfMatrix(e,sxe),s=pt.computeFixedToIcrfMatrix(o,cxe),c;!l(a)||!l(s)?(c=pt.computeTemeToPseudoFixedMatrix(e,lxe),a=$.transpose(c,sxe),s=pt.computeTemeToPseudoFixedMatrix(o,cxe),$.transpose(s,s)):c=$.transpose(a,lxe);let u=pht;h.normalize(i,u),h.normalize(r,r),$.multiplyByVector(a,u,u),$.multiplyByVector(s,r,r);let f=h.cross(u,r,ght);if(!h.equalsEpsilon(f,h.ZERO,D.EPSILON16)){let d=h.cross(f,u,uxe);return $.multiplyByVector(c,d,d),$.multiplyByVector(c,f,f),$.multiplyByVector(c,u,u),h.normalize(d,d),h.normalize(f,f),h.normalize(u,u),l(n)||(n=new R),n[0]=d.x,n[1]=d.y,n[2]=d.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var _ht=60,Aht=1,pxe=new wn,G$=new wn,H$=new wn;function fxe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}var l4=new h;function yht(e,t,n,i,o,r,a,s,c){let u,f,d=!1;r instanceof Yo&&(u=r,f=u.position,r=Ni.FIXED,d=!0);let p=s,g,m;g=e.getValueInReferenceFrame(t,r,c[p]),d?(m=f.getValueInReferenceFrame(t,r,l4),g=o1(t,g,m,u,g),l(g)&&(c[p++]=g)):l(g)&&(c[p++]=g);let A=!l(o)||Q.lessThanOrEquals(o,t)||Q.greaterThanOrEquals(o,n),y=0,x=i.length,b=i[y],T=n,E=!1,S,w,P;for(;y<x;){if(!A&&Q.greaterThanOrEquals(b,o)&&(g=e.getValueInReferenceFrame(o,r,c[p]),d?(m=f.getValueInReferenceFrame(o,r,l4),l(g)&&l(m)&&(g=o1(o,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),A=!0),Q.greaterThan(b,t)&&Q.lessThan(b,T)&&!b.equals(o)&&(g=e.getValueInReferenceFrame(b,r,c[p]),d?(m=f.getValueInReferenceFrame(b,r,l4),l(g)&&l(m)&&(g=o1(b,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g)),y<x-1){if(a>0&&!E){let O=i[y+1],B=Q.secondsDifference(O,b);E=B>a,E&&(S=Math.ceil(B/a),w=0,P=B/Math.max(S,2),S=Math.max(S-1,1))}if(E&&w<S){b=Q.addSeconds(b,P,new Q),w++;continue}}E=!1,y++,b=i[y]}return g=e.getValueInReferenceFrame(n,r,c[p]),d?(m=f.getValueInReferenceFrame(n,r,l4),l(g)&&l(m)&&(g=o1(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function xht(e,t,n,i,o,r,a,s){let c,u=0,f=a,d=t,p=!l(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(d,n);)!p&&Q.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,s[f]),l(c)&&(s[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,s[f]),l(c)&&(s[f]=c,f++),u++,d=Q.addSeconds(t,r*u,new Q);return c=e.getValueInReferenceFrame(n,o,s[f]),l(c)&&(s[f]=c,f++),f}function bht(e,t,n,i,o,r,a,s){let c,u=0,f=a,d=t,p=Math.max(r,60),g=!l(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(d,n);)!g&&Q.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,o,s[f]),l(c)&&(s[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,s[f]),l(c)&&(s[f]=c,f++),u++,d=Q.addSeconds(t,p*u,new Q);return c=e.getValueInReferenceFrame(n,o,s[f]),l(c)&&(s[f]=c,f++),f}function Tht(e,t,n,i,o,r,a,s){H$.start=t,H$.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!wn.intersect(d,H$,pxe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=Q.addSeconds(d.start,Q.secondsDifference(d.stop,d.start)/2,new Q));let g=e.getValueInReferenceFrame(p,o,s[c]);l(g)&&(s[c]=g,c++)}}return c}function Cht(e,t,n,i,o,r,a,s){let c=e.getValueInReferenceFrame(t,o,s[a]);return l(c)&&(s[a++]=c),a}function Eht(e,t,n,i,o,r,a,s){G$.start=t,G$.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!wn.intersect(d,G$,pxe).isEmpty){let p=d.start,g=d.stop,m=t;Q.greaterThan(p,m)&&(m=p);let A=n;Q.lessThan(g,A)&&(A=g),c=gxe(d.data,m,A,i,o,r,c,s)}}return c}function gxe(e,t,n,i,o,r,a,s){for(;e instanceof CA;)e=e.resolvedProperty;if(e instanceof Tc){let c=e._property._times;a=yht(e,t,n,c,i,o,r,a,s)}else e instanceof OF?a=xht(e,t,n,i,o,r,a,s):e instanceof bc?a=Eht(e,t,n,i,o,r,a,s):e instanceof vA?a=Tht(e,t,n,i,o,r,a,s):e instanceof au||e instanceof ug&&X.isConstant(e)?a=Cht(e,t,n,i,o,r,a,s):a=bht(e,t,n,i,o,r,a,s);return a}function _xe(e,t,n,i,o,r,a){l(a)||(a=[]);let s=gxe(e,t,n,i,o,r,0,a);return a.length=s,a}var dxe=new $,hxe=new Le,mxe=new $;function r1(e,t){this._unusedIndexes=[],this._polylineCollection=new ap,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}r1.prototype.update=function(e){let t=this._referenceFrame;if(t===Ni.INERTIAL){let n=pt.computeIcrfToFixedMatrix(e,dxe);l(n)||(n=pt.computeTemeToPseudoFixedMatrix(e,dxe)),R.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof Yo){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,hxe))&&($.fromQuaternion(hxe,mxe),R.fromRotationTranslation(mxe,n,this._polylineCollection.modelMatrix)):W$(e,t.position,this._polylineCollection.modelMatrix)}};r1.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,a,s=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(s)||s.getValue(e));if(u){let p=X.getValueOrUndefined(i._leadTime,e),g=X.getValueOrUndefined(i._trailTime,e),m=n._availability,A=l(m),y=l(p),x=l(g);if(u=A||y&&x,u){if(x&&(r=Q.addSeconds(e,-g,new Q)),y&&(a=Q.addSeconds(e,p,new Q)),A){let b=m.start,T=m.stop;(!x||Q.greaterThan(b,r))&&(r=b),(!y||Q.lessThan(T,a))&&(a=T)}u=Q.lessThan(r,a)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let p=this._unusedIndexes;if(p.length>0){let m=p.pop();c=this._polylineCollection.get(m),t.index=m}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,_ht),d=_xe(o,r,a,e,this._referenceFrame,f,c.positions.slice());if(d.length<2){c.show=!1;return}c.show=!0,c.positions=d,c.material=vr.getValue(e,i._material,c.material),c.width=X.getValueOrDefault(i._width,e,Aht),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};r1.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)};r1.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),fe(this)};function Ep(e,t){t.collectionChanged.addEventListener(Ep.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Nt,this._onCollectionChanged(t,t.values,[],[])}Ep.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,s=a._position,c=a._path,u=r.updater,f=!1,d=Ni.FIXED,p=d.toString();if(this._scene.mode===ie.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=Ni.FIXED,p=d.toString()):m==="INERTIAL"?(d=Ni.INERTIAL,p=d.toString()):(f=!0,d=this._entityCollection.getById(m),p=m):(d=s.referenceFrame,p=d.toString())}let g=this._updaters[p];if(u===g&&l(g)){g.updateObject(e,r);continue}l(u)&&u.removeObject(r),!(f&&!l(d))&&(l(g)||(g=new r1(this._scene,d),g.update(e),this._updaters[p]=g),r.updater=g,l(g)&&g.updateObject(e,r))}return!0};Ep.prototype.isDestroyed=function(){return!1};Ep.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ep.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return fe(this)};Ep.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a,s=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&s.set(r.id,new fxe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?s.contains(r.id)||s.set(r.id,new fxe(r)):(a=s.get(r.id),l(a)&&(l(a.updater)&&a.updater.removeObject(a),s.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],a=s.get(r.id),l(a)&&(l(a.updater)&&a.updater.removeObject(a),s.remove(r.id))};Ep._subSample=_xe;Ep._computeVvlhTransform=W$;Ep._transformToEntityFrame=o1;var u4=Ep;var Axe=U.WHITE,yxe=U.BLACK,xxe=0,bxe=1,Txe=0,Cxe=Vr.NONE,Exe=new U,vht=new h,vxe=new U,Sxe=new Ut,wxe=new Ut,Ixe=new kt;function Dxe(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 LA(e,t){t.collectionChanged.addEventListener(LA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Nt,this._onCollectionChanged(t,t.values,[],[])}LA.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],a=r.entity,s=a._point,c=r.pointPrimitive,u=r.billboard,f=X.getValueOrDefault(s._heightReference,e,nt.NONE),d=a.isShowing&&a.isAvailable(e)&&X.getValueOrDefault(s._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(a._position,e,vht),d=l(p)),!d){a1(r,a,n);continue}X.isConstant(a._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==nt.NONE&&!l(u)?(l(c)&&(a1(r,a,n),c=void 0),u=n.getBillboard(a),u.id=a,u.image=void 0,r.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===nt.NONE&&!l(c)&&(l(u)&&(a1(r,a,n),u=void 0),c=n.getPoint(a),c.id=a,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,Sxe),c.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,wxe),c.color=X.getValueOrDefault(s._color,e,Axe,Exe),c.outlineColor=X.getValueOrDefault(s._outlineColor,e,yxe,vxe),c.outlineWidth=X.getValueOrDefault(s._outlineWidth,e,xxe),c.pixelSize=X.getValueOrDefault(s._pixelSize,e,bxe),c.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,Ixe),c.disableDepthTestDistance=X.getValueOrDefault(s._disableDepthTestDistance,e,Txe),c.splitDirection=X.getValueOrDefault(s._splitDirection,e,Cxe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(s._scaleByDistance,e,Sxe),u.translucencyByDistance=X.getValueOrUndefined(s._translucencyByDistance,e,wxe),u.distanceDisplayCondition=X.getValueOrUndefined(s._distanceDisplayCondition,e,Ixe),u.disableDepthTestDistance=X.getValueOrDefault(s._disableDepthTestDistance,e,Txe),u.splitDirection=X.getValueOrDefault(s._splitDirection,e,Cxe),u.heightReference=f;let A=X.getValueOrDefault(s._color,e,Axe,Exe),y=X.getValueOrDefault(s._outlineColor,e,yxe,vxe),x=Math.round(X.getValueOrDefault(s._outlineWidth,e,xxe)),b=Math.max(1,Math.round(X.getValueOrDefault(s._pixelSize,e,bxe)));if(x>0?(u.scale=1,g=g||x!==r.outlineWidth||b!==r.pixelSize||!U.equals(A,r.color)||!U.equals(y,r.outlineColor)):(u.scale=b/50,b=50,g=g||x!==r.outlineWidth||!U.equals(A,r.color)||!U.equals(y,r.outlineColor)),g){r.color=U.clone(A,r.color),r.outlineColor=U.clone(y,r.outlineColor),r.pixelSize=b,r.outlineWidth=x;let T=A.alpha,E=A.toCssColorString(),S=y.toCssColorString(),w=JSON.stringify([E,b,S,x]);u.setImage(w,LE(T,E,S,x,b))}m&&u._updateClamping()}}return!0};LA.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Tt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return Tt.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,Tt.DONE};LA.prototype.isDestroyed=function(){return!1};LA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(LA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return fe(this)};LA.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._items,s=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&a.set(r.id,new Dxe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Dxe(r)):(a1(a.get(r.id),r,s),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],a1(a.get(r.id),r,s),a.remove(r.id)};function a1(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 f4=LA;var Bxe=[];function Sht(e,t,n,i,o){let r=Bxe;r.length=o;let a,s=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(U.equals(n,i)){for(a=0;a<o;a++)r[a]=U.clone(n);return r}let A=(d-s)/o,y=(p-c)/o,x=(g-u)/o,b=(m-f)/o;for(a=0;a<o;a++)r[a]=new U(s+a*A,c+a*y,u+a*x,f+a*b);return r}function s1(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Ne.clone(e.vertexFormat??Ne.DEFAULT),this._arcType=e.arcType??rn.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*U.packedLength:1,this.packedLength=r+te.packedLength+Ne.packedLength+4}s1.pack=function(e,t,n){n=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 a=e._colors;for(r=l(a)?a.length:0,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,Ne.pack(e._vertexFormat,t,n),n+=Ne.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Lxe=te.clone(te.UNIT_SPHERE),Nxe=new Ne,xb={positions:void 0,colors:void 0,ellipsoid:Lxe,vertexFormat:Nxe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};s1.unpack=function(e,t,n){t=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 a=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)a[i]=U.unpack(e,t);let s=te.unpack(e,t,Lxe);t+=te.packedLength;let c=Ne.unpack(e,t,Nxe);t+=Ne.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._vertexFormat=Ne.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(xb.positions=r,xb.colors=a,xb.width=u,xb.colorsPerVertex=f,xb.arcType=d,xb.granularity=p,new s1(xb))};var Pxe=new h,Rxe=new h,Oxe=new h,Mxe=new h;s1.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,a=e._granularity,s=e._ellipsoid,c,u,f,d=[],p=Fo(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let M=0,N=d[0];i=i.filter(function(j,k){let V=!1;return o?V=k===N||k===0&&N===1:V=k+1===N,V?(M++,N=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===rn.GEODESIC||r===rn.RHUMB){let M,N;r===rn.GEODESIC?(M=D.chordLength(a,s.maximumRadius),N=$i.numberOfPoints):(M=a,N=$i.numberOfPointsRhumbLine);let j=$i.extractHeights(p,s);if(l(i)){let k=1;for(c=0;c<g-1;++c)k+=N(p[c],p[c+1],M);let V=new Array(k),F=0;for(c=0;c<g-1;++c){let W=p[c],q=p[c+1],J=i[c],H=N(W,q,M);if(o&&c<k){let Z=i[c+1],K=Sht(W,q,J,Z,H),le=K.length;for(u=0;u<le;++u)V[F++]=K[u]}else for(u=0;u<H;++u)V[F++]=U.clone(J)}V[F]=U.clone(i[i.length-1]),i=V,Bxe.length=0}r===rn.GEODESIC?p=$i.generateCartesianArc({positions:p,minDistance:M,ellipsoid:s,height:j}):p=$i.generateCartesianRhumbArc({positions:p,granularity:M,ellipsoid:s,height:j})}g=p.length;let m=g*4-4,A=new Float64Array(m*3),y=new Float64Array(m*3),x=new Float64Array(m*3),b=new Float32Array(m*2),T=n.st?new Float32Array(m*2):void 0,E=l(i)?new Uint8Array(m*4):void 0,S=0,w=0,P=0,O=0,B;for(u=0;u<g;++u){u===0?(B=Pxe,h.subtract(p[0],p[1],B),h.add(p[0],B,B)):B=p[u-1],h.clone(B,Oxe),h.clone(p[u],Rxe),u===g-1?(B=Pxe,h.subtract(p[g-1],p[g-2],B),h.add(p[g-1],B,B)):B=p[u+1],h.clone(B,Mxe);let M,N;l(E)&&(u!==0&&!o?M=i[u-1]:M=i[u],u!==g-1&&(N=i[u]));let j=u===0?2:0,k=u===g-1?2:4;for(f=j;f<k;++f){h.pack(Rxe,A,S),h.pack(Oxe,y,S),h.pack(Mxe,x,S),S+=3;let V=f-2<0?-1:1;if(b[w++]=2*(f%2)-1,b[w++]=V*t,n.st&&(T[P++]=u/(g-1),T[P++]=Math.max(b[w-2],0)),l(E)){let F=f<2?M:N;E[O++]=U.floatToByte(F.red),E[O++]=U.floatToByte(F.green),E[O++]=U.floatToByte(F.blue),E[O++]=U.floatToByte(F.alpha)}}}let L=new _n;L.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),L.prevPosition=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y}),L.nextPosition=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:x}),L.expandAndWidth=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b}),n.st&&(L.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:T})),l(E)&&(L.color=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let _=Ue.createTypedArray(m,g*6-6),C=0,v=0,I=g-1;for(u=0;u<I;++u)_[v++]=C,_[v++]=C+2,_[v++]=C+1,_[v++]=C+1,_[v++]=C+2,_[v++]=C+3,C+=4;return new At({attributes:L,indices:_,primitiveType:Re.TRIANGLES,boundingSphere:ce.fromPoints(p),geometryType:th.POLYLINES})};var NA=s1;var wht=new fi(0),d4={},Fxe=new U,Iht=new Wt(U.WHITE),Dht=new fi(!0),Pht=new fi(vn.DISABLED),Rht=new fi(new kt),Oht=new fi(Yn.BOTH);function Mht(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Bht(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function jh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(jh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new ye,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 Mht,this._groundGeometryOptions=new Bht,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Yo.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(jh.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)&&X.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}}});jh.prototype.isOutlineVisible=function(e){return!1};jh.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};jh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new En(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=qn.fromDistanceDisplayCondition(o),a={show:i,distanceDisplayCondition:r},s;return this._materialProperty instanceof Wt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Fxe)),l(s)||(s=U.WHITE),a.color=Yt.fromColor(s)),this.clampToGround?new Bt({id:t,geometry:new fC(this._groundGeometryOptions),attributes:a}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Wt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(s=this._depthFailMaterialProperty.color.getValue(e,Fxe)),l(s)||(s=U.WHITE),a.depthFailColor=Yt.fromColor(s)),new Bt({id:t,geometry:new NA(this._geometryOptions),attributes:a}))};jh.prototype.createOutlineGeometryInstance=function(e){};jh.prototype.isDestroyed=function(){return!1};jh.prototype.destroy=function(){this._entitySubscription(),fe(this)};jh.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,a=o.show;if(l(a)&&a.isConstant&&!a.getValue(Qe.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let s=o.zIndex,c=o.material??Iht,u=c instanceof Wt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=a??Dht,this._shadowsProperty=o.shadows??Pht,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??Rht,this._classificationTypeProperty=o.classificationType??Oht,this._fillEnabled=!0,this._zIndex=s??wht;let f=o.width,d=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(g)||!X.isConstant(p)||!X.isConstant(s))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,A=r.getValue(Qe.MINIMUM_VALUE,m.positions);if(!l(A)||A.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let y;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Wt)?y=Ua.VERTEX_FORMAT:y=mc.VERTEX_FORMAT,m.vertexFormat=y,m.positions=A,m.width=l(f)?f.getValue(Qe.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(Qe.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(Qe.MINIMUM_VALUE):void 0;let x=this._groundGeometryOptions;x.positions=A,x.width=m.width,x.arcType=m.arcType,x.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(Qe.MINIMUM_VALUE):!1,!this._clampToGround&&l(s)&&_t("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};jh.prototype.createDynamicUpdater=function(e,t){return new c1(e,t,this)};var Zv={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function c1(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 kxe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=d4[n];!l(i)||i.isDestroyed()?(i=new ap,d4[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}c1.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=X.getValueOrUndefined(o,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,rn.GEODESIC),t._groundGeometryOptions.granularity=X.getValueOrDefault(i._granularity,e,9999);let a=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(a.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Wt)p=new Ua;else{let g=vr.getValue(e,d,this._material);p=new mc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=a.add(new Im({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let s=kxe(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){s.show=!1;return}if(!l(r)||r.length<2){s.show=!1;return}let c=rn.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==rn.NONE&&l(u)&&(Zv.ellipsoid=f,Zv.positions=r,Zv.granularity=X.getValueOrUndefined(i._granularity,e),Zv.height=$i.extractHeights(r,f),c===rn.GEODESIC?r=$i.generateCartesianArc(Zv):r=$i.generateCartesianRhumbArc(Zv)),s.show=!0,s.positions=r.slice(),s.material=vr.getValue(e,t.fillMaterialProperty,s.material),s.width=X.getValueOrDefault(i._width,e,1),s.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,s.distanceDisplayCondition)};c1.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),Tt.DONE}return l(t)&&!t.ready?Tt.PENDING:Tt.DONE}else{let t=kxe(this);if(t.show&&t.positions.length>0)return ce.fromPoints(t.positions,e),Tt.DONE}return Tt.FAILED};c1.prototype.isDestroyed=function(){return!1};c1.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=d4[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete d4[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),fe(this)};var h4=jh;var Lht=new U,Nht=new kt,Fht=new kt;function Gh(e,t,n,i,o){let r;n instanceof Wt?r=Ua:r=mc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Nt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Nt,this.material=void 0,this.updatersWithAttributes=new Nt,this.attributes=new Nt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Gh.prototype.onMaterialChanged,this),this.subscriptions=new Nt,this.showsUpdated=new Nt,this.zIndex=i,this._asynchronous=o}Gh.prototype.onMaterialChanged=function(){this.invalidated=!0};Gh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Wt&&t instanceof Wt?!0:l(t)&&t.equals(n)};Gh.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,a,s,c){a==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Gh.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};Gh.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);let s=this.appearanceType;n=new Im({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new s,classificationType:this.classificationType}),this.appearanceType===mc&&(this.material=vr.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 s=this.oldPrimitive;l(s)&&(i.remove(s),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===mc&&(this.material=vr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let a=this.updatersWithAttributes.values,s=a.length;for(r=0;r<s;r++){let c=a[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let A=c.fillMaterialProperty.color,y=X.getValueOrDefault(A,e,U.WHITE,Lht);U.equals(d._lastColor,y)||(d._lastColor=U.clone(y,d._lastColor),d.color=Yt.toValue(y,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=En.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,Fht,Nht);kt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=kt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=qn.toValue(A,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Gh.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,a=this.geometry.get(o.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=r.isShowing,u=s.show[0]===1;c!==u&&(s.show=En.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Gh.prototype.contains=function(e){return this.updaters.contains(e.id)};Gh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Tt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Tt.FAILED:(i.boundingSphere.clone(t),Tt.DONE)};Gh.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 eS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}eS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=X.getValueOrDefault(t.zIndex,0);for(let s=0;s<i;++s){let c=n[s];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let a=new Gh(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);a.add(e,t,o),n.push(a)};eS.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}}};eS.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 a=r.updaters.values,s=a.length;for(let c=0;c<s;c++)this.add(e,a[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};eS.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 Tt.FAILED};eS.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 m4=eS;var kht=[];function zxe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function Uxe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let a=n.classificationTypeProperty.getValue(t);e._groundBatches[a].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Wt?1:2);let r;l(i)&&(r=i+o*vn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Wt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function vp(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Nt,this._removedObjects=new Nt,this._changedObjects=new Nt;let o,r=vn.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 zh(n,Ua,void 0,!1,o),this._materialBatches[o]=new Vh(n,mc,void 0,!1,o),this._colorBatches[o+r]=new zh(n,Ua,Ua,!1,o),this._materialBatches[o+r]=new Vh(n,mc,Ua,!1,o),this._colorBatches[o+r*2]=new zh(n,Ua,mc,!1,o),this._materialBatches[o+r*2]=new Vh(n,mc,mc,!1,o);this._dynamicBatch=new Iv(n,i);let a=Yn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(a),o=0;o<a;++o)this._groundBatches[o]=new m4(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Nt,this._updaters=new Nt,this._entityCollection=t,t.collectionChanged.addEventListener(vp.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,kht)}vp.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,a=r.values,s,c,u,f;for(s=a.length-1;s>-1;s--)c=a[s],u=c.id,f=this._updaters.get(u),f.entity===c?(zxe(this,f),Uxe(this,e,f)):(o.push(c),n.push(c));for(s=o.length-1;s>-1;s--)c=o[s],u=c.id,f=this._updaters.get(u),zxe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(s=n.length-1;s>-1;s--)c=n[s],u=c.id,f=new h4(c,this._scene),this._updaters.set(u,f),Uxe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(vp._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let d=!0,p=this._batches,g=p.length;for(s=0;s<g;s++)d=p[s].update(e)&&d;return d};var zht=[],Uht=new ce;vp.prototype.getBoundingSphere=function(e,t){let n=zht,i=Uht,o=0,r=Tt.DONE,a=this._batches,s=a.length,c=this._updaters.get(e.id);for(let u=0;u<s;u++){if(r=a[u].getBoundingSphere(c,i),r===Tt.PENDING)return Tt.PENDING;r===Tt.DONE&&(n[o]=ce.clone(i,n[o]),o++)}return o===0?Tt.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),Tt.DONE)};vp.prototype.isDestroyed=function(){return!1};vp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(vp.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(),fe(this)};vp._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)};vp.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(o.set(s,c),r.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,o.remove(s)?r.set(s,c):i.set(s,c)};var p4=vp;function wu(e){ou.initializeTerrainHeights(),Im.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Yr,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=e.visualizersCallback??wu.defaultVisualizersCallback;let i=!1,o=new Eu,r=new Eu;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let a=new rV;this._onDataSourceAdded(void 0,a),this._defaultDataSource=a;let s,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),s(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};s=a.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=s,this._removeDataSourceCollectionListener=c,this._ready=!1}var tS=[];wu.registerVisualizer=function(e){tS.includes(e)||tS.push(e)};wu.unregisterVisualizer=function(e){if(tS.includes(e)){let t=tS.indexOf(e);tS.splice(t,1)}};wu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new LN(t,i),new n4(e,i,n._primitives,n._groundPrimitives),new i4(t,i),new r4(e,i),new HU(e,i),new f4(t,i),new u4(e,i),new p4(e,i,n._primitives,n._groundPrimitives),...tS.map(o=>new o(e,i))]};Object.defineProperties(wu.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}}});wu.prototype.isDestroyed=function(){return!1};wu.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)),fe(this)};wu.prototype.update=function(e){if(!wi.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,a=this._dataSourceCollection,s=a.length;for(n=0;n<s;n++){let c=a.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=this._ready||t,t};wu.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 a=o._resourceCredits;if(l(a)){let s=a.length;for(let c=0;c<s;c++)e.creditDisplay.addCreditToNextFrame(a[c])}}};var Vht=[],jht=new ce;wu.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Tt.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 Tt.FAILED;let a=Vht,s=jht,c=0,u=Tt.DONE,f=r._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,s),!t&&u===Tt.PENDING)return Tt.PENDING;u===Tt.DONE&&(a[c]=ce.clone(s,a[c]),c++)}}return c===0?Tt.FAILED:(a.length=c,ce.fromBoundingSpheres(a,n),Tt.DONE)};wu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Eu),a=o.add(new CV);t._primitives=r,t._groundPrimitives=a;let s=t.clustering;s._initialize(n),r.add(s),t._visualizers=this._visualizersCallback(n,s,t)};wu.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,a=t.clustering;o.remove(a);let s=t._visualizers,c=s.length;for(let u=0;u<c;u++)s[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};wu.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,a=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(a)):t===n-1?(i.lower(r),o.lower(a)):t===0?(i.lowerToBottom(r),o.lowerToBottom(a),i.raise(r),o.raise(a)):(i.raiseToTop(r),o.raiseToTop(a))};var g4=wu;function q$(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}q$.clone=function(e,t){if(l(e))return l(t)||(t=new q$),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Hh=q$;var Vxe=new $,jxe=new $,Gxe=new $,Ght=new R,_4=new h,Hxe=new h,Y$=new h,X$=new h,Wxe=new h,qxe=new h,Hht=new Le,Wht=new h,qht=new $,nS=new Q,Yht=1.25;function Xht(e,t,n,i,o,r,a,s,c,u){let f=e.scene.mode,d=o.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,A,y;if(f===ie.SCENE3D){Q.addSeconds(c,.001,nS);let P=o.getValue(nS,_4);if(l(P)||(Q.addSeconds(c,-.001,nS),P=o.getValue(nS,_4),g=!0),l(P)){let O=pt.computeFixedToIcrfMatrix(c,Vxe),B=pt.computeFixedToIcrfMatrix(nS,jxe),L;!l(O)||!l(B)?(L=pt.computeTemeToPseudoFixedMatrix(c,Gxe),O=$.transpose(L,Vxe),B=pt.computeTemeToPseudoFixedMatrix(nS,jxe),$.transpose(B,B)):L=$.transpose(O,Gxe);let _=$.multiplyByVector(O,d,Wxe),C=$.multiplyByVector(B,P,qxe);h.subtract(_,C,X$);let v=h.magnitude(X$)*1e3,I=D.GRAVITATIONALPARAMETER,M=-I/(v*v-2*I/h.magnitude(_));M<0||M>Yht*u.maximumRadius?(m=Hxe,h.normalize(d,m),h.negate(m,m),y=h.clone(h.UNIT_Z,Y$),A=h.cross(y,m,_4),h.magnitude(A)>D.EPSILON7&&(h.normalize(m,m),h.normalize(A,A),y=h.cross(m,A,Y$),h.normalize(y,y),p=!0)):h.equalsEpsilon(d,P,D.EPSILON7)||(y=Hxe,h.normalize(_,y),h.normalize(C,C),A=h.cross(y,C,Y$),g&&(A=h.multiplyByScalar(A,-1,A)),h.equalsEpsilon(A,h.ZERO,D.EPSILON7)||(m=h.cross(A,y,_4),$.multiplyByVector(L,m,m),$.multiplyByVector(L,A,A),$.multiplyByVector(L,y,y),h.normalize(m,m),h.normalize(A,A),h.normalize(y,y),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let x,b,T;i&&(x=h.clone(t.position,X$),b=h.clone(t.direction,Wxe),T=h.clone(t.up,qxe));let E=Ght,S;l(a)&&(S=a.getValue(c,Hht));let w=r.getValue(c,Wht);if(s===l_.INERTIAL&&l(S))R.fromTranslationQuaternionRotationScale(d,S,h.ONE,E);else if(s===l_.VELOCITY&&l(w)){let P=pt.rotationMatrixFromPositionVelocity(d,w,u,qht);R.fromRotationTranslation(P,d,E)}else s===l_.ENU||!p?pt.eastNorthUpToFixedFrame(d,u,E):(E[0]=m.x,E[1]=m.y,E[2]=m.z,E[3]=0,E[4]=A.x,E[5]=A.y,E[6]=A.z,E[7]=0,E[8]=y.x,E[9]=y.y,E[10]=y.z,E[11]=0,E[12]=d.x,E[13]=d.y,E[14]=d.z,E[15]=0);t._setTransform(E),i&&(h.clone(x,t.position),h.clone(b,t.direction),h.clone(T,t.up),h.cross(b,T,t.right))}if(n){let p=f===ie.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function l1(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??te.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new wA(e.position,!0),this._offset3D=new h}Object.defineProperties(l1,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});l1.defaultOffset3D=new h(-14e3,3500,3500);var A4=new Hh,Kht=new h;l1.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ie.MORPHING)return;let r=this.entity,a=r.trackingReferenceFrame,s=r.position;if(!l(s))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,d=o!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let A=r.viewFrom,y=l(A);if(!y&&l(t)){A4.pitch=-D.PI_OVER_FOUR,A4.range=0;let x=s.getValue(e,Kht);if(l(x)){let b=2-1/Math.max(1,h.magnitude(x)/i.maximumRadius);A4.pitch*=b}p.viewBoundingSphere(t,A4),this.boundingSphere=t,g=!1,m=!1}else(!y||!l(A.getValue(e,this._offset3D)))&&h.clone(l1._defaultOffset3D,this._offset3D)}else!d&&this._mode!==ie.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Xht(this,p,g,m,s,c,u,a,e,i)};var y4=l1;function f1(){this._cache={}}f1.prototype.fromColor=function(e,t){return x4(void 0,void 0,e,t,this._cache)};f1.prototype.fromUrl=function(e,t,n){return x4(e,void 0,t,n,this._cache)};f1.prototype.fromMakiIconId=function(e,t,n){return x4(Xt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};f1.prototype.fromText=function(e,t,n){return x4(void 0,e,t,n,this._cache)};var Qht=new U;function $ht(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Qht).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 Yxe(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 a=Math.round((n-o)/2),s=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,a-1,s,o,r),e.drawImage(t,a,s-1,o,r),e.drawImage(t,a+1,s,o,r),e.drawImage(t,a,s+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=U.BLACK.toCssColorString(),e.fillRect(a-1,s-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,a,s,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=U.WHITE.toCssColorString(),e.fillRect(a-1,s-2,o+2,r+2)}var u1=new Array(4);function x4(e,t,n,i,o){u1[0]=e,u1[1]=t,u1[2]=n,u1[3]=i;let r=JSON.stringify(u1),a=o[r];if(l(a))return a;let s=document.createElement("canvas");s.width=i,s.height=i;let c=s.getContext("2d");if($ht(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return Yxe(c,d,i),o[r]=s,s});return o[r]=f,f}else if(l(t)){let u=FE(t,{font:`bold ${i}px sans-serif`});Yxe(c,u,i)}return o[r]=s,s}var FA=f1;function K$(e){return e}function b4(e){if(e==null)return K$;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],a=e.translate[1];return function(s,c){c||(t=n=0);var u=2,f=s.length,d=new Array(f);for(d[0]=(t+=s[0])*i+r,d[1]=(n+=s[1])*o+a;u<f;)d[u]=s[u],++u;return d}}function Xxe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function Q$(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Kxe(e,n)})}:Kxe(e,t)}function Kxe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=$$(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 $$(e,t){var n=b4(e.transform),i=e.arcs;function o(f,d){d.length&&d.pop();for(var p=i[f<0?~f:f],g=0,m=p.length;g<m;++g)d.push(n(p[g],g));f<0&&Xxe(d,m)}function r(f){return n(f)}function a(f){for(var d=[],p=0,g=f.length;p<g;++p)o(f[p],d);return d.length<2&&d.push(d[0]),d}function s(f){for(var d=a(f);d.length<4;)d.push(d[0]);return d}function c(f){return f.map(s)}function u(f){var d=f.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:f.geometries.map(u)};case"Point":p=r(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(r);break;case"LineString":p=a(f.arcs);break;case"MultiLineString":p=f.arcs.map(a);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:d,coordinates:p}}return u(t)}function T4(e){return h.fromDegrees(e[0],e[1],e[2])}var J$={"urn:ogc:def:crs:OGC:1.3:CRS84":T4,"EPSG:4326":T4,"urn:ogc:def:crs:EPSG::4326":T4},Qxe={},$xe={},Z$=48,eJ,tJ=U.ROYALBLUE,nJ=U.YELLOW,iJ=2,oJ=U.fromBytes(255,255,0,100),rJ=!1,nmt={small:24,medium:48,large:64},imt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Jxe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||imt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Jxe(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 omt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function rmt(e,t){return new Mm(omt(Jxe,e,t),!0)}function C4(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Hn();else{let a=2,s=i;for(;l(t.getById(s));)s=`${i}_${a}`,a++;i=s}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let a,s=r.title;if(l(s))o.name=s,a="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,a=f;break}else u>2&&d==="name"?(u=2,a=f):u>3&&/title/i.test(f)?(u=3,a=f):u>4&&/name/i.test(f)&&(u=4,a=f)}l(a)&&(o.name=r[a])}let c=r.description;c!==null&&(o.description=l(c)?new fi(c):n(r,a))}return o}function aJ(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Zxe={Feature:tbe,FeatureCollection:amt,GeometryCollection:nbe,LineString:sbe,MultiLineString:cbe,MultiPoint:rbe,MultiPolygon:fbe,Point:obe,Polygon:ube,Topology:dbe},ebe={GeometryCollection:nbe,LineString:sbe,MultiLineString:cbe,MultiPoint:rbe,MultiPolygon:fbe,Point:obe,Polygon:ube,Topology:dbe};function tbe(e,t,n,i,o){if(t.geometry===null){C4(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new re("feature.geometry is required.");let r=t.geometry.type,a=ebe[r];if(!l(a))throw new re(`Unknown geometry type: ${r}`);a(e,t,t.geometry,i,o)}function amt(e,t,n,i,o){let r=t.features;for(let a=0,s=r.length;a<s;a++)tbe(e,r[a],void 0,i,o)}function nbe(e,t,n,i,o){let r=n.geometries;for(let a=0,s=r.length;a<s;a++){let c=r[a],u=c.type,f=ebe[u];if(!l(f))throw new re(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function ibe(e,t,n,i,o){let r=o.markerSymbol,a=o.markerColor,s=o.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(a=U.fromCssColorString(g)),s=nmt[c["marker-size"]]??s;let m=c["marker-symbol"];l(m)&&(r=m)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),a,s):u=e._pinBuilder.fromMakiIconId(r,a,s):u=e._pinBuilder.fromColor(a,s);let f=new bl;f.verticalOrigin=new fi(zn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=nt.CLAMP_TO_GROUND);let d=C4(t,e._entityCollection,o.describe);d.billboard=f,d.position=new au(n(i));let p=Promise.resolve(u).then(function(g){f.image=new fi(g)}).catch(function(){f.image=new fi(e._pinBuilder.fromColor(a,s))});e._promises.push(p)}function obe(e,t,n,i,o){ibe(e,t,i,n.coordinates,o)}function rbe(e,t,n,i,o){let r=n.coordinates;for(let a=0;a<r.length;a++)ibe(e,t,i,r[a],o)}function abe(e,t,n,i,o){let r=o.strokeMaterialProperty,a=o.strokeWidthProperty,s=t.properties;if(l(s)){let f=s["stroke-width"];l(f)&&(a=new fi(f));let d,p=s.stroke;l(p)&&(d=U.fromCssColorString(p));let g=s["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=r.color.getValue().clone()),d.alpha=g),l(d)&&(r=new Wt(d))}let c=C4(t,e._entityCollection,o.describe),u=new El;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=a,u.positions=new fi(aJ(i,n)),u.arcType=rn.RHUMB}function sbe(e,t,n,i,o){abe(e,t,i,n.coordinates,o)}function cbe(e,t,n,i,o){let r=n.coordinates;for(let a=0;a<r.length;a++)abe(e,t,i,r[a],o)}function lbe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,a=o.fillMaterialProperty,s=o.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(s=new fi(g));let m,A=c.stroke;l(A)&&(m=U.fromCssColorString(A));let y=c["stroke-opacity"];l(y)&&y!==1&&(l(m)||(m=r.getValue().clone()),m.alpha=y),l(m)&&(r=new fi(m));let x,b=c.fill,T=a.color.getValue();l(b)&&(x=U.fromCssColorString(b),x.alpha=T.alpha),y=c["fill-opacity"],l(y)&&y!==T.alpha&&(l(x)||(x=T.clone()),x.alpha=y),l(x)&&(a=new Wt(x))}let u=new Rm;u.outline=new fi(!0),u.outlineColor=r,u.outlineWidth=s,u.material=a,u.arcType=rn.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Gc(aJ(i[g],n)));let d=i[0];u.hierarchy=new fi(new Gc(aJ(d,n),f)),d[0].length>2?u.perPositionHeight=new fi(!0):o.clampToGround||(u.height=0);let p=C4(t,e._entityCollection,o.describe);p.polygon=u}function ube(e,t,n,i,o){lbe(e,t,i,n.coordinates,o)}function fbe(e,t,n,i,o){let r=n.coordinates;for(let a=0;a<r.length;a++)lbe(e,t,i,r[a],o)}function dbe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let a=Q$(n,n.objects[r]),s=Zxe[a.type];s(e,a,a,i,o)}}function kA(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new Js(this),this._promises=[],this._pinBuilder=new FA,this._entityCluster=new Ed,this._credit=void 0,this._resourceCredits=[]}kA.load=function(e,t){return new kA().load(e,t)};Object.defineProperties(kA,{markerSize:{get:function(){return Z$},set:function(e){Z$=e}},markerSymbol:{get:function(){return eJ},set:function(e){eJ=e}},markerColor:{get:function(){return tJ},set:function(e){tJ=e}},stroke:{get:function(){return nJ},set:function(e){nJ=e}},strokeWidth:{get:function(){return iJ},set:function(e){iJ=e}},fill:{get:function(){return oJ},set:function(e){oJ=e}},clampToGround:{get:function(){return rJ},set:function(e){rJ=e}},crsNames:{get:function(){return J$}},crsLinkHrefs:{get:function(){return Qxe}},crsLinkTypes:{get:function(){return $xe}}});Object.defineProperties(kA.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}}});kA.prototype.load=function(e,t){return hbe(this,e,t,!0)};kA.prototype.process=function(e,t){return hbe(this,e,t,!1)};function hbe(e,t,n,i){Da.setLoading(e,!0),n=n??G.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new xt(o)),e._credit=o;let r=t,a=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),a=a??t.getUrlComponent();let s=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)s.push(c[f])}}return n={describe:n.describe??rmt,markerSize:n.markerSize??Z$,markerSymbol:n.markerSymbol??eJ,markerColor:n.markerColor??tJ,strokeWidthProperty:new fi(n.strokeWidth??iJ),strokeMaterialProperty:new Wt(n.stroke??nJ),fillMaterialProperty:new Wt(n.fill??oJ),clampToGround:n.clampToGround??rJ},Promise.resolve(r).then(function(s){return smt(e,s,n,a,i)}).catch(function(s){throw Da.setLoading(e,!1),e._error.raiseEvent(e,s),s})}kA.prototype.update=function(e){return!0};function smt(e,t,n,i,o){let r;l(i)&&(r=xA(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let a=Zxe[t.type];if(!l(a))throw new re(`Unsupported GeoJSON object type: ${t.type}`);let s=t.crs,c=s!==null?T4:null;if(l(s)){if(!l(s.properties))throw new re("crs.properties is undefined.");let u=s.properties;if(s.type==="name"){if(c=J$[u.name],!l(c))throw new re(`Unknown crs name: ${u.name}`)}else if(s.type==="link"){let f=Qxe[u.href];if(l(f)||(f=$xe[u.type]),!l(f))throw new re(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(s.type==="EPSG"){if(c=J$[`EPSG:${u.code}`],!l(c))throw new re(`Unknown crs EPSG code: ${u.code}`)}else throw new re(`Unknown crs type: ${s.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&a(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Da.setLoading(e,!1),e})})}var bb=kA;var sJ=function(e,t){return sJ=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])},sJ(e,t)};function Sp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");sJ(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var qa=function(){return qa=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},qa.apply(this,arguments)};function mbe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return r}function pbe(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var gbe="4.1.5";var _be=Object.prototype.hasOwnProperty;function gf(e){return typeof e=="boolean"}function Abe(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 zA(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Wh(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var E4=/\s+/,v4=(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},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(E4):[],o=t.split(E4),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(E4):[],o=t.split(E4),r;i.length&&(r=o.shift());){var a=i.indexOf(r);a!==-1&&i.splice(a,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(){var t=this.getAttrs(),n=[];for(var i in t)_be.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();function xbe(e,t,n){var i,o;if(n==null?(n="&hellip;",o=3,i=8):(o=n.length,i=n.length),e.length<=t)return e;var r=t-o,a=cmt(e);if(a.query){var s=a.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);s&&(a.query=a.query.substr(0,s[1].length),e=ybe(a))}if(e.length<=t||(a.host&&(a.host=a.host.replace(/^www\./,""),e=ybe(a)),e.length<=t))return e;var c="";if(a.host&&(c+=a.host),c.length>=r)return a.host.length===t?(a.host.substr(0,t-o)+n).substr(0,r+i):cJ(c,r,n).substr(0,r+i);var u="";if(a.path&&(u+="/"+a.path),a.query&&(u+="?"+a.query),u)if((c+u).length>=r){if((c+u).length==t)return(c+u).substr(0,t);var f=r-c.length;return(c+cJ(u,f,n)).substr(0,r+i)}else c+=u;if(a.fragment){var d="#"+a.fragment;if((c+d).length>=r){if((c+d).length==t)return(c+d).substr(0,t);var p=r-c.length;return(c+cJ(d,p,n)).substr(0,r+i)}else c+=d}if(a.scheme&&a.host){var g=a.scheme+"://";if((c+g).length<r)return(g+c).substr(0,t)}if(c.length<=t)return c;var m="";return r>0&&(m=c.substr(-1*Math.floor(r/2))),(c.substr(0,Math.ceil(r/2))+n+m).substr(0,r+i)}function cmt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function ybe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function cJ(e,t,n){var i=t/2,o=Math.ceil(i),r=-1*Math.floor(i),a="";return r<0&&(a=e.substr(r)),e.substr(0,o)+n+a}function bbe(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,a="";return r>0&&(a=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+a).substr(0,r+i)}function Tbe(e,t,n){return Abe(e,t,n)}var Cbe=(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 v4({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.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,a=o.length;r<a;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.length)return t;var i=n.length,o=n.location;return o==="smart"?xbe(t,i):o==="middle"?bbe(t,i):Tbe(t,i)},e})();var wp=(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})();function Ebe(e){return e>=0&&e<=31||e==127}function fg(e){return e>=65&&e<=90||e>=97&&e<=122}function Ya(e){return e>=48&&e<=57}function S4(e){return e==34||e==39}function UA(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function qh(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function vbe(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function Sbe(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function w4(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function wbe(e){return e<91?e==40:e==91||e==123}function lJ(e){return e<93?e==41:e==93||e==125}var Ibe=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|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|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|சிங்கப்பூர்|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|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|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|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|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|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|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|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|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|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|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|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|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|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|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|loans|locus|lotte|lotto|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|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|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|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|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|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|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|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|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|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|scb|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|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|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|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var uJ=/https?:\/\//i,Dbe=new RegExp("^"+uJ.source,"i"),lmt=/^(javascript|vbscript):/i,umt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,fmt=/^(?:\/\/)?([^/#?:]+)/,iS=fg;function fJ(e){return fg(e)||Ya(e)||e===43||e===45||e===46}var dg=qh;function I4(e){return e===95||dg(e)}function dJ(e){return qh(e)||Sbe(e)||w4(e)}function D4(e){return e===47||e===63||e===35}function hJ(e){return Ibe.test(e.toLowerCase())}function Pbe(e){if(lmt.test(e))return!1;var t=e.match(umt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function Rbe(e){var t=e.match(fmt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!hJ(o)}var dmt=/^(?:(?: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]?)$/,hmt=/[:/?#]/;function Obe(e){var t=e.split(hmt,1)[0];return dmt.test(t)}var mmt=/^(https?:\/\/)?(?:www\.)?/i,pmt=/^\/\//,Mbe=(function(e){Sp(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=Amt(n)),this.stripPrefix.scheme&&(n=gmt(n)),this.stripPrefix.www&&(n=_mt(n)),this.stripTrailingSlash&&(n=ymt(n)),this.decodePercentEncoding&&(n=xmt(n)),n},t})(wp);function gmt(e){return e.replace(Dbe,"")}function _mt(e){return e.includes("www.")?e.replace(mmt,"$1"):e}function Amt(e){return e.replace(pmt,"")}function ymt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function xmt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?"&quot;":n==="%26"?"&amp;":n==="%27"?"&#39;":n==="%3C"||n==="%3c"?"&lt;":"&gt;"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var Bbe=/^mailto:/i,mJ=qh;function P4(e){return mJ(e)||vbe(e)}function Lbe(e){var t=e.split(".").pop();return hJ(t)}var Nbe=(function(e){Sp(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})(wp);function pJ(e){return e===95||qh(e)}function Fbe(e){return e.length<=140}var kbe=["twitter","facebook","instagram","tiktok","youtube"];var zbe=(function(e){Sp(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;case"youtube":return"https://youtube.com/hashtag/"+i;default:Wh(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})(wp);var bmt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function gJ(e){return e===45||e===46||e===95||fg(e)||Ya(e)}function Ube(e,t){var n=bmt[t];return n.test(e)}var Vbe=["twitter","instagram","soundcloud","tiktok","youtube"];var jbe=(function(e){Sp(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;case"youtube":return"https://youtube.com/@"+this.mention;default:Wh(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})(wp);var Tmt=/[-. ()]/,Cmt=/(?:(?:(?:(\+)?\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]+#?)*/,Emt=/(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})/,vmt=new RegExp("^".concat(Cmt.source,"|").concat(Emt.source,"$"));function _J(e){return e===45||e===46||e===32}function R4(e){return e===44||e===59}function Gbe(e){var t=e.charAt(0)==="+"||Tmt.test(e);return t&&vmt.test(e)}var Hbe=(function(e){Sp(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})(wp);var Smt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),qbe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),qbe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function Ybe(e,t){for(var n=new Smt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)O4(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var a=n.stateMachines[r];switch(a.state){case 11:Omt(n,a,o);break;case 12:Mmt(n,a,o);break;case 0:wmt(n,a,o);break;case 1:Imt(n,a,o);break;case 2:Dmt(n,a,o);break;case 3:Pmt(n,a,o);break;case 4:Rmt(n,a,i,o);break;case 5:Bmt(n,a,o);break;case 6:Lmt(n,a,i,o);break;case 7:Nmt(n,a,i,o);break;case 13:Fmt(n,a,o);break;case 14:kmt(n,a,o);break;case 8:zmt(n,a,o);break;case 9:Umt(n,a,o);break;case 10:Vmt(n,a,o);break;case 15:jmt(n,a,i,o);break;case 16:Gmt(n,a,i,o);break;case 17:Hmt(n,a,i,o);break;case 18:Wmt(n,a,i,o);break;case 19:qmt(n,a,i,o);break;case 20:Ymt(n,a,o);break;case 21:Xmt(n,a,o);break;case 22:Tb(n,a,o);break;case 23:Kmt(n,a,o);break;case 24:Qmt(n,a,o);break;case 25:$mt(n,a,o);break;case 26:Jmt(n,a,o);break;case 27:Zmt(n,a,o);break;case 28:ept(n,a,o);break;case 29:tpt(n,a,o);break;case 30:npt(n,a,o);break;case 31:ipt(n,a,o);break;case 32:rpt(n,a,i,o);break;case 33:apt(n,a,o);break;case 34:spt(n,a,o);break;case 35:cpt(n,a,o);break;case 36:lpt(n,a,i,o);break;case 37:opt(n,a,i,o);break;case 38:upt(n,a,i,o);break;case 39:fpt(n,a,i,o);break;case 40:dpt(n,a,o);break;case 41:hpt(n,a,o);break;default:Wh(a.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&iS(o)){var s=n.text.charCodeAt(n.charIdx-1);iS(s)||n.addMachine(M4(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return da(n,u)});return n.matches}function O4(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(Apt(i,28));else if(n===64)e.addMachine(ypt(i,30));else if(n===47)e.addMachine(yJ(i,11));else if(n===43)e.addMachine(AJ(i,37));else if(n===40)e.addMachine(AJ(i,32));else{if(Ya(n)&&(e.addMachine(AJ(i,38)),e.addMachine(gpt(i,13))),mJ(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(_pt(i,o))}iS(n)&&e.addMachine(M4(i,0)),qh(n)&&e.addMachine(yJ(i,5))}}function wmt(e,t,n){n===58?t.state=2:n===45?t.state=1:fJ(n)||e.removeMachine(t)}function Imt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(yJ(i,11))):fJ(n)?t.state=0:e.removeMachine(t))}function Dmt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):dg(n)?(t.state=5,iS(n)&&e.addMachine(M4(i,0))):e.removeMachine(t)}function Pmt(e,t,n){n===47?t.state=4:dJ(n)?(t.state=10,t.acceptStateReached=!0):da(e,t)}function Rmt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):dg(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function Omt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function Mmt(e,t,n){dg(n)?t.state=5:e.removeMachine(t)}function Bmt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:D4(n)?t.state=10:I4(n)||da(e,t)}function Lmt(e,t,n,i){i===45||(i===46?da(e,t):dg(i)?t.state=5:da(e,t))}function Nmt(e,t,n,i){i===46?da(e,t):dg(i)?(t.state=5,t.acceptStateReached=!0):da(e,t)}function Fmt(e,t,n){n===46?t.state=14:n===58?t.state=8:Ya(n)||(D4(n)?t.state=10:qh(n)?e.removeMachine(t):da(e,t))}function kmt(e,t,n){Ya(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):da(e,t)}function zmt(e,t,n){Ya(n)?t.state=9:da(e,t)}function Umt(e,t,n){Ya(n)||(D4(n)?t.state=10:da(e,t))}function Vmt(e,t,n){dJ(n)||da(e,t)}function jmt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:Tb(e,t,i)}function Gmt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:Tb(e,t,i)}function Hmt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:Tb(e,t,i)}function Wmt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:Tb(e,t,i)}function qmt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:Tb(e,t,i)}function Ymt(e,t,n){n===58?t.state=21:Tb(e,t,n)}function Xmt(e,t,n){P4(n)?t.state=22:e.removeMachine(t)}function Tb(e,t,n){n===46?t.state=23:n===64?t.state=24:P4(n)?t.state=22:e.removeMachine(t)}function Kmt(e,t,n){n===46||n===64?e.removeMachine(t):P4(n)?t.state=22:e.removeMachine(t)}function Qmt(e,t,n){dg(n)?t.state=25:e.removeMachine(t)}function $mt(e,t,n){n===46?t.state=27:n===45?t.state=26:I4(n)||da(e,t)}function Jmt(e,t,n){n===45||n===46?da(e,t):I4(n)?t.state=25:da(e,t)}function Zmt(e,t,n){n===46||n===45?da(e,t):dg(n)?(t.state=25,t.acceptStateReached=!0):da(e,t)}function ept(e,t,n){pJ(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function tpt(e,t,n){pJ(n)||da(e,t)}function npt(e,t,n){gJ(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function ipt(e,t,n){gJ(n)||(qh(n)?e.removeMachine(t):da(e,t))}function opt(e,t,n,i){Ya(i)?t.state=38:(e.removeMachine(t),O4(e,n,i))}function rpt(e,t,n,i){Ya(i)?t.state=33:e.removeMachine(t),O4(e,n,i)}function apt(e,t,n){Ya(n)?t.state=34:e.removeMachine(t)}function spt(e,t,n){Ya(n)?t.state=35:e.removeMachine(t)}function cpt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function lpt(e,t,n,i){Ya(i)?t.state=38:_J(i)?t.state=39:e.removeMachine(t)}function upt(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,R4(i)?t.state=40:i===35?t.state=41:Ya(i)||(i===40?t.state=32:_J(i)?t.state=39:(da(e,t),iS(i)&&e.addMachine(M4(o,0))))}function fpt(e,t,n,i){Ya(i)?t.state=38:i===40?t.state=32:(da(e,t),O4(e,n,i))}function dpt(e,t,n){R4(n)||(n===35?t.state=41:Ya(n)?t.state=38:da(e,t))}function hpt(e,t,n){R4(n)?t.state=40:Ya(n)?e.removeMachine(t):da(e,t)}function da(e,t){var n=e.matches,i=e.text,o=e.charIdx,r=e.tagBuilder,a=e.stripPrefix,s=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,o);switch(p=ppt(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=uJ.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!Pbe(p))return;break}case 1:{if(!Rbe(p))return;break}case 2:{if(!Obe(p))return;break}default:Wh(t)}n.push(new Mbe({tagBuilder:r,matchedText:p,offset:d,urlMatchType:mpt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:a,stripTrailingSlash:s,decodePercentEncoding:c}));break}case 1:{Lbe(p)&&n.push(new Nbe({tagBuilder:r,matchedText:p,offset:d,email:p.replace(Bbe,"")}));break}case 2:{Fbe(p)&&n.push(new zbe({tagBuilder:r,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{Ube(p,f)&&n.push(new jbe({tagBuilder:r,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),Gbe(p)){var A=p.replace(/[^0-9,;#]/g,"");n.push(new Hbe({tagBuilder:r,matchedText:p,offset:d,number:A,plusSign:p.charAt(0)==="+"}))}break}default:Wh(t)}}}function mpt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:Wh(e)}}var Wbe={")":"(","}":"{","]":"["};function ppt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);wbe(o)?t[i]++:lJ(o)&&t[Wbe[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if(lJ(o)){var a=Wbe[i];if(t[a]<0)t[a]++,r--;else break}else if(w4(o))r--;else break}return e.slice(0,r+1)}function M4(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function yJ(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function gpt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function _pt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function Apt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function ypt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function AJ(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function qbe(e){return e.type===0&&e.matchType===0}var Ip=(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})(),bJ=new Ip,xpt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=bJ,this.html=t,this.callbacks=n}return e})();function Xbe(e,t){for(var n=new xpt(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:bpt(n,o);break;case 1:Tpt(n,o,r);break;case 2:Ept(n,o,r);break;case 3:Cpt(n,o,r);break;case 4:vpt(n,o,r);break;case 5:Spt(n,o,r);break;case 6:wpt(n,o,r);break;case 7:Ipt(n,o,r);break;case 8:Dpt(n,o);break;case 9:Ppt(n,o);break;case 10:Rpt(n,o,r);break;case 11:Opt(n,o,r);break;case 12:Mpt(n,o);break;case 13:Bpt(n);break;case 14:Lpt(n,o);break;case 15:Npt(n,o);break;case 16:Fpt(n,o);break;case 17:kpt(n,o);break;case 18:zpt(n,o);break;case 19:Upt(n,o);break;case 20:Vpt(n,o);break;default:Wh(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&jpt(n)}function bpt(e,t){t==="<"&&Dp(e)}function Tpt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new Ip(qa(qa({},e.currentTag),{isClosing:!0}))):t==="<"?Dp(e):fg(n)?(e.state=3,e.currentTag=new Ip(qa(qa({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=bJ)}function Cpt(e,t,n){UA(n)?(e.currentTag=new Ip(qa(qa({},e.currentTag),{name:xJ(e)})),e.state=4):t==="<"?Dp(e):t==="/"?(e.currentTag=new Ip(qa(qa({},e.currentTag),{name:xJ(e)})),e.state=12):t===">"?(e.currentTag=new Ip(qa(qa({},e.currentTag),{name:xJ(e)})),Pp(e)):!fg(n)&&!Ya(n)&&t!==":"&&Rd(e)}function Ept(e,t,n){t===">"?Rd(e):fg(n)?e.state=3:Rd(e)}function vpt(e,t,n){UA(n)||(t==="/"?e.state=12:t===">"?Pp(e):t==="<"?Dp(e):t==="="||S4(n)||Ebe(n)?Rd(e):e.state=5)}function Spt(e,t,n){UA(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?Pp(e):t==="<"?Dp(e):S4(n)&&Rd(e)}function wpt(e,t,n){UA(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?Pp(e):t==="<"?Dp(e):S4(n)?Rd(e):e.state=5)}function Ipt(e,t,n){UA(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Rd(e):t==="<"?Dp(e):e.state=10)}function Dpt(e,t){t==='"'&&(e.state=11)}function Ppt(e,t){t==="'"&&(e.state=11)}function Rpt(e,t,n){UA(n)?e.state=4:t===">"?Pp(e):t==="<"&&Dp(e)}function Opt(e,t,n){UA(n)?e.state=4:t==="/"?e.state=12:t===">"?Pp(e):t==="<"?Dp(e):(e.state=4,Gpt(e))}function Mpt(e,t){t===">"?(e.currentTag=new Ip(qa(qa({},e.currentTag),{isClosing:!0})),Pp(e)):Rd(e)}function Bpt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new Ip(qa(qa({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new Ip(qa(qa({},e.currentTag),{type:"doctype"})),e.state=20):Rd(e)}function Lpt(e,t){t==="-"?e.state=15:t===">"?Rd(e):e.state=16}function Npt(e,t){t==="-"?e.state=18:t===">"?Rd(e):e.state=16}function Fpt(e,t){t==="-"&&(e.state=17)}function kpt(e,t){t==="-"?e.state=18:e.state=16}function zpt(e,t){t===">"?Pp(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function Upt(e,t){t==="-"?e.state=17:t===">"?Pp(e):e.state=16}function Vpt(e,t){t===">"?Pp(e):t==="<"&&Dp(e)}function Rd(e){e.state=0,e.currentTag=bJ}function Dp(e){e.state=1,e.currentTag=new Ip({idx:e.charIdx})}function Pp(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),Rd(e),e.currentDataIdx=e.charIdx+1}function jpt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function xJ(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function Gpt(e){e.charIdx--}var Hpt=(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=Wpt(t.urls),this.email=gf(t.email)?t.email:this.email,this.phone=gf(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=gf(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=qpt(t.stripPrefix),this.stripTrailingSlash=gf(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=gf(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Vbe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&kbe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Ypt(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 Xbe(t,{onOpenTag:function(a){i.indexOf(a)>=0&&o++},onText:function(a,s){if(o===0){var c=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,u=a.split(c),f=s;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);r.push.apply(r,pbe([],mbe(g),!1))}f+=d.length})}},onCloseTag:function(a){i.indexOf(a)>=0&&(o=Math.max(o-1,0))},onComment:function(){},onDoctype:function(){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(Xpt);for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||zA(t,function(n){return n.getType()==="hashtag"}),this.email||zA(t,function(n){return n.getType()==="email"}),this.phone||zA(t,function(n){return n.getType()==="phone"}),this.mention||zA(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||zA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||zA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||zA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=Ybe(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=new Array(n.length*2+1),o=0,r=0,a=n.length;r<a;r++){var s=n[r];i.push(t.substring(o,s.getOffset())),i.push(this.createMatchReturnVal(s)),o=s.getOffset()+s.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 v4)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Cbe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=gbe,e})(),Kbe=Hpt;function Wpt(e){return e==null&&(e=!0),gf(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:gf(e.schemeMatches)?e.schemeMatches:!0,tldMatches:gf(e.tldMatches)?e.tldMatches:!0,ipV4Matches:gf(e.ipV4Matches)?e.ipV4Matches:!0}}function qpt(e){return e==null&&(e=!0),gf(e)?{scheme:e,www:e}:{scheme:gf(e.scheme)?e.scheme:!0,www:gf(e.www)?e.www:!0}}function Ypt(e){return typeof e=="number"?{length:e,location:"end"}:qa({length:Number.POSITIVE_INFINITY,location:"end"},e)}function Xpt(e,t){return e.getOffset()-t.getOffset()}var B4=Kbe;var oTe;typeof DOMParser<"u"&&(oTe=new DOMParser);var Kpt=new B4({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),L4=32,Qbe=2414016,$be=1,Jbe=16093e3,Zbe=.1,Qpt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Uo={gpx:Qpt};function $pt(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 TJ(e,t){let n=m1(e,"id");return n=l(n)?n:Hn(),t.getOrCreateEntity(n)}function CJ(e){let t=eTe(e,"lon"),n=eTe(e,"lat"),i=d1(e,"ele",Uo.gpx);return h.fromDegrees(t,n,i)}function eTe(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 m1(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function VA(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let a=i[r];if(a.localName===t&&n.indexOf(a.namespaceURI)!==-1)return a}}function EJ(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let a=0;a<r;a++){let s=o[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function d1(e,t,n){let i=VA(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Iu(e,t,n){let i=VA(e,t,n);if(l(i))return i.textContent.trim()}function rTe(e){let t=new bl;return t.width=L4,t.height=L4,t.scaleByDistance=new Ut(Qbe,$be,Jbe,Zbe),t.pixelOffsetScaleByDistance=new Ut(Qbe,$be,Jbe,Zbe),t.verticalOrigin=new fi(zn.BOTTOM),t.image=e,t}function Jpt(){let e=new Pm;return e.translucencyByDistance=new Ut(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=Bi.LEFT,e.font="16px sans-serif",e.style=_r.FILL_AND_OUTLINE,e}function aTe(e){let t=new El;return t.width=4,t.material=new sb,t.material.color=l(e)?e:U.RED,t.material.outlineWidth=2,t.material.outlineColor=U.BLACK,t}var tTe={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"}},h1;typeof document<"u"&&(h1=document.createElement("div"));function vJ(e,t){let n,i="",o=Object.keys(tTe),r=o.length;for(n=0;n<r;n++){let f=o[n],d=tTe[f];d.value=Iu(e,d.tag,Uo.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=Kpt.link(i),h1.innerHTML=i;let a=h1.querySelectorAll("a");for(n=0;n<a.length;n++)a[n].setAttribute("target","_blank");let s=U.WHITE,c=U.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${s.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${h1.innerHTML}</div>`,h1.innerHTML="",u}function sTe(e,t,n,i){let o=CJ(t),r=TJ(t,n);r.position=o;let a=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,L4);r.billboard=rTe(a);let s=Iu(t,"name",Uo.gpx);r.name=s,r.label=Jpt(),r.label.text=s,r.description=vJ(t,r),i.clampToGround&&(r.billboard.heightReference=nt.CLAMP_TO_GROUND,r.label.heightReference=nt.CLAMP_TO_GROUND)}function Zpt(e,t,n,i){let o=TJ(t,n);o.description=vJ(t,o);let r=EJ(t,"rtept",Uo.gpx),a=new Array(r.length);for(let s=0;s<r.length;s++)sTe(e,r[s],n,i),a[s]=CJ(r[s]);o.polyline=aTe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=a}function e0t(e,t,n,i){let o=TJ(t,n);o.description=vJ(t,o);let r=EJ(t,"trkseg",Uo.gpx),a=[],s=[],c,u=!0,f=new Tc;for(let d=0;d<r.length;d++)c=t0t(r[d]),a=a.concat(c.positions),c.times.length>0?(s=s.concat(c.times),f.addSamples(s,a),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,L4);o.billboard=rTe(d),o.position=f,i.clampToGround&&(o.billboard.heightReference=nt.CLAMP_TO_GROUND),o.availability=new Ia,o.availability.addInterval(new wn({start:s[0],stop:s[s.length-1]}))}o.polyline=aTe(i.trackColor),o.polyline.positions=a,i.clampToGround&&(o.polyline.clampToGround=!0)}function t0t(e){let t={positions:[],times:[]},n=EJ(e,"trkpt",Uo.gpx),i;for(let o=0;o<n.length;o++){let r=CJ(n[o]);t.positions.push(r),i=Iu(n[o],"time",Uo.gpx),l(i)&&t.times.push(Q.fromIso8601(i))}return t}function n0t(e){let t=VA(e,"metadata",Uo.gpx);if(l(t)){let n={name:Iu(t,"name",Uo.gpx),desc:Iu(t,"desc",Uo.gpx),author:i0t(t),copyright:r0t(t),link:cTe(t),time:Iu(t,"time",Uo.gpx),keywords:Iu(t,"keywords",Uo.gpx),bounds:a0t(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 i0t(e){let t=VA(e,"author",Uo.gpx);if(l(t)){let n={name:Iu(t,"name",Uo.gpx),email:o0t(t),link:cTe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function o0t(e){let t=VA(e,"email",Uo.gpx);if(l(t)){let n=Iu(t,"id",Uo.gpx),i=Iu(t,"domain",Uo.gpx);return`${n}@${i}`}}function cTe(e){let t=VA(e,"link",Uo.gpx);if(l(t)){let n={href:m1(t,"href"),text:Iu(t,"text",Uo.gpx),mimeType:Iu(t,"type",Uo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function r0t(e){let t=VA(e,"copyright",Uo.gpx);if(l(t)){let n={author:m1(t,"author"),year:Iu(t,"year",Uo.gpx),license:Iu(t,"license",Uo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function a0t(e){let t=VA(e,"bounds",Uo.gpx);if(l(t)){let n={minLat:d1(t,"minlat",Uo.gpx),maxLat:d1(t,"maxlat",Uo.gpx),minLon:d1(t,"minlon",Uo.gpx),maxLon:d1(t,"maxlon",Uo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var nTe={wpt:sTe,rte:Zpt,trk:e0t};function s0t(e,t,n,i){let o=Object.keys(nTe),r=o.length;for(let a=0;a<r;a++){let s=o[a],c=nTe[s],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===s&&Uo.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function iTe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=m1(o,"version"),a=m1(o,"creator"),s,c=n0t(o);l(c)&&(s=c.name),o.localName==="gpx"?s0t(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=Q.equals(d,Qe.MINIMUM_VALUE),m=Q.equals(p,Qe.MAXIMUM_VALUE);if(!g||!m){let y;g&&(y=new Date,y.setHours(0,0,0,0),d=Q.fromDate(y)),m&&(y=new Date,y.setHours(24,0,0,0),p=Q.fromDate(y)),u=new gp,u.startTime=d,u.stopTime=p,u.currentTime=Q.clone(d),u.clockRange=Pa.LOOP_STOP,u.clockStep=Bo.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(p,d)/60,1),31556900))}let A=!1;return e._name!==s&&(e._name=s,A=!0),e._creator!==a&&(e._creator=a,A=!0),c0t(e._metadata,c)&&(e._metadata=c,A=!0),e._version!==r&&(e._version=r,A=!0),u!==e._clock&&(A=!0,e._clock=u),A&&e._changed.raiseEvent(e),Da.setLoading(e,!1),e}function c0t(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 l0t(e,t,n,i){i=i??G.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,a=n.credits;if(l(a)){let s=a.length;for(let c=0;c<s;c++)r.push(a[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?$pt(r).then(function(a){let s,c;try{s=oTe.parseFromString(a,"application/xml")}catch(u){c=u.toString()}if(l(c)||s.body||s.documentElement.tagName==="parsererror"){let u=l(c)?c:s.documentElement.firstChild.nodeValue;throw u||(u=s.body.innerText),new re(u)}return iTe(e,s,i)}):iTe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function oS(){this._changed=new ye,this._error=new ye,this._loading=new ye,this._clock=void 0,this._entityCollection=new Js(this),this._entityCluster=new Ed,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new FA}oS.load=function(e,t){return new oS().load(e,t)};Object.defineProperties(oS.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}}});oS.prototype.update=function(e){return!0};oS.prototype.load=function(e,t){if(!l(e))throw new _e("data is required.");t=t??G.EMPTY_OBJECT,Da.setLoading(this,!0);let n=this._name,i=this;return l0t(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),a=r.start,s=r.stop,c=Q.equals(a,Qe.MINIMUM_VALUE),u=Q.equals(s,Qe.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),a=Q.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),s=Q.fromDate(d)),o=new gp,o.startTime=a,o.stopTime=s,o.currentTime=Q.clone(a),o.clockRange=Pa.LOOP_STOP,o.clockStep=Bo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(s,a)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Da.setLoading(i,!1),i}).catch(function(o){return Da.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var N4=oS;function u0t(e,t){this.position=e,this.headingPitchRoll=t}var F4=u0t;var K1=Na(ju(),1);var SJ=new Date(2107,11,31),wJ=new Date(1980,0,1),zt=void 0,Cb=1/0,_f="undefined",Af="function",lTe="object";var f0t=64,uTe=2;try{typeof navigator!=_f&&navigator.hardwareConcurrency&&(uTe=navigator.hardwareConcurrency)}catch{}var d0t={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:uTe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=_f&&CompressionStream,DecompressionStream:typeof DecompressionStream!=_f&&DecompressionStream},fTe=Object.assign({},d0t);function p1(){return fTe}function k4(e){return Math.max(e.chunkSize,f0t)}function Rp(e){let{baseURI:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:a,CompressionStream:s,DecompressionStream:c,CompressionStreamZlib:u,DecompressionStreamZlib:f,workerURI:d,wasmURI:p}=e;Od("baseURI",t),Od("wasmURI",p),Od("workerURI",d),Od("chunkSize",n),Od("maxWorkers",i),Od("terminateWorkerTimeout",o),Od("useCompressionStream",r),Od("useWebWorkers",a),Od("CompressionStream",s),Od("DecompressionStream",c),Od("CompressionStreamZlib",u),Od("DecompressionStreamZlib",f)}function Od(e,t){t!==zt&&(fTe[e]=t)}var dTe=[];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;dTe[e]=t}var hg=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^dTe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var g1=class extends TransformStream{constructor(){let t,n=new hg;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}};function rS(e){if(typeof TextEncoder==_f){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 Vl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Vl.getPartial(n);return i===32?e.concat(t):Vl._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+Vl.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]=Vl.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 a=0;a<e.length;a++)i.push(n|e[a]>>>t),n=e[a]<<32-t;let o=e.length?e[e.length-1]:0,r=Vl.getPartial(o);return i.push(Vl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},_1={bytes:{fromBits(e){let n=Vl.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)(r&3)===0&&(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(Vl.partial(8*(n&3),i)),t}}},hTe={};hTe.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=_1.utf8String.toBits(e));let n=t._buffer=Vl.concat(t._buffer,e),i=t._length,o=t._length=i+Vl.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),a=0;for(let s=t.blockSize+i-(t.blockSize+i&t.blockSize-1);s<=o;s+=t.blockSize)t._block(r.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),t}finalize(){let e=this,t=e._buffer,n=e._h;t=Vl.concat(t,[Vl.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 u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],a=n[2],s=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,a,s)+c+i[u]+t._key[Math.floor(u/20)]|0;c=s,s=a,a=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0}};var IJ={};IJ.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,a,s,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[a=e.slice(0),s=[]],r=o;r<4*o+28;r++){let u=a[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),a[r]=a[r-o]^u}for(let u=0;r;u++,r--){let f=a[u&3?r:r-4];r<=4||u<4?s[u]=f:s[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&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=[],a,s,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=a=0;!n[f];f^=s||1,a=r[a]||1){let d=a^a<<1^a<<2^a<<3^a<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=o[c=o[s=o[f]]];let p=u*16843009^c*65537^s*257^f*16843008,g=o[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].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],a=r[0],s=r[1],c=r[2],u=r[3],f=r[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],A=4,y,x,b;for(let T=0;T<i;T++)y=a[d>>>24]^s[p>>16&255]^c[g>>8&255]^u[m&255]^n[A],x=a[p>>>24]^s[g>>16&255]^c[m>>8&255]^u[d&255]^n[A+1],b=a[g>>>24]^s[m>>16&255]^c[d>>8&255]^u[p&255]^n[A+2],m=a[m>>>24]^s[d>>16&255]^c[p>>8&255]^u[g&255]^n[A+3],A+=4,d=y,p=x,g=b;for(let T=0;T<4;T++)o[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[A++],y=d,d=p,p=g,g=m,m=y;return o}};var mTe={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}},DJ={};DJ.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=Vl.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let a=e.encrypt(n);t[r]^=a[0],t[r+1]^=a[1],t[r+2]^=a[2],t[r+3]^=a[3]}return Vl.clamp(t,o)}};var jA={importKey(e){return new jA.hmacSha1(_1.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,a,s,c,u,f=new ArrayBuffer(o),d=new DataView(f),p=0,g=Vl;for(t=_1.bytes.toBits(t),u=1;p<(o||1);u++){for(r=a=e.encrypt(g.concat(t,[u])),s=1;s<n;s++)for(a=e.encrypt(a),c=0;c<a.length;c++)r[c]^=a[c];for(s=0;p<(o||1)&&s<r.length;s++)d.setInt32(p,r[s]),p+=4}return f.slice(0,i/8)}};jA.hmacSha1=class{constructor(e){let t=this,n=t._hash=hTe.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 h0t=typeof crypto!=_f&&typeof crypto.getRandomValues==Af,mg="Invalid password",GA="Invalid signature",pg="zipjs-abort-check-password";function z4(e){return h0t?crypto.getRandomValues(e):mTe.getRandomValues(e)}var aS=16,m0t="raw",_Te={name:"PBKDF2"},p0t={name:"HMAC"},g0t="SHA-1",_0t=Object.assign({hash:p0t},_Te),PJ=Object.assign({iterations:1e3,hash:{name:g0t}},_Te),A0t=["deriveBits"],y1=[8,12,16],A1=[16,24,32],HA=10,y0t=[0,0,0,0],j4=typeof crypto!=_f,T1=j4&&crypto.subtle,ATe=j4&&typeof T1!=_f,Op=_1.bytes,x0t=IJ.aes,b0t=DJ.ctrGladman,T0t=jA.hmacSha1,pTe=j4&&ATe&&typeof T1.importKey==Af,gTe=j4&&ATe&&typeof T1.deriveBits==Af,U4=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(a=>this.resolveReady=a),password:bTe(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(a,s){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await C0t(c,f,u,Md(a,0,y1[f]+2)),a=Md(a,y1[f]+2),r?s.error(new Error(pg)):d()):await p;let g=new Uint8Array(a.length-HA-(a.length-HA)%aS);s.enqueue(yTe(c,a,g,0,HA,!0))},async flush(a){let{signed:s,ctr:c,hmac:u,pending:f,ready:d}=this;if(u&&c){await d;let p=Md(f,0,f.length-HA),g=Md(f,f.length-HA),m=new Uint8Array;if(p.length){let A=b1(Op,p);u.update(A);let y=c.update(A);m=x1(Op,y)}if(s){let A=Md(x1(Op,u.digest()),0,HA);for(let y=0;y<HA;y++)if(A[y]!=g[y])throw new Error(GA)}a.enqueue(m)}}})}},V4=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:bTe(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,a){let s=this,{password:c,strength:u,resolveReady:f,ready:d}=s,p=new Uint8Array;c?(p=await E0t(s,u,c),f()):await d;let g=new Uint8Array(p.length+r.length-r.length%aS);g.set(p,0),a.enqueue(yTe(s,r,g,p.length,0))},async flush(r){let{ctr:a,hmac:s,pending:c,ready:u}=this;if(s&&a){await u;let f=new Uint8Array;if(c.length){let d=a.update(b1(Op,c));s.update(d),f=x1(Op,d)}o.signature=x1(Op,s.digest()).slice(0,HA),r.enqueue(RJ(f,o.signature))}}}),o=this}};function yTe(e,t,n,i,o,r){let{ctr:a,hmac:s,pending:c}=e,u=t.length-o;c.length&&(t=RJ(c,t),n=w0t(n,u-u%aS));let f;for(f=0;f<=u-aS;f+=aS){let d=b1(Op,Md(t,f,f+aS));r&&s.update(d);let p=a.update(d);r||s.update(p),n.set(x1(Op,p),f+i)}return e.pending=Md(t,f),n}async function C0t(e,t,n,i){let o=await xTe(e,t,n,Md(i,0,y1[t])),r=Md(i,y1[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(mg)}async function E0t(e,t,n){let i=z4(new Uint8Array(y1[t])),o=await xTe(e,t,n,i);return RJ(i,o)}async function xTe(e,t,n,i){e.password=null;let o=await v0t(m0t,n,_0t,!1,A0t),r=await S0t(Object.assign({salt:i},PJ),o,8*(A1[t]*2+2)),a=new Uint8Array(r),s=b1(Op,Md(a,0,A1[t])),c=b1(Op,Md(a,A1[t],A1[t]*2)),u=Md(a,A1[t]*2);return Object.assign(e,{keys:{key:s,authentication:c,passwordVerification:u},ctr:new b0t(new x0t(s),Array.from(y0t)),hmac:new T0t(c)}),u}async function v0t(e,t,n,i,o){if(pTe)try{return await T1.importKey(e,t,n,i,o)}catch{return pTe=!1,jA.importKey(t)}else return jA.importKey(t)}async function S0t(e,t,n){if(gTe)try{return await T1.deriveBits(e,t,n)}catch{return gTe=!1,jA.pbkdf2(t,e.salt,PJ.iterations,n)}else return jA.pbkdf2(t,e.salt,PJ.iterations,n)}function bTe(e,t){return t===zt?rS(e):t}function RJ(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 w0t(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Md(e,t,n){return e.subarray(t,n)}function x1(e,t){return e.fromBits(t)}function b1(e,t){return e.toBits(t)}var C1=12,G4=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),vTe(this,t)},transform(o,r){let a=this;if(a.password){let s=TTe(a,o.subarray(0,C1));if(a.password=null,s.at(-1)!=a.passwordVerification)throw new Error(mg);o=o.subarray(C1)}i?r.error(new Error(pg)):r.enqueue(TTe(a,o))}})}},H4=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),vTe(this,t)},transform(i,o){let r=this,a,s;if(r.password){r.password=null;let c=z4(new Uint8Array(C1));c[C1-1]=r.passwordVerification,a=new Uint8Array(i.length+c.length),a.set(CTe(r,c),0),s=C1}else a=new Uint8Array(i.length),s=0;a.set(CTe(r,i),s),o.enqueue(a)}})}};function TTe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=STe(e)^t[i],OJ(e,n[i]);return n}function CTe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=STe(e)^t[i],OJ(e,t[i]);return n}function vTe(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new hg(n[0]),crcKey2:new hg(n[2])});for(let i=0;i<t.length;i++)OJ(e,t.charCodeAt(i))}function OJ(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=ETe(Math.imul(ETe(i+wTe(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function STe(e){let t=e.keys[2]|2;return wTe(Math.imul(t,t^1)>>>8)}function wTe(e){return e&255}function ETe(e){return e&4294967295}var sS="Invalid uncompressed size",I0t="deflate-raw",D0t="deflate64-raw",W4=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamZlib:i,CompressionStream:o}){super({});let{compressed:r,encrypted:a,useCompressionStream:s,zipCrypto:c,signed:u,level:f}=t,d=this,p,g,m=super.readable;(!a||c)&&u&&(p=new g1,m=Mp(m,p)),r&&(m=DTe(m,s,{level:f,chunkSize:n},o,i,o)),a&&(c?m=Mp(m,new H4(t)):(g=new V4(t),m=Mp(m,g))),ITe(d,m,()=>{let A;a&&!c&&(A=g.signature),(!a||c)&&u&&(A=new DataView(p.value.buffer).getUint32(0)),d.signature=A})}},q4=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamZlib:i,DecompressionStream:o}){super({});let{zipCrypto:r,encrypted:a,signed:s,signature:c,compressed:u,useCompressionStream:f,deflate64:d}=t,p,g,m=super.readable;a&&(r?m=Mp(m,new G4(t)):(g=new U4(t),m=Mp(m,g))),u&&(m=DTe(m,f,{chunkSize:n,deflate64:d},o,i,o)),(!a||r)&&s&&(p=new g1,m=Mp(m,p)),ITe(this,m,()=>{if((!a||r)&&s){let A=new DataView(p.value.buffer);if(c!=A.getUint32(0,!1))throw new Error(GA)}})}};function ITe(e,t,n){t=Mp(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function DTe(e,t,n,i,o,r){let a=t&&i?i:o||r,s=n.deflate64?D0t:I0t;try{e=Mp(e,new a(s,n))}catch(c){if(t)if(o)e=Mp(e,new o(s,n));else if(r)e=Mp(e,new r(s,n));else throw c;else throw c}return e}function Mp(e,t){return e.pipeThrough(t)}var PTe="message",RTe="start",OTe="pull",MJ="data",MTe="ack",BJ="close",K4="deflate",Q4="inflate";var Y4=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(K4)?r=W4:o.startsWith(Q4)&&(r=q4),i.outputSize=0;let a=0,s=new r(t,n),c=super.readable,u=new TransformStream({transform(d,p){d&&d.length&&(a+=d.length,p.enqueue(d))},flush(){Object.assign(i,{inputSize:a})}}),f=new TransformStream({transform(d,p){if(d&&d.length&&(p.enqueue(d),i.outputSize+=d.length,t.outputSize!==zt&&i.outputSize>t.outputSize))throw new Error(sS)},flush(){let{signature:d}=s;Object.assign(i,{signature:d,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(s).pipeThrough(f)}})}},X4=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 a=new Uint8Array(n.length+o.length);a.set(n),a.set(o,n.length),o=a,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var BTe={type:"module"},$4,LJ,LTe,FJ=!0;try{FJ=typeof structuredClone==Af&&structuredClone(new DOMException("","AbortError")).code!==zt}catch{}var NTe=()=>{};function FTe({initModule:e}){NTe=e}var cS=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:a,useWebWorkers:s,transferStreams:c,workerURI:u},f){let{signal:d}=a;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new X4(r.chunkSize)).pipeThrough(new kJ(a),{signal:d}),writable:i,options:Object.assign({},o),workerURI:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:m}=t;g?(m?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,f(t)}}),$4===zt&&($4=typeof Worker!=_f),(s&&$4?P0t:kTe)(t,r)}},kJ=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await NJ(t,i)},async transform(a,s){r+=a.length,n&&await NJ(n,r,i),s.enqueue(a)},async flush(){o&&await NJ(o,r)}})}};async function NJ(e,...t){try{await e(...t)}catch{}}function kTe(e,t){return{run:()=>R0t(e,t)}}function P0t(e,t){let{baseURI:n,chunkSize:i}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Af&&(o=o());let r;try{r=J4(e.workerURI,n,e)}catch{return $4=!1,kTe(e,t)}Object.assign(e,{worker:r,interface:{run:()=>O0t(e,{chunkSize:i,wasmURI:o,baseURI:n})}})}return e.interface}async function R0t({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(!e.useCompressionStream)try{await NTe(o)}catch{e.useCompressionStream=!0}r=new Y4(e,o),await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:a,inputSize:s,outputSize:c}=r;return{signature:a,inputSize:s,outputSize:c}}catch(a){throw r&&(a.outputSize=r.outputSize),a}finally{i()}}async function O0t(e,t){let n,i,o=new Promise((d,p)=>{n=d,i=p});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:a}=e,{writable:s,closed:c}=M0t(e.writable),u=Z4({type:RTe,options:a,config:t,readable:r,writable:s},e);u||Object.assign(e,{reader:r.getReader(),writer:s.getWriter()});let f=await o;return u||await s.getWriter().close(),await c,f}function M0t(e){let{writable:t,readable:n}=new TransformStream,i=n.pipeTo(e,{preventClose:!0});return{writable:t,closed:i}}function J4(e,t,n,i,o=!0){let r,a,s;if(LJ===zt){let c=typeof e==Af;c?a=e(o):a=e;let u=a.startsWith("data:"),f=a.startsWith("blob:");if(u||f){i===zt&&(i=!1),i&&(s=BTe);try{r=new Worker(a,s)}catch(d){if(f)try{URL.revokeObjectURL(a)}catch{}if(c&&f)return J4(e,t,n,i,!1);if(i)throw d;return J4(e,t,n,!0,!1)}}else{i===zt&&(i=!0),i&&(s=BTe);try{a=new URL(a,t)}catch{}try{r=new Worker(a,s)}catch(d){if(i)throw d;return J4(e,t,n,!1,o)}}LJ=a,LTe=s}else r=new Worker(LJ,LTe);return r.addEventListener(PTe,c=>B0t(c,n)),r}function Z4(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:a,writable:s}=e,c=[];if(r&&(e.value=r,c.push(e.value.buffer)),o&&FJ?(a&&c.push(a),s&&c.push(s)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{FJ=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function B0t({data:e},t){let{type:n,value:i,messageId:o,result:r,error:a}=e,{reader:s,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d}=t;try{if(a){let{message:g,stack:m,code:A,name:y,outputSize:x}=a,b=new Error(g);Object.assign(b,{stack:m,code:A,name:y,outputSize:x}),p(b)}else{if(n==OTe){let{value:g,done:m}=await s.read();Z4({type:MJ,value:g,done:m,messageId:o},t)}n==MJ&&(await c.ready,await c.write(new Uint8Array(i)),Z4({type:MTe,messageId:o},t)),n==BJ&&p(null,r)}}catch(g){Z4({type:BJ,messageId:o},t),p(g)}function p(g,m){g?f(g):u(m),c&&c.releaseLock(),d()}}var Eb=[],zJ=[];var zTe=0;async function e8(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:a,compressed:s,signed:c,encrypted:u}=n,{workerURI:f,maxWorkers:d}=i;t.transferStreams=o||o===zt;let p=!s&&!c&&!u&&!t.transferStreams;return t.useWebWorkers=!p&&(r||r===zt&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&f?f:zt,n.useCompressionStream=a||a===zt&&i.useCompressionStream,(await g()).run();async function g(){let A=Eb.find(y=>!y.busy);if(A)return UTe(A),new cS(A,e,t,m);if(Eb.length<d){let y={indexWorker:zTe};return zTe++,Eb.push(y),new cS(y,e,t,m)}else return new Promise(y=>zJ.push({resolve:y,stream:e,workerOptions:t}))}function m(A){if(zJ.length){let[{resolve:y,stream:x,workerOptions:b}]=zJ.splice(0,1);y(new cS(A,x,b,m))}else A.worker?(UTe(A),L0t(A,t)):Eb=Eb.filter(y=>y!=A)}}function L0t(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{Eb=Eb.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function UTe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var N0t="Writer iterator completed too soon",F0t="Writer not initialized",k0t="text/plain";var z0t="Content-Type";var U0t=64*1024,USi=256*1024,UJ="writable",lS=class{constructor(){this.size=0}init(){this.initialized=!0}},E1=class extends lS{get readable(){let t=this,{chunkSize:n=U0t}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:a,diskNumberStart:s}=i,{chunkOffset:c}=this,u=a===zt?n:Math.min(n,a-c),f=await nc(t,r+c,u,s);o.enqueue(f),c+n>a||a===zt&&!f.length&&u?o.close():this.chunkOffset+=n}});return i}},t8=class extends lS{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(F0t);return t.writeUint8Array(i)}});Object.defineProperty(t,UJ,{get(){return n}})}writeUint8Array(){}};var v1=class extends t8{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&&(o.length>2?n.data+=btoa(o):n.pending+=o)}getData(){return this.data+btoa(this.pending)}},Bp=class extends E1{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,a=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,o)),new Uint8Array(a)}},uS=class extends lS{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([z0t,t]),Object.defineProperty(n,UJ,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},S1=class extends Bp{constructor(t){super(new Blob([t],{type:k0t}))}},w1=class extends uS{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,a)=>{Object.assign(o,{onload:({target:s})=>r(s.result),onerror:()=>a(o.error)}),o.readAsText(i,t)})}}};var n8=class extends E1{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,a,s=i;s==-1&&(s=r.length-1);let c=t;for(;r[s]&&c>=r[s].size;)c-=r[s].size,s++;let u=r[s];if(u){let f=u.size;if(c+n<=f)a=await nc(u,c,n);else{let d=f-c;a=new Uint8Array(n);let p=await nc(u,c,d);a.set(p,0);let g=await o.readUint8Array(t+d,n-d,i);a.set(g,d),p.length+g.length<n&&(a=a.subarray(0,p.length+g.length))}}else a=new Uint8Array;return o.lastDiskNumber=Math.max(s,o.lastDiskNumber),a}},I1=class extends lS{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,a,s=new WritableStream({async write(f){let{availableSize:d}=i;if(a)f.length>=d?(await c(f.subarray(0,d)),await u(),i.diskOffset+=o.size,i.diskNumber++,a=null,await this.write(f.subarray(d))):await c(f);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(N0t);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Np(o),r=p.writable,a=r.getWriter(),await this.write(f)}},async close(){await a.ready,await u()}});Object.defineProperty(i,UJ,{get(){return s}});async function c(f){let d=f.length;d&&(await a.ready,await a.write(f),o.size+=d,i.size+=d,i.availableSize-=d)}async function u(){await a.close()}}},vb=class{constructor(t){return Array.isArray(t)&&(t=new n8(t)),t instanceof ReadableStream&&(t={readable:t}),t}},fS=class{constructor(t){return t.writable===zt&&typeof t.next==Af&&(t=new I1(t)),t instanceof WritableStream&&(t={writable:t}),t.size===zt&&(t.size=0),t instanceof I1||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:Cb,maxSize:Cb}),t}};async function Np(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function nc(e,t,n,i){return e.readUint8Array(t,n,i)}var VTe="\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(""),V0t=VTe.length==256;function jTe(e){if(V0t){let t="";for(let n=0;n<e.length;n++)t+=VTe[e[n]];return t}else return new TextDecoder().decode(e)}function D1(e,t){return t&&t.trim().toLowerCase()=="cp437"?jTe(e):new TextDecoder(t).decode(e)}var VJ="filename",jJ="rawFilename",P1="comment",GJ="rawComment",R1="uncompressedSize",HJ="compressedSize",WJ="offset",qJ="diskNumberStart",dS="lastModDate",i8="rawLastModDate",O1="lastAccessDate",GTe="rawLastAccessDate",M1="creationDate",YJ="rawCreationDate",XJ="internalFileAttributes",KJ="externalFileAttributes",QJ="msdosAttributesRaw",$J="msdosAttributes",JJ="msDosCompatible",o8="zip64",ZJ="encrypted",eZ="version",tZ="versionMadeBy",nZ="zipCrypto",B1="directory",iZ="executable",oZ="compressionMethod",rZ="signature",aZ="extraField",j0t="extraFieldInfoZip",G0t="extraFieldUnix";var sZ="unixMode",cZ="setuid",lZ="setgid",uZ="sticky",H0t="bitFlag",W0t="filenameUTF8",q0t="commentUTF8",Y0t="rawExtraField",X0t="extraFieldZip64",K0t="extraFieldUnicodePath",Q0t="extraFieldUnicodeComment",$0t="extraFieldAES",J0t="extraFieldNTFS",Z0t="extraFieldExtendedTimestamp",egt=[VJ,jJ,R1,HJ,dS,i8,P1,GJ,O1,M1,YJ,WJ,qJ,XJ,KJ,QJ,$J,JJ,o8,ZJ,eZ,tZ,nZ,B1,iZ,oZ,rZ,aZ,G0t,j0t,"uid","gid",sZ,cZ,lZ,uZ,H0t,W0t,q0t,Y0t,X0t,K0t,Q0t,$0t,J0t,Z0t],WA=class{constructor(t){egt.forEach(n=>this[n]=t[n])}};var HTe="filenameEncoding",WTe="commentEncoding",qTe="decodeText",YTe="extractPrependedData",XTe="extractAppendedData",r8="password",a8="rawPassword",s8="passThrough",c8="signal",KTe="checkPasswordOnly",QTe="checkOverlappingEntryOnly",$Te="checkOverlappingEntry",JTe="checkSignature",l8="useWebWorkers",u8="useCompressionStream",f8="transferStreams",d8="preventClose",ZTe="encryptionStrength",eCe="extendedTimestamp",tCe="keepOrder",nCe="level",iCe="bufferedWrite",oCe="createTempStream",rCe="dataDescriptorSignature",aCe="useUnicodeFileNames",sCe="dataDescriptor",cCe="supportZip64SplitFile",lCe="encodeText",fZ="offset",dZ="usdz",uCe="unixExtraFieldType";var h8="File format is not recognized",_Ce="End of central directory not found",ACe="End of Zip64 central directory locator not found",yCe="Central directory header not found",xCe="Local file header not found",bCe="Zip64 extra field not found",TCe="File contains encrypted entry",CCe="Encryption method not supported",mZ="Compression method not supported",pZ="Split zip file",ECe="Overlapping entry found",dCe="utf-8",ogt="UTF8",hCe="cp437",rgt=[[R1,4294967295],[HJ,4294967295],[WJ,4294967295],[qJ,65535]],agt={65535:{getValue:Rr,bytes:4},4294967295:{getValue:pS,bytes:8}},Sb=class{constructor(t,n={}){Object.assign(this,{reader:new vb(t),options:n,config:p1(),readRanges:[]})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Np(i),(i.size===zt||!i.readUint8Array)&&(i=new Bp(await new Response(i.readable).blob()),await Np(i)),i.size<22)throw new Error(h8);i.chunkSize=k4(o);let r=await dgt(i,101010256,i.size,22,65535*16);if(!r){let L=await nc(i,0,4),_=Or(L);throw Rr(_)==134695760?new Error(pZ):new Error(_Ce)}let a=Or(r),s=Rr(a,12),c=Rr(a,16),u=r.offset,f=ic(a,20),d=u+22+f,p=ic(a,4),g=i.lastDiskNumber||0,m=ic(a,6),A=ic(a,8),y=0,x=0;if(c==4294967295||s==4294967295||A==65535||m==65535){let L=await nc(i,r.offset-20,20),_=Or(L);if(Rr(_,0)==117853008){c=pS(_,8);let C=await nc(i,c,56,-1),v=Or(C),I=r.offset-20-56;if(Rr(v,0)!=101075792&&c!=I){let M=c;c=I,c>M&&(y=c-M),C=await nc(i,c,56,-1),v=Or(C)}if(Rr(v,0)!=101075792)throw new Error(ACe);p==65535&&(p=Rr(v,16)),m==65535&&(m=Rr(v,20)),A==65535&&(A=pS(v,32)),s==4294967295&&(s=pS(v,40)),c-=s}}if(c>=i.size&&(y=i.size-c-s-22,c=i.size-s-22),g!=p)throw new Error(pZ);if(c<0)throw new Error(h8);let b=0,T=await nc(i,c,s,m),E=Or(T);if(s){let L=r.offset-s;if(Rr(E,b)!=33639248&&c!=L){let _=c;c=L,c>_&&(y+=c-_),T=await nc(i,c,s,m),E=Or(T)}}let S=r.offset-c-(i.lastDiskOffset||0);if(s!=S&&S>=0&&(s=S,T=await nc(i,c,s,m),E=Or(T)),c<0||c>=i.size)throw new Error(h8);let w=Cc(n,t,HTe),P=Cc(n,t,WTe);for(let L=0;L<A;L++){let _=new gZ(i,o,n.options);if(Rr(E,b)!=33639248)throw new Error(yCe);vCe(_,E,b+6);let C=!!_.bitFlag.languageEncodingFlag,v=b+46,I=v+_.filenameLength,M=I+_.extraFieldLength,N=ic(E,b+4),j=N>>8==0,k=N>>8==3,V=T.subarray(v,I),F=ic(E,b+32),W=M+F,q=T.subarray(M,W),J=C,H=C,Z=Rr(E,b+38),K=Z&255,le={readOnly:!!(K&1),hidden:!!(K&2),system:!!(K&4),directory:!!(K&16),archive:!!(K&32)},me=Rr(E,b+42)+y,ae=Cc(n,t,qTe)||D1,be=J?dCe:w||hCe,ge=H?dCe:P||hCe,we=ae(V,be);we===zt&&(we=D1(V,be));let Ee=ae(q,ge);Ee===zt&&(Ee=D1(q,ge)),Object.assign(_,{versionMadeBy:N,msDosCompatible:j,compressedSize:0,uncompressedSize:0,commentLength:F,offset:me,diskNumberStart:ic(E,b+34),internalFileAttributes:ic(E,b+36),externalFileAttributes:Z,msdosAttributesRaw:K,msdosAttributes:le,rawFilename:V,filenameUTF8:J,commentUTF8:H,rawExtraField:T.subarray(I,M),rawComment:q,filename:we,comment:Ee}),x=Math.max(me,x),SCe(_,_,E,b+6);let Be=_.externalFileAttributes>>16&65535;_.unixMode===zt&&(Be&16877)!=0&&(_.unixMode=Be);let ke=!!(_.unixMode&2048),Ge=!!(_.unixMode&1024),rt=!!(_.unixMode&512),et=_.unixMode!==zt?(_.unixMode&73)!=0:k&&(Be&73)!=0,Pe=_.unixMode!==zt&&(_.unixMode&61440)==16384,Ye=(Be&61440)==16384;Object.assign(_,{setuid:ke,setgid:Ge,sticky:rt,unixExternalUpper:Be,internalFileAttribute:_.internalFileAttributes,externalFileAttribute:_.externalFileAttributes,executable:et,directory:Pe||Ye||j&&le.directory||we.endsWith("/")&&!_.uncompressedSize,zipCrypto:_.encrypted&&!_.extraFieldAES});let ut=new WA(_);ut.getData=(en,Gt)=>_.getData(en,ut,n.readRanges,Gt),ut.arrayBuffer=async en=>{let Gt=new TransformStream,[yt]=await Promise.all([new Response(Gt.readable).arrayBuffer(),_.getData(Gt,ut,n.readRanges,en)]);return yt},b=W;let{onprogress:Ct}=t;if(Ct)try{await Ct(L+1,A,new WA(_))}catch{}yield ut}let O=Cc(n,t,YTe),B=Cc(n,t,XTe);return O&&(n.prependedData=x>0?await nc(i,0,x):new Uint8Array),n.comment=f?await nc(i,u+22,f):new Uint8Array,B&&(n.appendedData=d<i.size?await nc(i,d,i.size-d):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var gZ=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i,o={}){let r=this,{reader:a,offset:s,diskNumberStart:c,extraFieldAES:u,extraFieldZip64:f,compressionMethod:d,config:p,bitFlag:g,signature:m,rawLastModDate:A,uncompressedSize:y,compressedSize:x}=r,{dataDescriptor:b}=g,T=n.localDirectory={},E=await nc(a,s,30,c),S=Or(E),w=Cc(r,o,r8),P=Cc(r,o,a8),O=Cc(r,o,s8);if(w=w&&w.length&&w,P=P&&P.length&&P,u&&u.originalCompressionMethod!=99)throw new Error(mZ);if(d!=0&&d!=8&&d!=9&&!O)throw new Error(mZ);if(Rr(S,0)!=67324752)throw new Error(xCe);vCe(T,S,4);let{extraFieldLength:B,filenameLength:L,lastAccessDate:_,creationDate:C}=T;T.rawExtraField=B?await nc(a,s+30+L,B,c):new Uint8Array,SCe(r,T,S,4,!0),Object.assign(n,{lastAccessDate:_,creationDate:C});let v=r.encrypted&&T.encrypted&&!O,I=v&&!u;if(O||(n.zipCrypto=I),v){if(!I&&u.strength===zt)throw new Error(CCe);if(!w&&!P)throw new Error(TCe)}let M=s+30+L+B,N=x,j=a.readable;Object.assign(j,{diskNumberStart:c,offset:M,size:N});let k=Cc(r,o,c8),V=Cc(r,o,KTe),F=Cc(r,o,$Te),W=Cc(r,o,QTe);W&&(F=!0);let{onstart:q,onprogress:J,onend:H}=o,Z=d==9,K=Cc(r,o,u8);Z&&(K=!1);let le={options:{codecType:Q4,password:w,rawPassword:P,zipCrypto:I,encryptionStrength:u&&u.strength,signed:Cc(r,o,JTe)&&!O,passwordVerification:I&&(b?A>>>8&255:m>>>24&255),outputSize:O?x:y,signature:m,compressed:d!=0&&!O,encrypted:r.encrypted&&!O,useWebWorkers:Cc(r,o,l8),useCompressionStream:K,transferStreams:Cc(r,o,f8),deflate64:Z,checkPasswordOnly:V},config:p,streamOptions:{signal:k,size:N,onstart:q,onprogress:J,onend:H}};F&&await fgt({reader:a,fileEntry:n,offset:s,diskNumberStart:c,signature:m,compressedSize:x,uncompressedSize:y,dataOffset:M,dataDescriptor:b||T.bitFlag.dataDescriptor,extraFieldZip64:f||T.extraFieldZip64,readRanges:i});let me;try{if(!W){V&&(t=new WritableStream),t=new fS(t),await Np(t,O?x:y),{writable:me}=t;let{outputSize:ae}=await e8({readable:j,writable:me},le);if(t.size+=ae,ae!=(O?x:y))throw new Error(sS)}}catch(ae){if(ae.outputSize!==zt&&(t.size+=ae.outputSize),!V||ae.message!=pg)throw ae}finally{!Cc(r,o,d8)&&me&&!me.locked&&await me.getWriter().close()}return V||W?zt:t.getData?t.getData():me}};function vCe(e,t,n){let i=e.rawBitFlag=ic(t,n+2),o=(i&1)==1,r=Rr(t,n+6);Object.assign(e,{encrypted:o,version:ic(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:hgt(r),filenameLength:ic(t,n+22),extraFieldLength:ic(t,n+24)})}function SCe(e,t,n,i,o){let{rawExtraField:r}=t,a=t.extraField=new Map,s=Or(new Uint8Array(r)),c=0;try{for(;c<r.length;){let b=ic(s,c),T=ic(s,c+2);a.set(b,{type:b,data:r.slice(c+4,c+4+T)}),c+=4+T}}catch{}let u=ic(n,i+4);Object.assign(t,{signature:Rr(n,i+10),compressedSize:Rr(n,i+14),uncompressedSize:Rr(n,i+18)});let f=a.get(1);f&&(sgt(f,t),t.extraFieldZip64=f);let d=a.get(28789);d&&(mCe(d,VJ,jJ,t,e),t.extraFieldUnicodePath=d);let p=a.get(25461);p&&(mCe(p,P1,GJ,t,e),t.extraFieldUnicodeComment=p);let g=a.get(39169);g?(cgt(g,t,u),t.extraFieldAES=g):t.compressionMethod=u;let m=a.get(10);m&&(lgt(m,t),t.extraFieldNTFS=m);let A=a.get(30805);if(A)pCe(A,t,!1),t.extraFieldUnix=A;else{let b=a.get(30837);b&&(pCe(b,t,!0),t.extraFieldInfoZip=b)}let y=a.get(21589);y&&(ugt(y,t,o),t.extraFieldExtendedTimestamp=y);let x=a.get(6534);x&&(t.extraFieldUSDZ=x)}function sgt(e,t){t.zip64=!0;let n=Or(e.data),i=rgt.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[a,s]=i[o];if(t[a]==s){let c=agt[s];t[a]=e[a]=c.getValue(n,r),r+=c.bytes}else if(e[a])throw new Error(bCe)}}function mCe(e,t,n,i,o){let r=Or(e.data),a=new hg;a.append(o[n]);let s=Or(new Uint8Array(4));s.setUint32(0,a.get(),!0);let c=Rr(r,1);Object.assign(e,{version:YA(r,0),[t]:D1(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==Rr(s,0)}),e.valid&&(i[t]=e[t],i[t+ogt]=!0)}function cgt(e,t,n){let i=Or(e.data),o=YA(i,4);Object.assign(e,{vendorVersion:YA(i,0),vendorId:YA(i,2),strength:o,originalCompressionMethod:n,compressionMethod:ic(i,5)}),t.compressionMethod=e.compressionMethod}function lgt(e,t){let n=Or(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=ic(n,i),a=ic(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+a)),i+=4+a}}catch{}try{if(o&&o.length==24){let r=Or(o),a=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:c});let u=hZ(a),f=hZ(s),d=hZ(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function pCe(e,t,n){try{let i=Or(new Uint8Array(e.data)),o=0,r=YA(i,o++),a=YA(i,o++),s=e.data.subarray(o,o+a);o+=a;let c=gCe(s),u=YA(i,o++),f=e.data.subarray(o,o+u);o+=u;let d=gCe(f),p=zt;if(!n&&o+2<=e.data.length){let g=e.data;p=new DataView(g.buffer,g.byteOffset+o,2).getUint16(0,!0)}Object.assign(e,{version:r,uid:c,gid:d,unixMode:p}),c!==zt&&(t.uid=c),d!==zt&&(t.gid=d),p!==zt&&(t.unixMode=p)}catch{}}function gCe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function ugt(e,t,n){let i=Or(e.data),o=YA(i,0),r=[],a=[];n?((o&1)==1&&(r.push(dS),a.push(i8)),(o&2)==2&&(r.push(O1),a.push(GTe)),(o&4)==4&&(r.push(M1),a.push(YJ))):e.data.length>=5&&(r.push(dS),a.push(i8));let s=1;r.forEach((c,u)=>{if(e.data.length>=s+4){let f=Rr(i,s);t[c]=e[c]=new Date(f*1e3);let d=a[u];e[d]=f}s+=4})}async function fgt({reader:e,fileEntry:t,offset:n,diskNumberStart:i,signature:o,compressedSize:r,uncompressedSize:a,dataOffset:s,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let d=0;if(i)for(let m=0;m<i;m++){let A=e.readers[m];d+=A.size}let p=0;if(c&&(u?p=20:p=12),p){let m=await nc(e,s+r,p+4,i);if(Rr(Or(m),0)==134695760){let y=Rr(Or(m),4),x,b;u?(x=pS(Or(m),8),b=pS(Or(m),16)):(x=Rr(Or(m),8),b=Rr(Or(m),12)),(t.encrypted&&!t.zipCrypto||y==o)&&x==r&&b==a&&(p+=4)}}let g={start:d+n,end:d+s+r+p,fileEntry:t};for(let m of f)if(m.fileEntry!=t&&g.start>=m.start&&g.start<m.end){let A=new Error(ECe);throw A.overlappingEntry=m.fileEntry,A}f.push(g)}async function dgt(e,t,n,i,o){let r=new Uint8Array(4),a=Or(r);mgt(a,0,t);let s=i+o;return await c(i)||await c(Math.min(s,n));async function c(u){let f=n-u,d=await nc(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==r[0]&&d[p+1]==r[1]&&d[p+2]==r[2]&&d[p+3]==r[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function Cc(e,t,n){return t[n]===zt?e.options[n]:t[n]}function hgt(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 hZ(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function YA(e,t){return e.getUint8(t)}function ic(e,t){return e.getUint16(t,!0)}function Rr(e,t){return e.getUint32(t,!0)}function pS(e,t){return Number(e.getBigUint64(t,!0))}function mgt(e,t,n){e.setUint32(t,n,!0)}function Or(e){return new DataView(e.buffer)}var MCe="File already exists",BCe="Zip file comment exceeds 64KB",LCe="File entry comment exceeds 64KB",NCe="File entry name exceeds 64KB",BZ="Version exceeds 65535",FCe="The strength must equal 1, 2, or 3",kCe="Extra field type exceeds 65535",zCe="Extra field data exceeds 64KB",LZ="Zip64 is not supported (set the 'zip64' option to 'true')",UCe="Undefined uncompressed size",VCe="Zip file not empty",Tgt="Invalid uid (must be integer 0..2^32-1)",Cgt="Invalid gid (must be integer 0..2^32-1)",Egt="Invalid UNIX mode (must be integer 0..65535)",vgt="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Sgt="Invalid msdosAttributesRaw (must be integer 0..255)",wgt="Invalid msdosAttributes (must be an object with boolean flags)",DCe=new Uint8Array([7,0,2,0,65,69,3,0,0]),jCe="infozip",GCe="unix",OZ=0,PCe=[],H1=class{constructor(t,n={}){t=new fS(t);let i=t.availableSize!==zt&&t.availableSize>0&&t.availableSize!==Cb&&t.maxSize!==zt&&t.maxSize>0&&t.maxSize!==Cb;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:p1(),files:new Map,filenames:new Set,offset:n[fZ]===zt?t.size||t.writable.size||0:n[fZ],pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async prependZip(t){if(this.filenames.size)throw new Error(VCe);t=new vb(t);let n=new Sb(t.readable),i=await n.getEntries();await n.close(),await t.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=t.size,this.filenames=new Set(i.map(o=>o.filename)),this.files=new Map(i.map(o=>{let{version:r,compressionMethod:a,lastModDate:s,lastAccessDate:c,creationDate:u,rawFilename:f,bitFlag:d,encrypted:p,uncompressedSize:g,compressedSize:m,diskOffset:A,diskNumber:y,zip64:x}=o,{rawExtraFieldZip64:b,rawExtraFieldAES:T,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:S,rawExtraFieldUnix:w,rawExtraField:P}=o,{level:O,languageEncodingFlag:B,dataDescriptor:L}=d;b=b||new Uint8Array,T=T||new Uint8Array,E=E||new Uint8Array,S=S||new Uint8Array,w=o.rawExtraFieldUnix||new Uint8Array,P=P||new Uint8Array;let _=Ii(b,T,E,S,w,P),C=x&&g>4294967295,v=x&&m>4294967295,{headerArray:I,headerView:M}=HCe({version:r,bitFlag:WCe(O,B,L,p,a),compressionMethod:a,uncompressedSize:g,compressedSize:m,lastModDate:s,rawFilename:f,zip64CompressedSize:v,zip64UncompressedSize:C,extraFieldLength:_});return Object.assign(o,{zip64UncompressedSize:C,zip64CompressedSize:v,zip64Offset:x&&this.offset-A>4294967295,zip64DiskNumberStart:x&&y>65535,rawExtraFieldZip64:b,rawExtraFieldAES:T,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:S,rawExtraFieldUnix:w,rawExtraField:P,extendedTimestamp:E.length>0||S.length>0,extraFieldExtendedTimestampFlag:1+(c?2:0)+(u?4:0),headerArray:I,headerView:M}),[o.filename,o]}))}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:a}=o;OZ<a.maxWorkers?OZ++:await new Promise(c=>PCe.push(c));let s;try{if(t=t.trim(),o.filenames.has(t))throw new Error(MCe);return o.filenames.add(t),s=Igt(o,t,n,i),r.add(s),await s}catch(c){throw o.filenames.delete(t),c}finally{r.delete(s);let c=PCe.shift();c?c():OZ--}}remove(t){let{filenames:n,files:i}=this;if(typeof t=="string"&&(t=i.get(t)),t&&t.filename!==zt){let{filename:o}=t;if(n.has(o)&&i.has(o))return n.delete(o),i.delete(o),!0}return!1}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:a}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await Fgt(i,t,n),pi(i,n,d8)||await a.getWriter().close(),r.getData?r.getData():a}};async function Igt(e,t,n,i){t=t.trim();let o=pi(e,i,JJ),r=pi(e,i,tZ,o?20:768),a=pi(e,i,iZ),s=pi(e,i,"uid"),c=pi(e,i,"gid"),u=pi(e,i,sZ),f=pi(e,i,uCe),d=pi(e,i,cZ),p=pi(e,i,lZ),g=pi(e,i,uZ);if(s!==zt&&(s<0||s>4294967295))throw new Error(Tgt);if(c!==zt&&(c<0||c>4294967295))throw new Error(Cgt);if(u!==zt&&(u<0||u>65535))throw new Error(Egt);if(f!==zt&&f!==jCe&&f!==GCe)throw new Error(vgt);let m=pi(e,i,QJ),A=pi(e,i,$J),y=s!==zt||c!==zt||u!==zt||f,x=m!==zt||A!==zt;if(y?(o=!1,r=r&65535|768):x&&(o=!0,r=r&255),m!==zt&&(m<0||m>255))throw new Error(Sgt);if(A&&typeof A!==lTe)throw new Error(wgt);if(r>65535)throw new Error(BZ);let b=pi(e,i,KJ,0);!i[B1]&&t.endsWith("/")&&(i[B1]=!0);let T=pi(e,i,B1);T?(t.endsWith("/")||(t+="/"),b===0&&(b=16,o||(b|=16877<<16))):!o&&b===0&&(a?b=493<<16:b=420<<16);let E;o||(E=b>>16&65535,u=u===zt?E:u&65535,d?u|=2048:d=!!(u&2048),p?u|=1024:p=!!(u&1024),g?u|=512:g=!!(u&512),T&&(u|=16384),b=(u&65535)<<16|b&255),{msdosAttributesRaw:m,msdosAttributes:A}=Mgt(m,A),x&&(b=b&4294967295|m&255);let S=pi(e,i,lCe,rS),w=S(t);if(w===zt&&(w=rS(t)),Ii(w)>65535)throw new Error(NCe);let P=i[P1]||"",O=S(P);if(O===zt&&(O=rS(P)),Ii(O)>65535)throw new Error(LCe);let B=pi(e,i,eZ,20);if(B>65535)throw new Error(BZ);let L=pi(e,i,dS,new Date),_=pi(e,i,O1),C=pi(e,i,M1),v=pi(e,i,XJ,0),I=pi(e,i,s8),M,N;I||(M=pi(e,i,r8),N=pi(e,i,a8));let j=pi(e,i,ZTe,3),k=pi(e,i,nZ),V=pi(e,i,eCe,!0),F=pi(e,i,tCe,!0),W=pi(e,i,l8),q=pi(e,i,f8,!0),J=pi(e,i,iCe),H=pi(e,i,oCe),Z=pi(e,i,rCe,!1),K=pi(e,i,c8),le=pi(e,i,aCe,!0),me=pi(e,i,oZ),ae=pi(e,i,nCe),be=pi(e,i,u8),ge=pi(e,i,sCe);J&&ge===zt&&(ge=!1),(ge===zt||k)&&(ge=!0),ae!==zt&&ae!=6&&(be=!1),!be&&e.config.CompressionStream===zt&&e.config.CompressionStreamZlib===zt&&(ae=0);let we=pi(e,i,o8);if(!k&&(M!==zt||N!==zt)&&!(j>=1&&j<=3))throw new Error(FCe);let Ee=new Uint8Array,Be=i[aZ];if(Be){let at=0,st=0;Be.forEach(Ln=>at+=4+Ii(Ln)),Ee=new Uint8Array(at),Be.forEach((Ln,Nn)=>{if(Nn>65535)throw new Error(kCe);if(Ii(Ln)>65535)throw new Error(zCe);Ar(Ee,new Uint16Array([Nn]),st),Ar(Ee,new Uint16Array([Ii(Ln)]),st+2),Ar(Ee,Ln,st+4),st+=4+Ii(Ln)})}let ke=0,Ge=0,rt=0;if(I&&(rt=i[R1],rt===zt))throw new Error(UCe);let et=we===!0;n&&(n=new vb(n),await Np(n),I?(i.uncompressedSize=rt,ke=OCe(rt)):n.size===zt?(ge=!0,(we||we===zt)&&(we=!0,rt=ke=4294967296)):(i.uncompressedSize=rt=n.size,ke=OCe(rt)));let{diskOffset:Pe,diskNumber:Ye}=e.writer,ut=et||rt>4294967295,Ct=et||ke>4294967295;if(ut||Ct){if(we===!1)throw new Error(LZ);we=!0}we=we||!1;let en=pi(e,i,ZJ);i=Object.assign({},i,{rawFilename:w,rawComment:O,version:B,versionMadeBy:r,lastModDate:L,lastAccessDate:_,creationDate:C,rawExtraField:Ee,zip64:we,zip64UncompressedSize:ut,zip64CompressedSize:Ct,password:M,rawPassword:N,level:ae,useWebWorkers:W,transferStreams:q,encryptionStrength:j,extendedTimestamp:V,zipCrypto:k,bufferedWrite:J,createTempStream:H,keepOrder:F,useUnicodeFileNames:le,dataDescriptor:ge,dataDescriptorSignature:Z,signal:K,msDosCompatible:o,internalFileAttribute:v,internalFileAttributes:v,externalFileAttribute:b,externalFileAttributes:b,useCompressionStream:be,passThrough:I,encrypted:!!(M&&Ii(M)||N&&Ii(N))||I&&en,signature:i[rZ],compressionMethod:me,uncompressedSize:rt,offset:e.offset-Pe,diskNumberStart:Ye,uid:s,gid:c,setuid:d,setgid:p,sticky:g,unixMode:u,msdosAttributesRaw:m,msdosAttributes:A,unixExternalUpper:E});let Gt=Rgt(i),yt=Bgt(i),wt=Ii(Gt.localHeaderArray,yt.dataDescriptorArray);Ge=wt+ke,e.options[dZ]&&(Ge+=Ge+64),e.pendingEntriesSize+=Ge;let xn;try{xn=await Dgt(e,t,n,{headerInfo:Gt,dataDescriptorInfo:yt,metadataSize:wt},i)}finally{e.pendingEntriesSize-=Ge}return Object.assign(xn,{name:t,comment:P,extraField:Be}),new WA(xn)}async function Dgt(e,t,n,i,o){let{files:r,writer:a}=e,{keepOrder:s,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,d=e.options[dZ],p=Array.from(r.values()).pop(),g={},m,A,y,x,b,T;r.set(t,g);try{let P;s&&(P=p&&p.lock,E()),(o.bufferedWrite||!s||e.writerLocked||e.bufferedWrites||!c)&&!d?(o.createTempStream?T=await o.createTempStream():T=new TransformStream(zt,zt,{highWaterMark:Cb}),T.size=0,m=!0,e.bufferedWrites++,await Np(a)):(T=a,await S()),await Np(T);let{writable:O,diskOffset:B}=a;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let v=new Uint8Array(4),I=Ls(v);ro(I,0,134695760),await gg(a,v),e.offset+=4}d&&Ogt(i,e.offset-B);let{localHeaderView:L,localHeaderArray:_}=f;m||(await P,await w(O));let{diskNumber:C}=a;return g.diskNumberStart=C,m||(b=!0,await gg(T,_)),g=await Pgt(n,T,g,i,e.config,o),m||(b=!1),r.set(t,g),g.filename=t,m?(await Promise.all([T.writable.getWriter().close(),P]),await S(),x=!0,g.diskNumberStart=a.diskNumber,g.offset=e.offset-a.diskOffset,Ngt(g,L,o),await w(O),await gg(a,_),await T.readable.pipeTo(O,{preventClose:!0,preventAbort:!0,signal:u}),a.size+=T.size,x=!1):g.offset=e.offset-B,e.offset+=g.size,g}catch(P){if(x||b){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}m?e.offset+=T.size:e.offset=T.size}throw r.delete(t),P}finally{m&&e.bufferedWrites--,y&&y(),A&&A()}function E(){g.lock=new Promise(P=>y=P)}async function S(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(O=>A=()=>{e.writerLocked=!1,O()}),await P}async function w(P){Ii(f.localHeaderArray)>a.availableSize&&(a.availableSize=0,await gg(P,new Uint8Array))}}async function Pgt(e,t,{diskNumberStart:n,lock:i},o,r,a){let{headerInfo:s,dataDescriptorInfo:c,metadataSize:u}=o,{headerArray:f,headerView:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:A,version:y,compressionMethod:x,rawExtraFieldZip64:b,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,extraFieldExtendedTimestampFlag:S,rawExtraFieldNTFS:w,rawExtraFieldUnix:P,rawExtraFieldAES:O}=s,{dataDescriptorArray:B}=c,{rawFilename:L,lastAccessDate:_,creationDate:C,password:v,rawPassword:I,level:M,zip64:N,zip64UncompressedSize:j,zip64CompressedSize:k,zipCrypto:V,dataDescriptor:F,directory:W,executable:q,versionMadeBy:J,rawComment:H,rawExtraField:Z,useWebWorkers:K,transferStreams:le,onstart:me,onprogress:ae,onend:be,signal:ge,encryptionStrength:we,extendedTimestamp:Ee,msDosCompatible:Be,internalFileAttributes:ke,externalFileAttributes:Ge,uid:rt,gid:et,unixMode:Pe,setuid:Ye,setgid:ut,sticky:Ct,unixExternalUpper:en,msdosAttributesRaw:Gt,msdosAttributes:yt,useCompressionStream:wt,passThrough:xn}=a,at={lock:i,versionMadeBy:J,zip64:N,directory:!!W,executable:!!q,filenameUTF8:!0,rawFilename:L,commentUTF8:!0,rawComment:H,rawExtraFieldZip64:b,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:w,rawExtraFieldUnix:P,rawExtraFieldAES:O,rawExtraField:Z,extendedTimestamp:Ee,msDosCompatible:Be,internalFileAttributes:ke,externalFileAttributes:Ge,diskNumberStart:n,uid:rt,gid:et,unixMode:Pe,setuid:Ye,setgid:ut,sticky:Ct,unixExternalUpper:en,msdosAttributesRaw:Gt,msdosAttributes:yt},{signature:st,uncompressedSize:Ln}=a,Nn=0;xn||(Ln=0);let{writable:so}=t;if(e){e.chunkSize=k4(r);let jo=e.readable,to=e.size,no={options:{codecType:K4,level:M,rawPassword:I,password:v,encryptionStrength:we,zipCrypto:m&&V,passwordVerification:m&&V&&g>>8&255,signed:!xn,compressed:A&&!xn,encrypted:m&&!xn,useWebWorkers:K,useCompressionStream:wt,transferStreams:le},config:r,streamOptions:{signal:ge,size:to,onstart:me,onprogress:ae,onend:be}};try{let jn=await e8({readable:jo,writable:so},no);Nn=jn.outputSize,t.size+=Nn,xn||(Ln=jn.inputSize,st=jn.signature)}catch(jn){throw jn.outputSize!==zt&&(t.size+=jn.outputSize),jn}}return Lgt({signature:st,compressedSize:Nn,uncompressedSize:Ln,headerInfo:s,dataDescriptorInfo:c},a),F&&await gg(t,B),Object.assign(at,{uncompressedSize:Ln,compressedSize:Nn,lastModDate:p,rawLastModDate:g,creationDate:C,lastAccessDate:_,encrypted:m,zipCrypto:V,size:u+Nn,compressionMethod:x,version:y,headerArray:f,headerView:d,signature:st,extraFieldExtendedTimestampFlag:S,zip64UncompressedSize:j,zip64CompressedSize:k}),at}function Rgt(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:a,zipCrypto:s,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:d,encryptionStrength:p,extendedTimestamp:g,passThrough:m,encrypted:A,zip64UncompressedSize:y,zip64CompressedSize:x,uncompressedSize:b}=e,{version:T,compressionMethod:E}=e,S=!f&&(r>0||r===zt&&E!==0),w,P=m||!S,O=a&&(e.bufferedWrite||!y&&!x||P);if(a){let q=4;y&&(q+=8),x&&(q+=8),w=new Uint8Array(q);let J=Ls(w);if(Ui(J,0,1),Ui(J,2,Ii(w)-4),O){let H=Ls(w),Z=4;y&&(oc(H,Z,BigInt(b)),Z+=8),x&&P&&(oc(H,Z,BigInt(b)),Z+=8),Z==4&&(w=new Uint8Array)}}else w=new Uint8Array;let B;if(A&&!s){B=new Uint8Array(Ii(DCe)+2);let q=Ls(B);Ui(q,0,39169),Ar(B,DCe,2),gS(q,8,p)}else B=new Uint8Array;let L,_,C;if(g){_=new Uint8Array(9+(i?4:0)+(o?4:0));let q=Ls(_);Ui(q,0,21589),Ui(q,2,Ii(_)-4),C=1+(i?2:0)+(o?4:0),gS(q,4,C);let J=5;ro(q,J,Math.floor(n.getTime()/1e3)),J+=4,i&&(ro(q,J,Math.floor(i.getTime()/1e3)),J+=4),o&&ro(q,J,Math.floor(o.getTime()/1e3));try{L=new Uint8Array(36);let H=Ls(L),Z=MZ(n);Ui(H,0,10),Ui(H,2,32),Ui(H,8,1),Ui(H,10,24),oc(H,12,Z),oc(H,20,MZ(i)||Z),oc(H,28,MZ(o)||Z)}catch{L=new Uint8Array}}else L=_=new Uint8Array;let v;try{let{uid:q,gid:J,unixMode:H,setuid:Z,setgid:K,sticky:le,unixExtraFieldType:me}=e;if(me&&(q!==zt||J!==zt||H!==zt)){let ae=RCe(q),be=RCe(J),ge=new Uint8Array;if(me==GCe&&H!==zt){let ke=H&65535;Z&&(ke|=2048),K&&(ke|=1024),le&&(ke|=512),ge=new Uint8Array(2),new DataView(ge.buffer).setUint16(0,ke,!0)}let we=3+ae.length+be.length+ge.length;v=new Uint8Array(4+we);let Ee=Ls(v);Ui(Ee,0,me==jCe?30837:30805),Ui(Ee,2,we),gS(Ee,4,1),gS(Ee,5,ae.length);let Be=6;Ar(v,ae,Be),Be+=ae.length,gS(Ee,Be,be.length),Be++,Ar(v,be,Be),Be+=be.length,Ar(v,ge,Be)}else v=new Uint8Array}catch{v=new Uint8Array}E===zt&&(E=S?8:0),a&&(T=T>45?T:45),A&&!s&&(T=T>51?T:51,B[9]=E,E=99);let I=O?Ii(w):0,M=I+Ii(B,_,L,v,d),{headerArray:N,headerView:j,rawLastModDate:k}=HCe({version:T,bitFlag:WCe(r,c,u,A,E),compressionMethod:E,uncompressedSize:b,lastModDate:n<wJ?wJ:n>SJ?SJ:n,rawFilename:t,zip64CompressedSize:x,zip64UncompressedSize:y,extraFieldLength:M}),V=30,F=new Uint8Array(V+Ii(t)+M),W=Ls(F);return ro(W,0,67324752),Ar(F,N,4),Ar(F,t,V),V+=Ii(t),O&&Ar(F,w,V),V+=I,Ar(F,B,V),V+=Ii(B),Ar(F,_,V),V+=Ii(_),Ar(F,L,V),V+=Ii(L),Ar(F,v,V),V+=Ii(v),Ar(F,d,V),u&&(ro(W,18,0),ro(W,22,0)),{localHeaderArray:F,localHeaderView:W,headerArray:N,headerView:j,lastModDate:n,rawLastModDate:k,encrypted:A,compressed:S,version:T,compressionMethod:E,extraFieldExtendedTimestampFlag:C,rawExtraFieldZip64:new Uint8Array,localExtraFieldZip64Length:I,rawExtraFieldExtendedTimestamp:_,rawExtraFieldNTFS:L,rawExtraFieldUnix:v,rawExtraFieldAES:B,extraFieldLength:M}}function Ogt(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ls(i),a=64-(t+Ii(i))%64;a<4&&(a+=64);let s=new Uint8Array(a),c=Ls(s);Ui(c,0,6534),Ui(c,2,a-2);let u=i;n.localHeaderArray=i=new Uint8Array(Ii(u)+a),Ar(i,u),Ar(i,s,Ii(u)),r=Ls(i),Ui(r,28,o+a),e.metadataSize+=a}function RCe(e){if(e===zt)return new Uint8Array;{let t=new Uint8Array(4);Ls(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}}function Mgt(e,t){if(e!==zt)e=e&255;else if(t!==zt){let{readOnly:n,hidden:i,system:o,directory:r,archive:a}=t,s=0;n&&(s|=1),i&&(s|=2),o&&(s|=4),r&&(s|=16),a&&(s|=32),e=s&255}return t===zt&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function Bgt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=new Uint8Array,o,r=0,a=e?20:12;return n&&(a+=4),t&&(i=new Uint8Array(a),o=Ls(i),n&&(r=4,ro(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function Lgt({signature:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:o},{zip64:r,zipCrypto:a,dataDescriptor:s}){let{headerView:c,encrypted:u}=i,{dataDescriptorView:f,dataDescriptorOffset:d}=o;(!u||a)&&e!==zt&&(ro(c,10,e),s&&ro(f,d,e)),r?s&&(oc(f,d+4,BigInt(t)),oc(f,d+12,BigInt(n))):(ro(c,14,t),ro(c,18,n),s&&(ro(f,d+4,t),ro(f,d+8,n)))}function Ngt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,signature:o,compressedSize:r,uncompressedSize:a,zip64UncompressedSize:s,zip64CompressedSize:c},u,{dataDescriptor:f}){if(f||(t||ro(u,14,o),c||ro(u,18,r),s||ro(u,22,a)),n&&i){let d=30+Ii(e)+4;s&&(oc(u,d,BigInt(a)),d+=8),c&&(oc(u,d,BigInt(r)),d+=8)}}async function Fgt(e,t,n){let{files:i,writer:o}=e,{diskOffset:r}=o,{diskNumber:a}=o,s=0,c=0,u=e.offset-r,f=i.size;for(let[,E]of i){let{rawFilename:S,rawExtraFieldAES:w,rawComment:P,rawExtraFieldNTFS:O,rawExtraFieldUnix:B,rawExtraField:L,extendedTimestamp:_,extraFieldExtendedTimestampFlag:C,lastModDate:v,zip64UncompressedSize:I,zip64CompressedSize:M,uncompressedSize:N,compressedSize:j}=E,k=E.offset>4294967295,V=E.diskNumberStart>65535,F;if(k||V||I||M){let q=4;I&&(q+=8),M&&(q+=8),k&&(q+=8),V&&(q+=4),F=new Uint8Array(q);let J=Ls(F);Ui(J,0,1),Ui(J,2,q-4);let H=4;I&&(oc(J,H,BigInt(N)),H+=8),M&&(oc(J,H,BigInt(j)),H+=8),k&&(oc(J,H,BigInt(E.offset)),H+=8),V&&ro(J,H,E.diskNumberStart)}else F=new Uint8Array;E.rawExtraFieldZip64=F,E.zip64Offset=k,E.zip64DiskNumberStart=V;let W;if(_){W=new Uint8Array(9);let q=Ls(W);Ui(q,0,21589),Ui(q,2,5),gS(q,4,C),ro(q,5,Math.floor(v.getTime()/1e3))}else W=new Uint8Array;E.rawExtraFieldExtendedTimestamp=W,c+=46+Ii(S,P,F,w,O,B,W,L)}let d=new Uint8Array(c),p=Ls(d);await Np(o);let g=0;for(let[E,S]of Array.from(i.values()).entries()){let{offset:w,rawFilename:P,rawExtraFieldZip64:O,rawExtraFieldAES:B,rawExtraFieldExtendedTimestamp:L,rawExtraFieldNTFS:_,rawExtraFieldUnix:C,rawExtraField:v,rawComment:I,versionMadeBy:M,headerArray:N,headerView:j,zip64UncompressedSize:k,zip64CompressedSize:V,zip64DiskNumberStart:F,zip64Offset:W,internalFileAttributes:q,externalFileAttributes:J,diskNumberStart:H,uncompressedSize:Z,compressedSize:K}=S,le=Ii(O,B,L,_,C,v);ro(p,s,33639248),Ui(p,s+4,M),k||ro(j,18,Z),V||ro(j,14,K),Ar(d,N,s+6);let me=s+30;if(Ui(p,me,le),me+=2,Ui(p,me,Ii(I)),me+=2,Ui(p,me,F?65535:H),me+=2,Ui(p,me,q),me+=2,J&&ro(p,me,J),me+=4,ro(p,me,W?4294967295:w),me+=4,Ar(d,P,me),me+=Ii(P),Ar(d,O,me),me+=Ii(O),Ar(d,B,me),me+=Ii(B),Ar(d,L,me),me+=Ii(L),Ar(d,_,me),me+=Ii(_),Ar(d,C,me),me+=Ii(C),Ar(d,v,me),me+=Ii(v),Ar(d,I,me),me+=Ii(I),s-g>o.availableSize&&(o.availableSize=0,await gg(o,d.slice(g,s)),g=s),s=me,n.onprogress)try{await n.onprogress(E+1,i.size,new WA(S))}catch{}}await gg(o,g?d.slice(g):d);let m=o.diskNumber,{availableSize:A}=o;A<22&&m++;let y=pi(e,n,o8);if(u>4294967295||c>4294967295||f>65535||m>65535){if(y===!1)throw new Error(LZ);y=!0}let x=new Uint8Array(y?98:22),b=Ls(x);s=0,y&&(ro(b,0,101075792),oc(b,4,BigInt(44)),Ui(b,12,45),Ui(b,14,45),ro(b,16,m),ro(b,20,a),oc(b,24,BigInt(f)),oc(b,32,BigInt(f)),oc(b,40,BigInt(c)),oc(b,48,BigInt(u)),ro(b,56,117853008),oc(b,64,BigInt(u)+BigInt(c)),ro(b,72,m+1),pi(e,n,cCe,!0)&&(m=65535,a=65535),f=65535,u=4294967295,c=4294967295,s+=76),ro(b,s,101010256),Ui(b,s+4,m),Ui(b,s+6,a),Ui(b,s+8,f),Ui(b,s+10,f),ro(b,s+12,c),ro(b,s+16,u);let T=Ii(t);if(T)if(T<=65535)Ui(b,s+20,T);else throw new Error(BCe);await gg(o,x),T&&await gg(o,t)}async function gg(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=Ii(t),await i.write(t)}finally{i.releaseLock()}}function MZ(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function pi(e,t,n,i){let o=t[n]===zt?e.options[n]:t[n];return o===zt?i:o}function OCe(e){return e+5*(Math.floor(e/16383)+1)}function gS(e,t,n){e.setUint8(t,n)}function Ui(e,t,n){e.setUint16(t,n,!0)}function ro(e,t,n){e.setUint32(t,n,!0)}function oc(e,t,n){e.setBigUint64(t,n,!0)}function Ar(e,t,n){e.set(t,n)}function Ls(e){return new DataView(e.buffer)}function Ii(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function HCe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawFilename:a,zip64CompressedSize:s,zip64UncompressedSize:c,extraFieldLength:u}){let f=new Uint8Array(26),d=Ls(f);Ui(d,0,e),Ui(d,2,t),Ui(d,4,n);let p=new Uint32Array(1),g=Ls(p);Ui(g,0,(r.getHours()<<6|r.getMinutes())<<5|r.getSeconds()/2),Ui(g,2,(r.getFullYear()-1980<<4|r.getMonth()+1)<<5|r.getDate());let m=p[0];return ro(d,6,m),(s||o!==zt)&&ro(d,14,s?4294967295:o),(c||i!==zt)&&ro(d,18,c?4294967295:i),Ui(d,22,Ii(a)),Ui(d,24,u),{headerArray:f,headerView:d,rawLastModDate:m}}function WCe(e,t,n,i,o){let r=0;return t&&(r=r|2048),n&&(r=r|8),(o==8||o==9)&&(e>=0&&e<=3&&(r=r|6),e>3&&e<=5&&(r=r|4),e==9&&(r=r|2)),i&&(r=r|1),r}try{Rp({baseURI:import.meta.url})}catch{}var yf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function qCe(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(n=>{n=(a=>{let s=(a=(a+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,c=[];for(let u=0;s>u;u+=4){let f=yf.indexOf(a[u])<<18|yf.indexOf(a[u+1])<<12|(63&yf.indexOf(a[u+2]))<<6|63&yf.indexOf(a[u+3]);c.push(f>>16&255),a[u+2]!=="="&&c.push(f>>8&255),a[u+3]!=="="&&c.push(255&f)}return new Uint8Array(c)})(n);let i=new Uint8Array(1024),o=0;for(let a=0;a<n.length;){let s=n[a++];if(128&s){let c=3+(127&s),u=n[a++]<<8|n[a++],f=o-u;r(o+c);for(let d=0;c>d;d++)i[o++]=i[f+d]}else{let c=s;r(o+c);for(let u=0;c>u&&a<n.length;u++)i[o++]=n[a++]}}return(a=>{let s="",c=a.length,u=0;for(;c>u+2;u+=3){let d=a[u]<<16|a[u+1]<<8|a[u+2];s+=yf[d>>18&63]+yf[d>>12&63]+yf[d>>6&63]+yf[63&d]}let f=c-u;if(f===1){let d=a[u]<<16;s+=yf[d>>18&63]+yf[d>>12&63]+"=="}else if(f===2){let d=a[u]<<16|a[u+1]<<8;s+=yf[d>>18&63]+yf[d>>12&63]+yf[d>>6&63]+"="}return s})(new Uint8Array(i.buffer.slice(0,o)));function r(a){if(i.length<a){let s=2*i.length;for(;a>s;)s*=2;let c=new Uint8Array(s);c.set(i.subarray(0,o)),i=c}}})("FQBhc20BAAAAAUULYAF/AX9gAn9/AIEABYAACwIDf4IABwEBgAARAQaAAAuDAA6BABUDAGAAgAADgAANAQSBABUDAGAHgwAegAAfEgNCQQcABAEABAgIAAIABQIKAIAAB4EAAwEFgQAHAgICgQAHEAEDAAUGAAMDBQQJBAQJAQaAAAEeAAIEAwIEAgIBBAcDAwQFAXABDQ0FBgEBggKCAgYIgACYIkHQ1QQLB4oEHAZtZW1vcnkCAAxpbmZsYXRlOV9uZXcABw2GAA8HaW5pdAAIEYoAEAdfcmF3AAoQhgAUCXByb2Nlc3MAC4cARgZlbmQADhaGAA8QbGFzdF9jb25zdW1lZAARC4QAGYMAbYUANoMAbAEShQBYhwBrARSFAH+DABMHZ3ppcAAVD4UAFIUAfgEWhgBWgQB9AhgVhQAOjQB8AmRliQB8hQAOggB8AhoQiQAPggB8AhsRigATggB8AhwPhQAUhQB8AR2GAFaBAHwJHwRmcmVlAAIVhQAVjACDCgZtYWxsb2MAAQuCAFUKaWFsaXplAAAZX4AADxZkaXJlY3RfZnVuY3Rpb25fdGFibGUBgAAcG2Vtc2NyaXB0ZW5fc3RhY2tfcmVzdG9yZQAFHI4AGwJnZYAAbw51cnJlbnQABiJfX2N4YYAAWwRjcmVtgAASBl9leGNlcIIAXQZyZWZjb3WAACUtPQkSAQBBAQsMACEiDA8XGR4+NTg7CqHlAkECAAu/JwELfyMAQRBrIgokAAJAjwACEiAAQfQBTQRAQaQnKAIAIgNBEIAAEgYLakH4A3GBAAkQSRsiBkEDdiIAdiIBQQNxBIEAMgYBQX9zQQGAAB8GaiICQQN0gAAZDMwnaiIAIAEoAtQnIoAABgQIIgVGggBSCSADQX4gAndxNoACphEBCyAFIAA2AgwgACAFNgIIC4AASAMIaiGAADcBIIIARoAABQRyNgIEgQAPA2oiAYEATQMEQQGBABIHDAsLIAZBrIIAnwMITQ2AABuBAIYEQQIgAIEANQUAIAJrcoAANQQAdHFogQCjA3QiAIIAj4AAH4IAj4AABosAjwUBd3EiA4YAkQECgQCRAQKEAJEBAIAAaIMAhYAACgJqIoAAjIIA3wUgBmsiBYMAjIAAGQIBaoEALgoAIAgEQCAIQXhxgQBuBCEBQbiBAKAEIQICf4AAZQEBgAAZBwN2dCIHcUWEAHgCIAeAAD6AADyBAHWBASEDCyEDgQDpgAB2gAAchACEAQGDAAeAAJyBAIuCARyAAFYCIASAADmAAP6CAHWAAQsCQaiCAQkCC0WAAQkFC2hBAnSAAOYDKSICgQEuAnhxgACqByEEIAIhAQOCAagFKAIQIgCAAIOBAAoBFIAACgENgAB+gAEQhAAqgADZgQFuBQRJIgEbgAA2gAFJASCAAAmAATgBIYEApwILIIAAVAMYIQmAABaAAAkEDCIAR4AASIAACgEIgAA3hAHGgACxAwgMCoIAKQUUIgEEf4AByAIUaoABU4EAdwMBRQ2AANkOQRBqCyEFA0AgBSEHIAGAAZoDFGohgAIFggAwAg0AgADlARCEABCAADEGDQALIAdBgABbCAAMCQtBfyEGgAAfA79/S4IAJwELgAISgAC1AiEGhAD+CAdFDQBBHyEIgAH+ggDygALEA///B4ACxoABwQEmgQJYBnZnIgBrdoICpQpBAXRrQT5qIQgLhALxAQiFATUBAYEBngIAIYECCoEAB4AAPAEZgAAdAwF2a4AAVwgIQR9HG3QhAoUBSYUBNAQDIARPgACTAQGAALcDAyIEgACGAQCAAH8BAYAARAEDgQI/ggFoAQOAAdOBAtQGHXZBBHFqggDcAkYbgAAdAgMbgABkAQKAAI+AAWSBAO6BADECBXKDAIQBBYACzwEIgQK7gADugALPAgdxgQGuAwMgAIUB4QEhgAEdggHAgAFMiAHCAQKAAb4BIYAAbIEByYMBxAEFgQAJhQFTgAGTAQGDAW8DCyIAggByAQWAATkCIASDA02AAEGBAMsBBYEB5wEIgAA5gAAJhAHngAAKjQHngAKTgAAWgwHnAQWCAeeAAA+EAecBBYIB54ABK4ACeoAA+4MB54IDgIgB54IAEIQB5wEDgwHnAQeHA9gBBYEEgoMDQ4AEpoAAjYECnwNBEE+AAI2CA4uAATKGA4ECBWqBAJOAAFeFA66BA1WAABeGA7sBBYsEQIABX4AEJwEhgAHlgANGgQA6gQNWgAN0gQCZgQNlgAJvgABKAbCCAIgCAkmAAIgBsIAAH4IAgYEALAK8J4AAA4EAG4MAiIEAN4kAjYYEMYUAS4QCSgEvgAQ/BQJ/QfwqgAA7gABTAoQrgAAIgQJoBYgrQn83gABXBoArQoCggIAAAQEEgQAOEfwqIApBDGpBcHFB2KrVqgVzgQB6ApArggEnA0HgKoMACAaAIAsiAWqABaKAAZMBa4AEXIEEmQVNDQhB3IEAZAIiBYAAZgHUggAKAQiABKMFIgkgCE2AAUcFCUlyDQmAAvmAAEUDLQAAgAKQgAJvhQX6hADYgQA5BOQqIQCDAlqBAD+BAY2AADwBCIICagNqSQ2BAtuBAhKCAkMEQQAQBIAFdwJ/RoAB+QMBIQOAAMmCAR0BQYAAk4AD+4AGIYEC/AFrgQVTAWqCAs0DcWohgABAAQOBAKsBA4QAq4EBEYMAq4ADRQNqIgeAAHGAAUoBB4AAqwEEgAAqgABfgAFjBUcNAQwFgQA4gABMgADrgQAWggJCgABTgQCVAUaABP4BAoIDFYEAioABCQVBMGogA4EAuIAB7QMMBAuDAXGBAyADIANrgQCJBwJrcSICEASDAC6ABWWAAJaCACuAAJyAAM0ERw0CC4EBaAHggQCWAkEEgQWsgAWohADpggDygQBoAXKBBSQDTXINgANTgABQgAPoCAZBKGpNDQULgADOgwDRgQDPggGsAdiCAA4BAIECTgLYKoEDSQEAgQGFgwFxAQSHAXGDANOBA2uAANUCIgWAANeCABKDAWuBAMcBtIMCe4EBSoAAewEbgQQtAbSDAr2CAmkDQegqgQYwAQCAAFCCABUFQcQnQX+BAAgCyCeDAnuBAAwB8IMCQIEB4IMGz4MHsIAGUAHUgAMQgQZYAtgngQUngAC7A0EgR4AAeYEDAQQDQShrgAAQAXiAAOkBQYECa4AB3oMDDoQHoIIGzoADdIUDCAQCakEogQNsBMAnQYyBAXuBA+CAAc6AAYEBTYEGZAJLcoMA2gQMQQhxgQAKgAHZAgVqgQAwgABRgATNAiAEggBmgAhRggN0ArAngwOPgQFPgAAtgACJgwBvgAClggBvgABWkABvAQOCARMCDAaDAAeFAT0DIAJLiAE1gwH7AQWCAYACAkCBBpmEAYKBBPeEAXoDAQwCgQWcAi0AgQCtgATgAQuEAa6BCSyDAa4BBIECaYEHPIICjAMiBUmEB1kBCIIGTJQBQAEHkAFAAQeZAUCAAGICBUGAB/iBAEEDakEvgABPgAAoAQSABUyACZQDAUEbggksCUHsKikCADcCEIAACwHkgwALAQiAABSCCVuBAHCNAiCEAgyAACABGIAEr4ICE4AAmIMEv4AABQEEgQmQgADPgQL+AyAERoEG6YMFSQF+gAnDAQSDCC+ABnaEALaCCMEBAIAI8gMCQf+BCkOAAAiECQ+AABWEClCABSqBCd+ACQ0BAoUJDYAAEYIJDYIJgoEBNgELgAbDgADagQkNgABggAZ1AkEMgAWyAQiBBS8BH4IHMwH/hAfdAQKAB92AABmQB92AALGAAMUGNgIcIARCggEPAQCABzkDQdQpgAmaggTrgwg3gAKvgQo1AQOCAIoBqIEJlwEFgwmXggllgQCPAQKACAOAAFWCCAOACGKBCAOCB9aAB6KBAi2BCt2CB3wBAoIDqoAH44EHbIEH04MDDoAH8AIiA4EG5wEFggbngQBXARCBAJqAAe8DGEEIgAcEAgQigAgsAkEMhQoHgAHTgQDwgwCBAQiDAMOACNWAACMBGIABAgEMgAA7hAbsgQLygwRHhAapgAZkAU2ACH6AAmqBB8ixBquAAyEEoCdBMIEAOYEDMIIIwIMHFoIC14ADKIIDa4UCwwFqgAYZhQBCgAmMgAaDggAVgAUFAiAIgAbsA2shB4UE4QIgA4ELboED2YoDzAEHgwUbgQDlhAvYgAHgggfzgwAxhwrrhAifjgAxgQIlgwEGgQFAgAFogQWXBANxQQGAAD+AACSACiABCYEAFoACPYIM14MClIAAEYEIzAECgwwCgwKWgAwGgAA5AXaDDJgBAoEC7IcLg4ECd4EANQMYIQaAAEaABC+BBBqCAEWCAR+BACaBAaWAACaAAB+AABiAC1iACRMBA4IJE4IB+4EJp4AAEIEJE4ALh4IKKoAGiYEJE4IEMIAAMIADV4ELGoEJuYIAMYECLAEFgwkTggqKgACSAQaACaiDAGABHIAA5AECgAW2gQoGggEpgAF+gALYgwGrAwINAYACyIMC3oEA1YUA0oEAOwIgBoAAXYEAMAEGgQAsARCBANeCAAoBFIAC5oIMCoAI5IACl4QAtYEDXoEA2YADOoEAJQEYggEEggw0gQJFgAAZARSGABkEByAJaoALzwEDgAAHgQLtAQSBA32AB02GBCSFBNWAAAoCaiCBBPaAABKDAYwBB5MEIAEHrQQggwMpgQAHhAGxgAQoAQKBAGaEBCgBB4AEKAEHkgQogAFbgALUiAQogA8mgwQogg8dhAQoggS1A3QiBYUEKIAD24MAkoYEKAEHgAQogAUHggQoAQKEDCuCBh6DAfSBDnaCBCgBB4EEKIEMC4EB7YML+4EFfYEEKIMLQIIB/IYEKIAA1gEYgAAHhADkgQDyhQEEgQZ2gwuPgwQqgQIvgQAriAEIAQuADLWCA9qCAgABCIMCQoAAZgEcgADQgADOgAJsgAJCgQ8KgACKgQJCggNdgAbvgQDiAQeEDxmBAa+DAECACgCEAkCACgiEAkCCAAqAAkCEDkoCIAiBAISDAMiCC6mAAIaABomCAMaFDC+BAkCCABkBFIUAGYAAXAMEQQ+DCmMBBIEEqYADi4cLuYMEfYYEIYEMCoQAH4AACoEEb4QAHIEFXQFqggGPgAASgwJegQFxkAJeAQSiAl6BD3aAAByAAAcBDIECzYMAB4cCXoIAZoQCXgEEgAJeAQSVBoaCADwDHCADkQaGgQMaghC1hQJYgAK0hAaAgQelgwBxARiBAJgBBJYGh4MCX4UP74AHo4QGh4IJHYEAJoEF8oECXwEHhw9VgQBeARCDEGiBA9iFAOWBAPOCBvSDBN2CABaDEH+DDaGABBuDBPKCANSBDgGDAl+CBPoBCYMCX4AAPIQCX4AB74ACX4EFZ4AAKI0CXwELgwJfhgJdAwIgCYQCXQEJhgJdggAKiAJdAQmBAIKDEEyPAl2DEHOZAl2BC/uKAl2ACXaNAl2ABQKEAB+AAAqAA5KGAl2AAm6EAl2KEeaBDjqCAYWAAmGGEeQBIIMIT4gR5ogCW4ABO4ICRoMB3IEH6YICW4IB8QEIgQb/ghHXgQ6ZgQBugQiAgQFjAQuADg4DEGokgABKBgveCwEIf4EGz4IA7AJBCIEMd4AJqAFrgwLeAXiBCzQCIQWCE5QCAXGBCa8BQYACXYEGgIEFv4AAIoAAL4MLB4AKo4ISvIME6IAE6oQHeoQG3oAHNIAAPIQJxoMG7wEEgA0ViQcygBMMhAcygQ2YggchigcfiwdFgQ3KhRAwiAcdghAwgwcdAQSAAsoBBIISF4IHHYABhIUQMIIHHYIAEIsSF4AIo4ACZoAJQ4EH9QIDR4AOUIABOIICZ4AQ9oQGf4EBHoMBxIIUbQIAD4QF8YEAmYIFUIAN6Y4HYoICwQEEhwdiAQSWB2KJAsWrB2KBAsWCARyBAsWIB2KCAsWCABmBAsWFA6MBBYQRmoEA7QEBgAHShhW7gwHigglggQHAghTZgAlrggvlhglrgA1IggEXhwENAQODAfACRw2BEXGDEE8BuIMACAEPhAmFgQ/4hAmHggBNhgmHjwBNgQ2YhQFdgQKEgAAjgQw3iwJGghJEgAF7jAl4igJGiwGagAIzghKMgQJXAQWIEoeJAleDAgOREoeAADS0AleAAg2RAkCGAOaDDlmHAjOHB1ODAjOCB1OjAjOABsSjAjOGB1WMAjOHB1WOAjOOALiAABQBCIAPz4UDJYABrYULFIELLIMWt4YHKoAE+oILFIAUhIUEz4AG9I0WtYQGq4AICIUGRYIE1oMGIYACSoEJh4AAZYQHKQEAgAcpgASzgAcpAQGDBymAAsyGCYeCBlyGBymGCYeAEzWAAucBf4sJiYMXSIIJiYMFYoABqIECpIENJYMJIpEJj4ABnoAVnYECD4YNtwEAhgmPgQzagxWKgAG7hgcwgBXRhQcwgQBdgAu9gAfpgQD3AgMihgEGgALVggD8gwEKgAAngADjgRRhAQuAAnWBEF6DBjiEARqCAY2CD/qAEZoBxIICEoAFlIASTQIgAIAPwYATTwSMCwEHgAANgQWagAXHgxBjgRJ3ggXOgAEWggXOghB3gACOhAhIgQAmgRKBhAaPhBC7AQyABm2FD4mAAZGRBcOBD4mGA32AACKBA2yEBgSCADCCB/6BAc+BGJmBA5CCDLABBIADbIEV04QWVgEEghaZiBXzAQeAAWGBBeOAATCCBNKAAUWCBeODABCFAVWLBcOAAIqHBcOCDuKAFD2EA4OBBsaFBcOBABuCBcOEAJmHBcOAAEqEA5CAAJYBHIAAUYYDkAEAhwOQgwlXiwOQhBqPggOQgA8VhgOQgQH1gwOQgAAKgAOQAQOCA5CABeWBA5CCAPoBAoIBWoEDuIMJKIADd4IBIYADuoEB8YEDx4UAGYYFr4QA7pEFtIIFhoYFtIATf4QW1oYPsqkFtIIAH4YFtJAATYEauIQBToERp4ICTYMFtIcCN4QFtIIPj5UCN4sBi4cFtIAGtIYFtIsCSIUFtIECSIgFtIACSIUFtK8CSIIFtI8CMYYA5oMFtIcCJIIFtIgCJIgFtJ0CJIkFtJoCJIIA1pACJIIA/ZACJJEAuIENVYQFtIQBrYUHUIEHaYIFtIAcY4YdrIEVzIEFtIAII4UM3oEK0IAEHoUL2YEM3oMQsoUKfIQQx4MKmIIFtIAErIYFtAEBhhtAAQKDBbSBBSeCBbSCEiGAALkDHCAAgwW0AQOFBbSAEW+GDzuBBkiAFmWGBbKAEAWDAJGEDBCCBq+CBUuABbOAAMGCBbMBA4MFs4ABH4EFs4ICDoEBqIIFswEBgQWzAQOBBbOBAAeABbOAAnqAAJWGBbMBAoMFs4QQu4AClYIBWYQA6oMGl4EGCoYa0IMTZIADXYIM4oQTgIMBDQMLC0mBBxEBkIMGe4EVGwFqgQtiAQKCCzWAAHSCA1CCF4UDIAA/gAUCAXSAHo2HE0UBf4ABTAGQhAqQAwELBoAALQYkAAsEACOAE7MCAQGABtUEQcQAEIAQGYMLyAIEa4EZj4AMOoIADoAGHgMA/AuBGM6CBWuAASMBJIEHjQU2AiAgAIASGQMLCxGAACaBAVEBfoIHxQsQEAkL2QIBA39BeoAHMARAQZQIgQBNATGBAjgBfoEcBYQAVYQEuAEggwJ8gAAKASSEAAgKKEEBQdg3IAIRA4AGVoEAVwF8gQBXgweQgADmAzYCOIUBrwQCQb/+gAAJgABlBCAAECODFg8GQR91IgNzgBlXgQKAgBQFgBYugwLSASiDDnwCdkGCGfoEAUEAToAeWYEfa4ABYIIAPYIAXAM0IAKBAj8BLIkAFIAA54EAB4ABloEAG4AI1YIN8YAAX4ADhgEwgALIgQAWATyDACsBJIAAB4AbNYIOHAFCgRtAAXCCCD8BQoAAqAE3gQ3IAkKBgwAUAcyAAOCAACsCtAqCCr4BcIMA0QFUgwAHAlBBggkNgAEJgxmBAyQRAYQBMQEcgAIsjAFtAXCAAW0BEoIB+oEA5oIXlAgEEA0L/SQBIoQhWQIUJIEBeAEZhgEkgQeMAiIShAFsAwQhE4QbV4ECNwETgARnAwAhE4IAfYEEkAHcgAs6AR+AAKcF9AVqIRWAAAgB2IAAEAEbgAAIAfCAAAgBGoMAvwIhFoEAIIAAEAMRQZyBGBkEIRxBmIIACAQdQZQrgAH4AiEegQM2A0AhCoEABwE8gQr5AUGAGDIIAkkhIEF9IQ2AAA4GBkchISATgQIYgQMvAxchEIEY+JEiCpIAAoEJjpEiNoEQgoAiGoABdxdrDhMEBQYHCAkDAgwNARkAGw8iIhQhIoIEfwVMIQYMGYYACoAW0IAACgFsgR5MgQAIASKAC9YDKAJggh8wAwxJG4AAIQQGCyAggR/agABWgAZSBA4hDQyAAZGBBMYCDQ+ADxICCHKAFeABCIEEAIIXjQMKQQKCBrQDRQ0OgRqIAWuBH5KAARADIAp0gBR4gRSggBrSgAAtAwkhCoMgzoERfoACUAMIQcGAAF6AAtKGAMuAABgBdoIWRwZrDgMAAQKABOgBHoENdIIfmAUIA0BBkIAKBoAP7QGQghokARGBICIFdGpBCDuAAjSAAAuAIFiBAF+AACcCgAKAH0YBBIAAB4MAJ4AFCYAAJwEJgQAngAALgArZhAAnApgCggBOAZiEACeDAE4BB40AToAANAGgigBJggBwhwBJgSB3gAIIA0GgK4EEewKgPIMACQMgFEGAETYBDIAFgwERgAA/gAAXgAARBwxqIBUQJBqCAFMBIIkAUgEFjABSAZyAAE4BPIECqgEcgwBKgBCZAQyAIJYDEUEgigBJgAJ2A0EBOoAEcASgKyEdgQFXAR2AA1GAA3gBiYADeAHQgAOEAViAABOAAEKAA2sCQceCBDwCQQGAAqMBIYAKNAQKQQNrgAKngRXuAiEHgQAdgQg2gSB6gAERgQHsBB8LQcSBAZuDC9ECwguBGTQB0YEAEYIcR4AASoERF4gAQ4UAPQIMGoEAGYAX/gEFgAYIAQqAGJaAAByBGa0CQR+CE66CB+mAAh+AAXaBAh8BBYQCH4MBboMS1AMFDAKABWeAAVKBAhsBBoAAVAEKggCRAR2ABZOBCHID//8DgB6CgAAJgCT3AhB2ggsuAkHdgxKfgQChggqqgAJmBBoLQcKCAEABAoEACIMSVoAE/gFEgABagAi2gABUgQOMgAQWgQBbgACzAwJBw4IAJoIC4gNEIgOCCDmCFNiAG+ACAyCBE7EBEIEACoECiYAAKoQDEYAAOQESgBWIAwMQJYMjmQFEgAWJgABkgAAtBBJqIRKBADYCayGBADuAANaBGlCAAA4CBAyBEzCEBckCDBeACNOCAz0CDUuADFmNAR2FAzyEAR2AA3QBaoMDP4IBHoEBnoMAhoEAUoABEAEfgAEXA0GBAoAaKQFkggAQAgV2gAATgAA7AzYCaIIAEAUKdkEPcYAcVQEigAkgAWCAAE4BDoMBvQEOggG9AkEegiHeAkGhigFKgAChgAAMAcWDAjoCACGABCOBBZgBbIADE4ADqgMGIAyBCpsBE4AACQcGQRNNGyEJgADLAwYgCYIN1oAAE4EhHoAALYAC44AADAV0LwGwDoIC6gEAgQLqAQOABGABAIEHZJgESQEKowRJgANhgBrygwBpgAAMhgBpgADbAgdxgQBsiwKnAQSAAMaFAquDAEEBFoMGi4AAB4AGmYEdgYEDNYAADoAGmYADcAUTIBogG4EDbAIiDoIBIQG/ghdnhgEhARaBASEBxoQCYYIBHYABKAEOgQ6AggJKA2QiD4EABwRoaiEMgADcAQuABVqAATKAHaMEKAJYdIACwQEhghVUA1AhIoABAQEJgACbgAOXggEFASKAAzwCGHGACdIHaiIjLQABIoADBoAfOIEK4YEWDoABFYABAYkDPwEJgQEVAQmFAz+AANeAAZ8GIy8BAiIIhRV/gAj3hgEmgAAMgAEfggTEgSPbgQEcAiAGgwEcAQuBFlABf4UGaIACegQQaw4CgAWHgSOUgAl6gg/AhgCMgBAwoQCMigBlAwUgC4IJsgJBh4sDswEJgAGTAQOAAvmAJpuBBmeAAgaBADOAJYmBAJiAJE2ADqCBJp2BALsDIBFqgAAeAi8Bgg7AgBYzjQCXARuoAJeEAhuAAJqACyyDAiCAAjaAAFSCDFiACnOMAFwBGqkAXAEHiABcAQeDAFwD/wBxgCc/gCeGgQIiAwQgDIAAKQILaoACFJYBEYAD3YEFPoIGKoMBuAEEgQG4gQHPgAJigwMhhALIgAWjAWyAF7mEADiCABQELwH0BIMBbwKUCooCtwEVgQK3gABxhQLrhAMAgQasAiAPjALyAaOLAvKCADuABEMBXIME8wFwgAM+gQaZggLuggChgQLwgABDAR+IAEMB8Y0AQ4QGcYYGloADNIQFkYAACwENgwBkAciFBZGBA1cC0DeJAzeCA1UBUIADyosDNwEMgAFugATjgQM3AQuLAzeBJuahAbgBC4ADNQIhD4AC+oAAQIAp14ELUwX/AXFBDoEARwMGIQyAAJ0BBoECGgMMIA+BAGYCIRiAAJUBBoABwoIAlYIBqQIgGIAAhAELgCgPAXaCAIcBD4EAhwEMgBjPgQHkgACIgAR8pwMzgQdCggOYgABGAQCAAe4BD4IAnYEB6wEPgQZlgAVkAiAMgAXeAtA3gAAvAQyDAmwBDIEALwELgQC0gA/SgQP5AkHNgwFzARGBGscBIIEmEYUGfYAACYAknQLQN4MAGwLAAIEAHAMAQdWBB+mHAaqAABwDAkHJhQdAgBnNAXGBBj4BTIUCZoIP0oAGoYoBhoAAvIQA7oAIUqIA7oICSYAAxwEGgwDOhAdLgAfiAiAGgQFagA5dAQyBAPGLBK2FAumAKDABEIMKHwEQgQDthAcUARKBB5qBAEeACR2GAkwCIBCBAI8DECASgQCCAhIMgh3lggebAQqBHJiAAdABCoIHWoAFz4QARoYAIoIAGIAHCIQAGIITBYUAGIIAEgEOlABMgAE8hAA0AQ2AAk6AAAeBC3cCQdCDAI+GCSGDCTIBCoQrvwJEIYIik5IAUIAAyYQAUIAA+AMCQcqFAZuAASEC1DeAK6mBAEABXIMCj4EACwFUkgMkAQuDAySCAp2HAySAB2miAa6CAoeBBmKBApcCIg+DKhiCAcGCB5SAAGIBC4gDHQEPgwMdAQ+GAx0BD4YDHYIDpIgDHaUCL4sDHYUCO4ACGoEDtYAEHIIDxYAAiAEhgAzCgQMlAQqFAyWJAj8BD4YC8wHxigLzhgJYgCsQAwJBy4UBYAEPhgL7ggVpAUiHAwKIAV8DIAYEgybGhQMBgRnrtQMBAUiJAwGBAHKSAv+BAKUBzIQFKYYDB4AAEYQCJQEGgAfOggBNgArEAhcggA8fAQmAAe2CGy4BCYEcvIAAGgEwgCS5gQAIAsw3gxCpAfyLBikBB4QAQQE0gCrEAQOBANaAAAyAEJEBKIAQM4MARAFrggcrggAWgAAiAWuBBtyBE1qBC0WBFIcDBkkbgQAgARKBCvyCLo2AABeBHYmBAZiHC1cBCYILNgMJIQOAAT4DEiAFgAEtgQO3gwOngQblgQf7gQFKAiIDgRJgARCAAHmAA8aBAE2AAWKFA92BFP6SAzOAAcSEAQ6BDLSFABuJA9mAA0aEACKACFKIB0GIBA6BABaEDIqBEZ4BEIMS4QEShiIFgRQ2gAblgRF9gAFBgQlygApJATyHD58BLIABXQQQIBdGgAhVgAP9gCmBgRG8gBgSgSYJgAARgCsIhBCHgBVdATiDBbyCGDeAEh6BFXACKHSBGhKAEj+BEiaAAG8COCCBFbGCHLUDLCIFggAugRGXATCCMO+CADCBKiICLAuDAfWAALuBA6QBBIEBXANrIAWADK6CIFMBNIMemQEsgBHXgwRwgAANgAHoAWqBDNSAACeBAd+AASWBASkGSSIJGyIEgAA4AQmBAGqBAeyBDPeAKH0DBGsggQAXghaAjABPggANATSAIhiACoWAARyDAKsCCUeAGWmAACmAAniAAJYBCYEdWIENZ4EpH4ASW4IRpAIIIIIRpAEEgABcgAAWgRrdAReDES2AEuSCLQUBFIAAF4EVt4ABVgEgggA6gBKxghF2gAPSgRpygABDBBtqQYCAEdyDERiCEMIBRoEAE4ASrYIUOIEOEoEwBYEIfoAAGYABKQcgDUF7IA0bginVAQ2AAJMBF4AAHwENgACZAROAAAiAAagERhshGYMokQHSgwiwAnwhgBFJARSDIBcGGQuUCQEMgBQrhhKngAEhgAjQgAAHgBMngAM0gANCAQ6CB40BEIIatwMCQUCAAY6HJ++CC3OAM+kBAoEz6YEozoEz6IAEwAEOgSBggCGaAQSABWSABh4BDYEFcoEUpYAASgELgADJgSBEAQuADc8CIA2BC+IBCYAEEwQNIAtrgy1rgAmIAU2BLUWCF5sDCSANgAx/gQjUgwArgQAngAGUARCBAEEBCYAAFQEPgBFgAnJBgSOIgAT9gAjNgCFFgCFNggAPAwwgDIYho4AEeQMIEAOBI4GDGTmCDf2DGS4DDWoigABVgABykwBQAQiDAHOEJoqBKSaFK36BAzKBAFKDIP+CAFKDGTOAAFIFCCALSQ2BKDyAAAmBAD2CBmeSAGABDYYm5YACU4EAOYIm5wEIgSUzhCssgyLSgQA5AiAIhQA7ggAsAgcggBa3hzCagRAagAeogBnCAQ2EIgmCJYOBBtWBAYiAMqwBcYABNYEigoEAooALkoEBRIAABwFrgASngAAiAwwhCoINNYMYJIAAEQEIgABhAQqMGcCBIqmGKOyAAB+BBEOABdaEI/+AADUBGIEUFYAAEwEMgRDchQBFigAmgAAfgAAYAxQiB4AWoQEMghnEgAAPARCBM4gBAYAAEIEZxAENgAVJAQ2ABLMDByIKgRnEgAEiggAwgANvgSLMgAAQAQqCADGBBU6AA56EAYaAERaBBkWCGaOAAFEBHIEA8IAYPYIZo4EBnIABZ4EZo4AAjIAAR4sZowEIiBmjAwwgEIQZowEQgQAsghmjggAKgBmjAQqCGaMBCoEFQAEYhAC1gAAoggDZARCDAQ2AEM2DANyBBo+CABkBFIYAGQESgw7OhAHKARGHAgUBEYsByoMB75ICigEShALajgA0gAIQAhIQggX/gAf5AgcLggCYgCi2gQbegQRJgBgtgSVlAxpBfIArbgEOhCPzgBBTAnEbgilIgQBMgRD2AwdLG4IAOgYJIA4gB/yAOmaAA8cBEIADFwILIoEEAocX2wE8gAAHAQ6ABceABA6AAC6ADPwCIAKDAC6CBk2BBluDF6qBACyBBluBBFODGbKACAYBEYEk9YEAHIIFKIAHO4EF24EFI4AMrYAaOYEf2gUYdHILCIEE6gUFEBALS4AZSIEXDgQEf0F+gh43gCExgQZmgQB7jRd4gAAdgDOcgwAXggZyiBePgRj8AR2JF48DIAERgAengQCcgADkBQAQAgsQhAAehBfSAUCMF74FDxATC9KBGSuHJUObGRiBCQyhGRgBtIcZGAEmgQ5DgC0QgAEFgApqgAYFA0giBIATuANBD0uCGwwDQYH+gAVDAXKIGSaCGR6CGSgBIIEAKYMZIYAARo4ZIYYAFI4ZIYAZXZ0ZJIEbaYsZJIAAtIoZJAHEtBkkAkF+jAFmAXGAAWaLABIBH4AAEowZNgEGgBk2BIBEASOEGTYBEIIZNgEXhQFCgxk2AQyEAYqEGS+BAm2GCKeCB1oBA4IHWoIOVAHAgwcYgAAHgRybgRj2AiEdgAAXgRlTgBkTghlTgAe0khlTgRlrghlTgxk7gBAWgxk7gggFARyFGSsDDiESiRjzgRSCgBlTgiGmpRknwwACgAHmgAG7A2sOH4IZZxszNDU2CgsMDQ4PEBEDAhQVASQAJhcYBD4/QEGEGWoDCwwkhgAKgSRZgBlsgw5aghl2ghopgxl2AQqBB/aBDkmAABIBDIAMGQEygwAKghZ0hgFiAgwzgRBnAQaDBQmACgQBN4oWMgEGixYyAQaBDGKBELGBEP+AIPWABKsEn5YCR4E45oEAWwEogwBZgBBNASiBBf2ABMKAHPyAAAICECeBAwcBHIAPLoAALgI7AYEpLwEQgABKBEECECeCIJ8BtYgXUIAEFYAAYgEzggCrASSBNr6AAlyAEFeAAwSABT0DdEGAgANugi39BWpBH3BFggMhggjBAwBBuYsMaIAAQgEHgRafAQiDF9EBh4AO0I0AHgIEdoEDxwNxIgmCDTiADUYCB02CAMYCIgqABwcBCoAMXYEpvgIoIIAhFgQFT3ENgBaXgAWmgjq4Aa6LDeEBA4AUYwEyiwFGATakAUaCC9aABpCCEhWTAKuAAbYEB0GAwIE9nYAAHQHYixL5gwHTASSEGF+BARiCBDKBNo+BADaAOBGBBGSBNOyDAAuAAXcDOgAIgAc+gQArAjoAhDv/gQGagwGPgh0kAwJBtoUTRYEIwAEGgwDbgxlvA0UNNaUA24gAmIEOToEMtwMtABWCJPSLAJSCCIaKAIoBBIYAigG3kACKhQFlgAwMrgCKgAD3gyK8ggFzgSAWmQCYgQKskwEiAbiLAJiBACSAPBsDQYAIgQGnAQeCERmFAKmBAASLAKiABLyAL4CKAKiDGqKCFq4BNoIamIICfYATlIEAvIENJYAP34EI8YIDV4AAaIEAo4AFvIUArgEogACugBvykQCuAgwohQECgQAngg2oARCAABSKAdQBMqcCr4AICoECWoADh4ADj4A8y4ECc4QDlQQYdnJygwPpgghuATCAAScBvo8BJ4EQVYMIrYEIloAC7I8O8YARF4UO8QRBAiEXgAEShgRKASiMAGGDFHsDCyAdgB8UAg0vhB5PgRohjBoGgBhuhBoGAQ+KGgaFAOyGGgaHAOmkHk+BHkeABjsCpDyAAE+BDG+BHWWCD+7/HlyXHlwFqDxBsDyCJqEBzYAABIEACoACM4keXYAAGIAAEoAeFQMUECmgHl4BrIAAUAHNggfagikfARCJHl+KAEuAASiCHmCBAdIBqIEBK48eX4AAQoceX4MXxYE7jIAR8AEGjR4bATKfHlSTADkBKoEAGYQeVIAZlrceVIAATgMGDDCpHkoBBoEAfZMeRAEGhBizAgwtnh5AAQ6AAAoBDoIeQAINLIANIZIeMwEMgA+mgQApAWuAEDyLHjOBBBOFHjMBJ4MEC4IPyoAECwErqAQLkh4hgTmHjx4jgAGbAWCAAD+AHiOBAYyCHiMEBUEeSYEl+wFNhQfBix4qASeKHiqACNeIHiqAFZqDHiqAGWGCHiqDGCcBC4MeKoIcm4QeKoEa440eKoBFTIEeKpgEJIAbR6EEJAEKgQBpgAS0gQBpgAAMjx4qiwJ9AQiAAMaLHioBFYMLkYAAB4geKoAADoALnwIhDYgeLoADOgIiFoIBJYweLgEmkR4ugR5DiR4qgQHhgBGrgT0piBrzARODGvMBGIYWcAEGggEFgRdSARODF88BGYEXT4AdNIQXz4AAvaQeKgEZgR4qhjOpAQ2IASaAAAyFHHIDBSAKggEcAiAKgwEcAQ2LHiqAPQqFHiqAHbyAAn2CAeIBCIQXCIEUcaMX2ocAZQMFIA2eHiqAFOGAAgaBADOMHioBBIIAu4oeKoAgB40AlwEkqACXhAIbgACagBEXgwIghx4qgBnHjQBcASOpAFyAHiqGAFyCHiqAEkSEHiqAA04BC4AA8oEVnwENmx4qggglgQUNhQG4ggZKgQHPgBHwgwQmhALIgBLdph4qASWIHiqBAuuEAwCIHiqHAu6MHiqCADugHioBHogAQ4weKoIAQ4YeJAEWhx4kAwUMK4keJAQEQQZJgBGXA4ICSYIM3aYIsIAFjAIOaoAFFAFrgBo3gQV9AhJrgSgDgRaRgQ7CghaJAxwiDYEXF4ADkoEWwQQgaiEhgAOXgAAMgxtmASKDAA2DA6QBI4EACwFUgAOkgAAHA1AhGYEABwFAgQLIgQ7QAQOBAAeBFheAAAcDMCEkgga/AQ6BA3KFBrSAMJuAAAuBPrgCCGqAGKGCRckBcoIKeYEDTwILIIAroQIgI4ID6oE9DIRBLwEGgQP0gAzngRl0AgR2gQQWgRuUggHKgBtZAy0AAoEZSIEjIoAcU4ADBIADpoEK8QEGgRshAQmAEhWCHdGCAC6CBO2CA9OBEB+CAJiBIYCBAt2CBk0BCogAqIIAnAIIaoAAT4IAeYABAgEEghqmgTyKgBoEgACJgTF+hADfAQqGAv+BAAuGAN+BHPOAANiBIeOBAOYBC4IEyQEihADfhwDbAQiDG+kBCIEDFIIA24AWuIFK9wF/gACWgQC7hEUegRt/ggOIiQNsgQXvghDsgD8SAQOAGuYBGoMAgQEDhAAfgS7tgQA4gACHgQNhgAC3gwBsgwFHgAEighuAgwDaAWqABVgDDCAfgBjwgxs/gBo+gRkcASSBGzyAAdABxIEbPIAbOoAGaoEdGYEXa4EBVAMOICCAACiDB4KAAIkBC4EFmQMOICGDABSBABGAAESBIhaBGQiBLWeCAbKCGvqDAbKCJUSCBpCBQrGBFawBDoEaioEAfIAUzgIiB4AXcaIANoAWOoEEYIAANANrIQmBFnYBDoEET4EAhYAAB4AUuYEZh6sASYABKwEJgQRuAwlBA4EXlogAOoIBtwE6gAFnhQJ/gBT9gQU7AQmAAFWAAjqBAFWAAAeDB5KAFVGAIMKGADwCCUGAQciAFsuDAq6AAJyCAG+BI4ABDIAcS4AAqYQAKIAADIQAZIIACoIAZIIAVoAuT4MF/IEAcoAQJwECgEqvggBmgAJNgQAqgAA+gAWPAUGCC26AEB2EAGaAAOEFLQAEOgCAOqGAFASAABSAAo0BCIMeHYAeG4EBAIId3QMIDB+BHsCBAhmBAqWCAh2AEOGAAh2DArSAANKCCKeCIUuBAf4BGYcALIcDI4YALAELgQnQgiGTAw0cGoAhdoAAFQEbgQDyhgE/gQMegCAsgBsOAU+AJNKAInGBRAiDKKqABPMByJEjD4ADpIoIHIEeLIQjDwENgQNNgAZtqwgcAiANhSMPgABAAgAigAZLiCMPAQuCHV+BJjGAAGmDIw8BE4AAlYAANYMf8oEYgwEFgBvMgBqYA3EgC4gjD4AKDoUf8qUAiIAKLIMDnQELhiMPAQ2PIw+BAFmBARuMCKwBDYIjD4IUw4YjD4Ao2AEIkSMPAsg3gwAblCMPgikPhiMPggSDgAAhiCMPgE4JgQqjiQGGgAC8hADuggqTpSAOgADHhADOiCMPAQuFBI6DIw+AARWBAOaCARWFB86AAjQBDoEPNoItz4si/oAK7YEMXIQDYYABqoIUX4EePoIHUQEKixBlASSkDFqAHwYCIA6CPQmMHZuBRLMBIIJFh4AZO4EHXAFGggecgBHOgSDHgRD4giJGgRGLgQJPgAG/AQODFGGCAJaAADeABK2AAl2DABkBKIEWV4MUcoQQToID2oARQoERQIAZyZwQ6YIAZwIbRoAAMQMAQeeKCOKABVUBEoEs7oMmkIAAEoEWqAGAgAS3AXSDACaTEMkCvf6CHleCE+wCAHGBR/+BDhUCDB6GIISABHKCIGkBBoEBaYMAFIAAZo8AHpEAMoAtyo4AFIISxwHOhSQ4hA8Fgw8WAQaCLAKBJDgBCoM3joMOnYAA2IEANAHPgwK7gRZ7hyQvgAECAcyLJC+CAZIBVIADV4sCvoAcOgIgCogkL4cERKQqioMDp4EdGIwkLwLIN4MHGYAcjIgEPYokL4EEPYAZxYQEPYEHvoEeaIUEPaUAgYsEPYUDW4ABIYEILoAFPAEKggChgB0vggN7gSfPhARFiQNfniQvggFgiyQvggQbgQ53gRBpkiQ0gAFkAiALhCQ0hQQmqic1jAQmgyQ0hAQmgyQ0iQDFgQ03gACEiSQ0AQ6BNTWAKX6AAMCHJCqCA9GBAeiCJCoBBYwkKoII7o8kKgEShiQqgAoUjSQqgQBEiCQqgAAiiiQqgSIugCD1gyY+hyQqAQuDJCqBAB6FEUGJJCqAD/eLCLGOJCoBDoEkKgEOggBNgAUThiQqhie/iANggSkGjQAUhyghhwAUgAA8hQHzggT9gThtgQEDgSvPgA1nggFVhgx4gRJ+AgN2gCFugx28gAWWAWuBEYEBIoQMngETgCNogAh0gROFgQA9AQWBTJyAE4qBA3aBCDMBBYIByIEMposbGYAABwEEgQR9AUeBBP+EBraAQr+BEt+DJKcBBoFUmoMVwQJBuYcSlwEUgAkUgxbyggFegUXxgSzagBKWggHqghZ2gB+hgB93gRtxAQ2EAAoBGIABnoAABwEUgQHEAQWBAgOADNGADKuAAZaAJEyBGriAHTkDC0sbgRLQgAAmgAoYgUSQkBjMhBbrgRL7hBeWhRL/gQD0AUSEEuyEEvqAAF2AUSqAAL8BuogRLQFEhhf9gQDFgQa0gQaohA93AWqBA80BA4UAx4EfrIFE1gEcgVWbggK2AUSACHiAABEBIIEkc4MSC4EAdYEIMwIgA4IU4YFRyoECQYEBGAJJG4ACPpYYaoYAygEFhADKgQB/ghOugA40gADCgCDkgimehBfGgR4Ygh2qgADGAbuSAM+BDNOFAM+CFNmVAM8BJI0AzwEo5ADPgzYliQDPgRzVAkG8iQJdAQWBAfWCBM2HGfSBLvSgCEWDAJyFAJGAAuIDLwEcgU7wAwBBmosJgYIXwIcYnYQaKAFBgDowgCb7gADwAQmDG1GAEhiMHMyMGIKBBGqAFDmCBGgBFIAACIoI+oJGeqAI+oEIpIEjc4IDkgEggVLLAwBB0IoFFYIApYAF6YQXyYIAuYMHo4AAGwEWgRaWgQCpgywOgSwfgUAJpRC7hBN5gQVhgTTHgAlfgVNMgySngShjhyhiAQiBCvaAABCJKGKCCw+WKGKAAG4BOIFKtIUoYoMokI0oYoAAmwEsgQG7ggYvgAbRgQfZAQiABZaFKBWQKGSCKAcENCIGaoAAJwEJgAAngU8ugCWJgSWNAUmBIagBCIAAOIESw4IoZIAAI4AFIYAQBIAmeYEoZIAAlpMoZIFO84AC74IowYsoZIIPXIsoZIAE3IMnnQEEgQGFhChzgEyChShuggDOlShphQKmhwrPgSEqgACmgwq4ARyBWaKDBweBCtSBEQ0DCBAngySPgQALAigLgQFbgQKOgAAHgijxgQXauSi4AQWAKLgBBYMouAEFggCVARuCS8kBHIYouAEXgwJkgyi4AQuAKLmADMQBEIMouQEXgyQjAQeHJCMBJsEkIwEKg0DqAw8QP4UACwFxhwALAR+AAAuMIosBCIAiiwLXJIApQoEhuoFPOAIQNIEiQYArJAIAGoIC44EBY4QiiwEcg03ZgFWegwCZg0qfgQDqgwE0BQRBmgVHgCtdgRpgAYeBA4uFKZGAJteCAx6ADEiAAHmABDCAAXiHA0KBAa0DABA2ggApgwcfgAIdgwE5gAdfASiFRpUBBIBWdYFFNgJBd4MkNQJLG4EP3IQAEAcDQQRKG2pKgAC2gBBCmCI/AwRBKoEQgYIAqoNEToAEcwELgTCxgAB3ARiDDqYB8YIEpIMwDgMwQQyAIUgB8IEY4IEEOIMAsQGIgACHAUqDBgoChAGAGdYCAkiAEoEBwIEIAgEDgBUKgAAMgAJHAcCBUPkBBoACA4MbX4BPNoAAKQIgcoMJdAFsgSUUAh9wgEChBEEfcxCCCGIBbIIX/wQALwEygQAQgQAJAzAQPIEBSYQNAoMFQIIAm4IBLYEBOIQEc4EAYwMEQTmDUfqEBXiCAC+DBhqBGYqBA0uCAHqAFVsBH4IOl5MAHAGLgRxvlQAdgCEOhkzogyMXkwAoggoV7AAcgB77gkjPggGQAQmAAeMBQYBGy4MDzIIBroE2lwICSIQBjpEARgEggBKFlgBigQfVjgF+ggLUgwKigALmgATxASSBCv6BAyaADEWBHtiAC/OABRKBCq+BBPaBAvqECgeCAF2CALKABLGCAH2ABpwCR0GBBGYDCBtyggC4AQOAAAiCXdOAAAgBEIEITQIbcoIAhIAAX4IG1IUATYMcQIAKH4QASYMAqp4AJoIi0YMAKQMvAQagAE8CLQCBE4mcACa9AX2CALeCRYWcAI6CVlmBTU6BCvShAQyZACaIAQyAAcABC4ABs4IYxIAEG4ADQ4EGn4EAN4IDUoIdZYcKQwEgglsygwOBggRbAcWAJpkGBQIJCQkDghSLAduAMFmBUaUB54EMLIJaAoICLoIoTocAxoAHbwIvAYAG6YAG54EOLYEAbYEEaIFD+YImgIJPvAFPgwPrgAoXghm4gADSgjGCASCAAL+BFpGGHtCAEbuCBzaCACMCLEWBBHgBT4QZlIcA0IAARIAGpgFrhQDTggBJhBIwhgLcgRWlgQwTAQaBBPaDDvKDAuuDQLmQAIkBBoUAhAEUglKdigCHgAClAU2RAIeBAL2GAVqBAVKCE+KGCbyAAD0BHIMGEQEUgiBzgQAThAEjgU1PgADvgkaLhADqAQePAGOAGPeAABiFAGOGBTeCAfuAAEqEChWBIPmBC4SDAQqEAiGAEzyDDAaBBb6EAjOGALeBAjCBDuOEBQ6BAIGDBg+BYPKAGBqBB2OKAIaAABaPAOkB24IA6YYARIIre+MA7IArFq4A7LEA6gHniQHLgQNXgQDIhADUgBdjgh1RhQCpgRPDg0tnATCXAImGAB6aA8uJBwaBAIeNBbiBKUeCAs2CNmaCAAqCD66CAAqADAaEAAqDAI6CK3aAADgBdIFF84FJqIED8oAIP4E0NYQIV4IKc4EE/YMHFQMBEDWCMCeFCOCABQQBAoUfnwMCQZSBESaDRHaFAFcDAhA5iABihBUJArQtgwxCgQmrgAAdAVyBYO0BToFkWYELnQIDaoE8xIEADAFsgAOmBEEBEC6DACYBbIId8IAGfQMQNkGABXSCAAuAA6MBG4MA1oAAVgFggwBAgQArhgHzgAANAqAtgUiugAFNAqAtgUhTBCgCmC2JB3SwAB+DAbCBEg+BFD6ADCuAIAmAACSBHxWCADSADPGAEk0BdIQAt4EPK4I/IIIAToEABgKkLZsA+4EQsYAB448A+IUA9IJhNYIBIwKgLYIObJ4BRpkAToACNYMBRIEBv4IjWIMhfYIAy4BF/QKDAoIVWYYBYwFsgyVogQHaAgFFhwAlAklxgA+VgDioiwAqgSFHgQ4ygQCVgBbHggInhgICgi3iwAICgQLsgwEMhCrJuAEMAQeEEWKAAK6AD7OCET+CAO+BWueAMvQBAYFJ0oANxoEV44IPA4Id/IYACoBi0YEzCgGCgRtkgAkGgBFoiQACgAT8gBvygBE6gR4vAQiDWXWAAAyAADWAGfSBAAqBTyuDAAqAAx6BMjqAAAqAC82BY6WAAAqAIKKAXYaBAAoCB0eBPR2BGMCBHoSAE+mBFdOBE7YFA0H6AUmBHreCEVuCP8iAFd6BBAOAIsiBAAqBLMWBHMwBCYJN1IEcrAEJgk26gRyigh3DgC/CgQAKgRDHgSJ8gQENgAnLgBRfgADUgl4Hgjl7gQcFggHjgAMggQMJAQOANLCAL3eCAHCCAyyCAyqBZB2HC3aBACuFAB+CBNeOA2qOAB+BAFqACAOCBaiBG20ELQCQIYADdYASjQJBhIEffYoDe4Au74IuRoMCfoER6wKIE4IAHAGIgCTjggKogicSgQOYgwyqgwOYggKUgQB/gRYUgQHmgQQ8gQNUgwnJhgDMAQOMAK2GAB+CAE2OAMyOAB8CIAWBAB+CAYmoBDaEAJyFBDeEACy0BDeAHeiBAO2BTj8GQQxsQZgggGi3AQCAM/UBC4AATwF+gBmMgzFyAZqACWiBV9gCQX2ANpSBNKSCADwBBoExVoYJ5IAA3oAExIUGCYALCYAKHgUAAQEBAoJU3IABewK4LYMDoQG8gAEKBXRyIgY7gAASghDCAwNBDoEy1JQLLQEGlwyqgREjArktgwyugFXkhQBdAmt2hABdBANBDWuCEbuAAt+AANEBNoAAHoQAcQEKvwBxgCgygQDAgQBzAkEJhABnAgdqgBRDgQBlAhAtggUQhAeaASuBT62CAaqAMZuBD8SCZkSAAA2AFxmFKHuBIluBDQqCTg6BAfyFNAKABRiCAAiAAbuDKOeGED6CACKCB7yDEJiBJK6CBVcBGIECDARMDQMagwhCgQHcgWdXlQDVggOQhAAqlQAjhQhsgA+ymAAmggAjAy0AM50AI4AAC7sAI4cAjwEKnwCPg1EKlgAjghUlgh/cgGp4AXaLEJCDAyoBGIFniAFKgwbIgGaVhlyIAkULgjTzAfqBJyQEQXsLHIBP7og1CwEQgAxhhzavArsBgDaMgRJwixL3gQ63glZcmBL+gAAgAUScACABQJwAILATXgF9ghJoAfGAE/0BC4FQ1AEBgADEAQmCE0sCbBCBcHOAACcBbYET6gcQQAu6CQEVgTXcAUCAJWSCBtICBkGBOZODDdYCIAeBEoICCkGADTSCZvYCdGqCBOWABPCAScuHBPCAABqAFvmCDXuCV76AF9cCIQmAbgwBDoEj+oFA3YIAQoAQTYIAQIEKeoAADIEkY4EAMoEkJ4AABIFOSoAW2YEZpYAlu4EsBgEQgB8JgiomgAA8gi8UgAA8gjtVgi8UgSNEgCG/gQAdgUo2hAOKgySKhABYgRuOBAhLGyGAOd6ADFEBAYImL4A8H4EA04EAzIE67YIAuYIAQYIeXwIgaoEAZQFrgAkAAgBOhGhRgAALgAIXgQCxAkdygBkegjGogCLQATuAI7KDAFKAAO2AAK6HAS6HASkBIoEJPgEKgwCfhAExgABagwEzgWEhgixSgAANgS5jhQFBAkETgUDJgE+KARWEBYwDAA4CgAuPgT3IDCESQe4IIRVBrgghFIE6bQF/gAARAvANgAARA7ANIYAyQQEBgBatBA9BCUuBaXuAZVyBYOABAoAU7QFxgGnDgARZAw90IoAHPQNrIReDEfCAKZOCDWSABIOBCiOBY84DdCEYgAosAX+BEcECIBaFAMKARQOAFDEBGoAyhgISTIRCNAHggjznARSBRSOACimBACaAQWMDBiAVgQdoAwshGoEk7oAIXwIiDoEBYIApw4BGaoMkzAIgGIIOLYEeZIA9EwEHgyyKAiAQgAFJgCUCAQ6BJMsDGSAagQP1gSZCgl+oAwFrdIMBYoE+EgF2glxhAQeAWWCJAhOGAoiAAbSEAoqAbMWAIcyBUswBB4FxF4AAy4FRjQEGgh9cgijBgEx5gwGwghzNAQyDChSCRUkDAiAXgCBFgRpQgwElgQAYBSAPIgkhgDdshwDLgQRQgQC2gBlMgQC2gRVPgRPWgD8kiACygWIHglmngD4JgmzwgwCYAQCCbV6AAJiCAqODX+8CIBOBAFaDWyCAJKGBAmMBDoEJ4oApA4YBiYQAB4Ifk4AApYEg3gFGgADKAQ+AbNeBPZqDGRkBS4Il/wQgDBsigEflAQeAALIBGIIBegERgQFNgQGTBAZ0IRCCL2eBA3EBDIAvvIEhoYA9cYEBToJKM4IC/IAFUAFKgW2bgDzfggJUgQJNggIgAyATaoACRAPTBkuEAlsFE0HRBEuAAl+CFEqAAtqAJUCCRa0CIA+BAReAAtWDCSCAM7WAUtkBdoEBMoAhOoED0oEAbIECNIMDrIEDyQEAgwMPgT5vg04QgwMdhwOTgAAYAQ2BAAiBAzyFJ0EDDgsrgAFfggHLgATbhB/hgQSTgVzwgQAHgmW8gGr4gW8AgwT1A2BB1IIE9QLEA4JxZYQ8goFV5QHVgRgkgRcbAdWABnSCAAeDUS8BAYEdcoMAHoMlpYAQVIEmy4ADNIEOkoFRBYAcz4EoKoEMDYM364AOYYAIxQdBoIbi7X5zgiASAgFxgXHngzBohBwSgAoagAoQAcCAb+6BABaCIaqBAGiBHKKDbyABc4Agu4FrpIAuKAF/gwKuggDlAyADc4InW4FyYYAAPoEQSIAAKokA8YUCXYAAQ4AYjJQAM4ACoQIIdoEAHoACwYkAHocAGYAC4ZMAGYAcDZMAGYAQuJMAGYAHMpMAGYADIZMAGYA71YoAGYIA4oAdUIEA4oAbRIIA4gMLvQWCB5aCA9qAACGAPKCEXiGBCviAADGAAPuBA60E8f8Da4ER+wRB8P8DgCDEgWqOgXKlgXaGA4CAPIAKF4AAW4IAGwMgAHKBWbqCdRKBHpiEAXaDAVSGAFGBZsKBdD2CAXGDBvSBAGMBcIAAUoEHc4EAbYFjLIIAUoAAUIACKQLbAoEMgANBsCuBD3iAbEmCDjeBAmeDAE2DAA2BMtuEAAuBDZmEAAuAb0qFAAuAALaFAAuADiGFAAuBFMCEAAuADtCFAAuBDUyEAAuBae6EAAuADqqFAAuAQOOFAAuABAmFAAuABZiFAAsBDocACwEPgQALgnWugC0IgiAsgCGJgQR3gwD4ggLZggAJgQGkArArgwGlArArhQKIAQKAAr+BAVIBEIcCyKQBUoYAWoEj/4QBzoJsS4ICuIAADYQAC4FmI4QAC4FxyYQAC4ABMIUAC4FooYQAC4FmXIQAC4FsqYQAC4ABMIUAC4ABMIUAC4E/YYQAC4ABMIUAC4ABMIUAC4ABMIUAC4ABMIUAC4UBMIACZIMBDAEQhAELgRezgS9aAnRygAFEAwsLkYkJeoARooMInocJfAEGiAl8ggUQhQl8gCjFhwl8iAjyhwl8ggBCgTpeigl5gUV3hwl4hGZsgXA+giR1BEHAAjaBDMySABeCTJKBFZGPCa2CB0+BJFCjCa2CCR2DCa2ICjeHCa2ALDyCAFyAbpiECo2CdCiABh2BCYyFLmiAEDOICa+ACMoBToEINYBbzAEggENVgWGnhAmyAg0CgFXfgSjkhgmzgQiEgD5BjAFnhwFihURoiAFqgQh/hAm1ggAXASCBCGuFAI6CBbkBFIAGzwUFIhMhFIwJtQKBAoAJMQmgDyEUQeAOIROBCbWBCUICoBCBABEBD4BaUYAHWAENkgmzAgQagQAbAnQigEraAWuAMiCECbQBDYIXHIEJtIBUJYAAIYAH0QEWhAm0gACAAiAVhQDDgCvAAWqALtMBGoAf6IADdoEGqgEOhAm3AROBABOAE4OFCboBDoABdgEUiQm6BA9rIheBAWuBCO8BD4MJugEHgCKBggs7gijzgAbZgQfmAxggDoEH0gMYIBeBB+0BGIMJugEGiQm6ggFpgQfJgilNAiAGjQm6hQLGgAG/hALIggkiAQaBCSIBBoEJuoAAz4FB9IM5f4UJuoF2v4gA64oJGAEZgClKgEaAgAAoAQ2NCRgBD4AITAQPGyIPgRq3ARGACVaHCRiAAPGACvuADKqCCRiAKcCAUESDMYCCAKyBVimDAmWAUdSBCRgBB4AkUoJldYIJFoAj9AISaoABpgHUhgkWAxJB0IIJFgEHgFQCgkX7g07lgE6/AQ2EMO6DMP8BEYAYfYQJFwELgAp+gAM8gQBrgAGRhAMWggkXgAM1ggyqgSzbgQAYgQKKgAKAhwL8giXJhwkYgQVugTXXgjBOhwqoggGkhAqohgp2ARKECnaCNjGCCncDCwuqgBHygQdSgRY6gTIzAwFBnoISRQQAQYgTgAASgAJJgmzJAkEegwAVAfyBYfaGABUBE4J8a4AACYAAWIMD4YgF0oABMAM7AZSAbC2BDqACsC2DRRIBqIAACIEAEAKgLYEToJIAOZYAGQMLrwKCAKyBD++BEi6BDwKAEkABBIASnYA8xYAAEoF04gEEgxKdgg8ugRnIgxBAgkQpgBBAghPBlAAcgAb4gxIsgmLNhABdgBKdihKbgTJGgxI0AgAQgEX5gwBKhxCmgwBKgjValQAchRELlQAfgAL7AXODFTCUAKiGHhODECKEJI+BD+oBEIA3E4MANYBtRIFAYwGngBPQgkdRggDMAwFBCYgBG4EBWIRtkIUA/wG4hAD/lQAgggEfgxK9gBKvmQAqggBKgiIggwGZgQCAgm76gAH7gQE8ghRwgTkkgQA6BMAtC6aFAKmBAeCEAK2CSie8AK2FAIKCTUqBClABSIJtXp4AVIEAP4cAuoAKgIIB9AQLC/wKgGgFgwarhQX4gRtcgxJugQwyASKAKw8BLIETvoEKnYEDVAcJQf+A/59/gjSsAQaDP3qBDB2BB0CBGVmDBzaCIyOABTaBGWyGBmKABxWCAuoBAYFwOgMvAbyEAAgByIAACAJBIINYfIAMh4E9KIAcroAMW4EAOoAhtIIRcIUWKIEYFIQpGoAOX4ANaoIpAIEBFwWYFmoQL4IACgGkhgAKgACwgQDFBJwWEDCCABCABAKBABABqIUAEAGwgwAqAkH+gYAdAkESgQYjgAECgDVggQZyAQKDL7OCN50B8IBBxIMA2oMF5oYyD4EATgEtgQAygBe6AwVBEYABgIEEEQYoAqwtQQqAIsmAWQ6ACm2AJteAAAqCLFCAABuAHKCBeOCCEYaADXyBHpKBGrSBTt6Aeq2DHmiCJjECECuBAICCBByDdcGAAnOAGA2EACGAFVOABCeANWsCciKARriSBC2NAhGJA8eXAmGBOC2FArSEBC0BAY8ELQJBoIBBjAMaEDGCAoeBJhCEAI2CdwKGAIeEAJq5AI+EAz0BDYEqpIEAmoAAlIIKi4Q3AIRMRoEAk4EB6YEt9gH+gls+ggHogUlaggEXAQyEAJCBIYuHATK4AJgBBYIH04kBKoJuggELggEohABngWwKgAKxgH88gwChgACKAQGHAIqAYzDCAIqDCF2WAIqCAGeCABKHAIoEBkH9/4MBJYIAkwENhwEdwwCTkQEfASKAPaKCAksBDIIAmYcAb4UAGAEEgACfgwHKggQ0AQqGA5iAA+uCE3UBCoJCtoEcbooDk4F/a4YAR58DBYEnV6AAwYEZz48AvIgDB4kArIYEDoEEcoAAkAMJEDKFBHCAZ84BB4IADoEgqQExgReWgH0YgiGJBywLC5YLARKBDT8EIGsiD4AqpIJ1Z4BhrYIXj4INCYEX5oElogEAgk1NAtDHgAhxAdCCRymBAAQBSoKDbwNB2CiDDtoC3BaBVeMBf4MVFIIMF4Fqa4ESWoBXbwEogW3ZgBT/ggDagQCkgFd8ASiAAUuFOeCBLzyBFG+AJjmBVP+CcE6BQtiAH0mAgh2ACPiBAMGAfvuDEqGDBPeCHB2ABO+BNG8CCRuBFoSCbjKDBP+CE5+ANG2AACMBrIEajAELgXQrgwBSgB4bgAG3hQGiAdCALZSAChWEAJCCFVSEcM2GAHCAa6GCLFeCCgyBBgWBCduCAXOAAV2DJiCABmyCAPSAB8iDBrkC0CiCABGCAO+AAISAAF2AABUB4IAMBoICQoIAh4JF4gLgFoAAEYAfRAIQM4MAjwHUgACPgjGlAdSFADKCHwiCAJeABm2EAP2JACaFAB6EATSCIYKGAOoBBYMK4YMMcYEA94INhYN4QoAMKIEfuYEWFAEEggAKgBokgR7JgADfhCHNgQr7gC1NgwsCgBw/iACthEPxhgHcgCshhAaQgwCcgACOggCcgwHhggDKgw8MAbyAAieARc2BGfqAcEqBAmYBCYYCcgEQg3wZAQiDW1ABBINOpoJD74I0hIAKRoI8T4IsCIUcOIYUEYIx1YEMrYMAhIMBYYUK94AxP4IJ7wHUgACtgACUBrwETBshEoIHboIBzoEjGIAv1IAx+IEvNoQAPIEktYAX84A0QoAB6IBSZYQ8YoFDwYEANYEHJQVMIgIbIoIXgIGD9oEqEYEFdAIgDIIV/oIX34se14IU8YA+jYEEIIBIMIFWRIMAbINsZIMHzoAAaYAAfIABpQMQamyDB9GANB+HAtmAQN2AFkeAAIaAAcOBACCDAt+AAMqChuKBRyiAAHaCRNkBAYICg4AB4IEK84KAvYE8noIO3oEI0YAASIE6poIOOoNIvIEBHIEArAECggImgl+igQ5egg+4A0ECSoEABYAtGoAAO4EAXYEAlIQAboEOP4IC/4ID8IM4LIEtKYQBR4EBEIE+HYIJWIAfxIEBQoAFfIMFT4MA9IAAFIEIVQIFa4QA8oAR+4UDbIUTBYEK4oAMuIIWuAMAQbqAAkeBAU+BEJCEAhyBGvEBf4I6nwIASIECxYIEioINWIQbhIMNBoMAgIEFBAEPgwJJgS/RggXIhgGkgoIfgQB8AXGABdiBDj2CAmgBS4QD6IQ4NIITv4JD+IIAnIUNpgEPgA5XASSAFa+DAF2AhreBHHGAbuWBA3yBABGABt6JAraBhVKAA62AA1KHAOsFC7YCAQmABxmBOSyCgmyCAsaABtECOwGAP0sBQYACQoAE7gRBB0GKgGbHARuALHGDDkaBHC4BCoE6ZoEEhoMBAYJ1voEK2ICGroADHoNCyIIaBYAZooF5K4IW7oGMzIQC2IAv24EET4EFjgFLgRBtgAbOgAVegSe5gAQHggE9gxotgALtggDHgh/2ghYqggcdhQAlgHDohgLzggLYgAtugRCLATuAAAeDQvqBCuYBCYJ1KoEAHQHAgwAdAsAVgweagAASAcSDABIBxIBivoARWAIKQYA7hIEEtgRGIgMbhQD3gCTwgAMlARuEAQ+CATgC0AiAATiDDESAJPqBAF6CCr2CCY2ACr2BAHqDBpCAIryAEYeBQNGCekOCB7YBL4EFDIEANYFDOIIikIMBgIIAkIEOsoIcfIQHlYEhwYIPJIAHp4AzgwIDSIcH8Y0OgokPI40AHIgH8YATp4UAXIAH8YMPgIEFqIAU+4EMeoEAC4MK7IAk7AKQIYFBcgJ0IoEWpAQvAYYIiwCmAoQIgDawgwBLAQeAAKeAAjaDCJmDAKsBB4gAq4EHeIEAj4JUAIUtQ58Aq4BY14UAYIAAq4MAYIEkJoEAq4QmF4UInwYJQRxrQWyBF7WCf1YCkB6BOnCDAIyAAA8BoIA0hYA0mYMAkoAaCoIJSYBJAocJ/40AhoIuOoQAHJYQcIwJ/QEEgAqSgzSVhAChhABqhAAVhQCrgACCgQB6gQq0gQ1jgCbRgUgggA4SgR8eBIECSRuAAXgBI4MBeIAW94AC4YANoYMAt4ECGYBEpokRN4AAfQEGhgDakgCupBE6hwFsgADHhABggQe6hgFsAQaGI9oDCUEEgVsjgAjFgAFpAR+ADLCAADuAAAsDoBwigACLhAKigTSwgQK8hAIVgwB/hytZqgIHgYAYiwFnjwCghwByhQLShgCwgRzFgBhsgiF/AqAtgUNygALeAy8BgoGGLYJ82AMvAYCBcryBAD2EAhSDXbubA2+iAiKBETCFALiAgMuEAQ2AiIqDALaBeM2DEKEFswsBCn+DBWuBBY8BIoAfEIEw7YAs9wEbghsvhAV5iwV1gI/CghzcgA6LgQcVgALygU2VgTgkg00Xgj+EgmoygIMmgStDggWEgwVxgQs4gj3SgBVJghVjgABmggTFggDEgATFgR1CggSagQJ9gAFbgQJ9gD2OjAElgAHyAQWIASWNAeKJASWNAByIASWAXOCEASUBBYAB3YMAYIGCjYQBJ4EACwELgQqGgSXyhR4ngRXehxA4hBRUgXrdgRA6gQX4gAD0gRTlgh2whQDmASKCSSaDix6DIeSCA0+CAqaAHluCAfWZA02iArKCI/mBBWCBAMCCEhuBbjSABByDAfOBG0GGD86CfFeBBraDAIqBKraBAQwELwG+FYB2H4YEs4kDRsAAlIEEeo0AlIAF/IAAJ4IBZAEFhQ83gB1chFsFgSoXjQ8zgQ4TgQBtggasjA8zgQJrgi9njwHtjAU2gHcFgyfhgVCZgA/HgQaFhgBxhAAagCs/gQAagkrKgDwQhHuAgQfQjQE3AcL6ATcB/oUBN4QPmeIBN4APrJABM4NOxIIBJgHEjgEmAcb6ASYB9oUBJoIqHeQBJoMqOo0BJoAIQYN+WYIj/4IDkYIKA4At4gFGgA1zgQWPAQiBBYqBCgOAAA+ALiGBBY8BCIQKBwL/AYCX+4MQmoEJsYEQmoGRooUMkIBNOoAMC4FKnYMNKIMOBYCNHYEAnYAOzgEEgAyugkONAQSAHRKCGyuAAWKABV+FAECCBLKBBKWBelmEMPOBABiALt6DABgBDYM9nQENgSpzgATvgQ9cghCPgAAIgj4agAuPgw1cgBraigBCggBjggBagXhbgQDtgQy3gQA/hA+tgXl3gQEpgg9Vg39uhA0ehQAVgCmLAwALg4EahIANGYKMDoQ7zoF2X4EACIVf84ApfoEACoEPggEggS+3gRYHgz0KAduAG6oEAUEWTYAru4AGs4BfxgSggAJxgCe4gQBNgzb1AQGAm8aCC9oDQSpGgUA4AgVGgV/lAwBBOYEtAYEG+YACXwML3AmCAYaBkPqAQs6CAhQBLIEr9oAG34Byv4EAD4AAA4BUXoIruoMpOYMXo4J74YJ64YMCLgJBKoAWwAJ1IoB5b4EBtYACSIEAFwFsgwg5AVyAJaiAAYiBi42BmLaABI6BAGuAAtyBYhyDFJsBT4ASTwFLgRbjgBwAAUWAZfIFIARHcnKBZFuCLJyEPNCADFuAanOALKmBArqCAs6AW2qAHU2EFgOFABOAIpmGGnCHABaBk/WAJCqEGmWHABiAHY6GNKSDLnaAHKKEgHOBARiBAAgBOIIAxoFD5IEAt4AfvoI33oIBBIBEMoEAJYE3q4KLFIE3fYEvroALx4EADYAD8YIDboIAXQFcggANgVH9gDfGgQF/hRk/ghyqgDWFAhA3gi0NhwARggBWggANgQdeg4kngTlhhBrqgn4/ggFjgBCcghjugQMTgn/Tg35DgQGEggJ8gRB6gYGUggSbAiwigjMagnvKgRyjgi+MgQJjgQEkgQDZhAAlgi3XggPbAWyDAEOAABeAY6iBAdiAAWQBBIKY/IAAkYEuKIE0KIEASIEDw4FFAIQBIAGwgARGAUGDg9SCCUGBAHCCALCAAEKBAAcCtC2BQI2CErcBtIMAGYEwFoQBe4ADUYNBOIIAkAFsgSTPgQCLgglSgQChgwBBgWkGgQq/AgVJgDrTgABhggBIgQC0AVyBBT+AACMCxC2BHueCABMCxC2CDtUBBIM0JwEBgAMkgZ9RhAFCgTZXgSIAgQL+gQGtgBpkhgD0gi8LhAAlggCygQLVggmMgEILgCo5gQBfgpJ7gwCggTnLgQHphAESgomvggFZmAESgEgVhBOsAWyDA1SFARyCAYeCBo6CAnCCP+yBBYqBMs2BG1iDATaADQEBA4ICP4MBLIGUmoMAjIIAOIUBLIAAo4QAPIABToMAWJABJIQBAYAMkoAKeIQDy4IDCIUD54EBDoAy2IIDt4QCUoFG+IAD0IMhhoAQtAFFhQO0AQaAYV6ElV6CAWODgx6DAKgBOIAFMYIMfINHdoGAO4ID7IAE6gEagzHAgwGWARqCOzWAGJmBA/yDA0qBAwGCAWGBA7KBEucBQYBa0AEDgorSAUGAQkuAHV6AJIUBi4Muz4JjnwEQgAqkgy9fghfJgGs+gRqTgZSshAVsgjkFgBo7hQJxgBT5ggN/gi+VgAAYgAANgUSGgQQ2ggANhAPVgRptg4FPggBdgWVqgwAcgjVdggAWgACQBBALC4SBHe6BADKAZCeCBEiBJ6WCBAOCA0SCXCyCANGBAiuHHWiAOaYBGIEyp4M4rIIAcwEwgh73gUB/hBGLhQAThDpohABGgACkhAf2gAS4gAANgSI8BQuECQEPgQd3gSDogRk+gR2ugiSDhwByA3RBhYJaSAEAgTcpggARgAKzAoYCgjy1gzCEgzmvgTU8hABuAVSDAriDAoyABwSCAe8BSIEABQNYdHOAgKOBS3qAAA2EAq4BNIAfAoMWcIBQpYMU04EHUIAJTIIDR4IStYQBlQEsgAB5gUUWAgNrgQdtggQrAhA6gjXFggD7gjU7ggT1g1N4ggA0gDTFgwNagTR/gQARgTTFggMWgAAFAXCABQSGCQ6SACqBjzybACKCNd2CBnaBhJqGNd2AEVyBNd2EFZ+DJUqBb16BUiSBXVmBDn+EEKyBRMCAF8QCkCOBCDCCDVyKADaCAHsBdIIA34EE34ABP4IADQKkLYEUSIEAlYFFVoABgIMD3QKAAYUeEoIV04AN6wFgggGIgRz7ggEkAUiDB7EBbIMEXwE0gBfTgQGMgCyFgQGCg0X7AVSATfeBAa6BLTmBAEmCAPaEBdeBFIqECR8DEHRzgE6AgXH3AUiCbhYBDIMByoAlXoIBx4EWIYJfWYELGIMKUoUAkYIpSYI1A4QAV4AksIA4K4ILfoM2+ocEuoQAd4IEIYAAD4FUqYQCQ4MCbIFU7oMBjoECXoEAGYIATYILMoIANYEASYQ7S5YBxogaprAAH4ML3IFSwJQBvYQ3FYMA1YcBTII3FIIBy4Kb1IFEoIQGToALSoE3GYIAwAECgzcZgQQXgjcZgwBGiATxgQAHgztQgpoMgaJtgwY4gAFgAU+AR+2HOqeEAF6CaZKEAF4BAYQ6V4GXJIE6pI0AXoI6pIQAYgEbg0YtAqAtgzpRnQBPmQCtgUaZgAdfgSH2Awu+BYARsoID4IALqYAD4oMKa4Kg0IEACYI03oIEUQFqgRSLggAdASyAA5qCBJaBB1SBEaaBlb6AGIyFBa8BcIAKVoFeh4QCR4AKY4I8vYQGL4EAHAFcgwR+ArQtgj7kgQuahAh0AUSBAAUBTIEd6YMRy4FEIoEAioABCIIG6oMQ7IAADIJD/gQgCE8bhCWjgAuDhAmAgwyeghqkghjOpQA7gBe5gA3PhAhogIXWgkb8gQJEgwV5gwFiAgRqgAcmAhA3ggASggfYAXSDADCBB9GBExCABYmEAneBCG6CAP+BQoGAHleCHDuHAzqBDQ2BAzyCBA8BWIAxKIAFnIAf7YBRFoEQJoEStYAAfoKUb4NAfoEqL4AD8gEIhAAmggDogAAFgEpLiAXCggE3ASKAUjSCA/uAHNyDAwWCGs6CAWSFHIeCHayCWIOBGjMBhYEACoQCHIE/0IUJbIMJaQHEgB9TgiMLgyUbggEJgCM+gAJlgWAGAYKCOwqBpCIBAYAADIAIhYEjHICKGIVKgIEDQoEISoI4p4Gc0YIPTII8CoAAQoGlpIECroGKCIEAB4QM74AHjIAUI4UAQQEBgp+Wg4b2gQCPgA0CgABDgRRxgAkhAwurBIAflIEAGQF8gRlHgCjfgQAMAXiDAX0CjAGFDTuECuUCLGuAAuOBGcCBBUoBA4Bh7YIFgAGQgJACggDbgAGVgAxUgAA0ggWQATiAHMmBoHWBURaABZQBB4I9k4Eq9YEu9oEE04NYIoEACoIAmgE0gB2AgQGYgx0pgQrWgF3AgQv/gwAvgBnzgk6gggAyAiALggiTgQAKgVo7hAANgANKgz4KgT34gxIwiGYwhj3/gACAggAtgQV9gT3QgAANgAHRgj4FgAv0gTEugAANgDpAgAKSgTEigAANgAnHgABQgTEWgAANgD4OgASegTEKgAANgD4RgAGDgTD+gAANghRqgQVKgQc8gBAMgg9KgC6rgT4XgAeMgSC4gz4egACfhD4egRB8g4WQgF9PgQAKgkAHgB3cAQaDRdOAETUBBoOhO4JbW4Ico4AA14IU84IeS4Ja5oBt5oMCFIAC7oMn2YAC5oBKAQEggiLrAQODTo2BAPmDAXeALCiCAAqAABSBTpcBDIBNGIBf84IDCYED5gEBgQuugS53AiIJgQLOgRlLgQAEBUkbC6ALgRwpgwlzgSoZhAlzhQl1ggIFiQlzAUWDAheBCXSAQJyAAV2AQuKCBX2RCXOCAmKaCXODB/WTCXOCCWyAApWFHAOCCHEDNgJ4hAVTgGUYgAIVgSJAgABPAWCBToiFAFABgIIA74EC3YIJoYQEdIUJpAEEgAmkgwf2gEy2hibRgh5MgAulgAH9AUGAAUODADWBAGeAVAMBIIEA2YgAbIIC3AF4gqObgwjoAQWFYMiAABiJB5GCBjeBA0KAAAmFCeiDCogBZIAP7oACT5sHx4BQvccJ7YEo3LQJ7QF4gR3fggkrhAF8gD9QgAeegACMgCjkgRsVglojgQDdgwahAaSCAPoCoC2OCa6AHeWEHbKEAiOBBQyCNMyJAh6ABZiVBc+DIGSLCcqCGiOECcsBeIQJy4MCE4IJvAFohQnZgQ5zgZHUhgl5AVyBUIeGCCoBBIUIKoCjT5oI14Kk+IAACgFohQWOggX+hAT38gnUhwm4iAlVkAmzggLUlAm2hANigQoOhgiahgoohgD6AQSCobKDAVWUAC6ABJiCqZ//ASGHASGCAgjoCouGAmG4CouBBF6AjxYDAAs/gg+agQAejxcghj/GlAAfgAAcglI2AgRAgAGUAQOAAA0CgweBN1qFP2KAENOAIiWBLjyATW2Al8aCULCOdeuFDu+BFfgBQYAjsIAAMAF/gFCoAQaCpL0CAEiAP46BE52BFj+CMuiAVRiCesqCBTGBNXiBF4mCBtyAF3qCkRUCCEmBIbwCS3KAFfOAUuKCBRCBdj8ByIAJjYFUz4MAcINePYNXjIEFY4KaDQJBKoEQioABX4IWuQRC//+BgmzZAVSAAAwDgICCgFF3ATeAW8SATlOBAWaACXmCVmiCFoOBAAyBWtqBCt2DVJiBAHWBI8+CAOSAAHeBVUSEABaBT4aJABmCAseCABcBTIcAF4JCFIAAHQHEgR6TgABegFkbgDjKgAAJAZyEMQgBKIEAD4AYXoQAMIEEgIFkuIAARgGcgSwPAQKAXrGAe+eDFRQBOIJXqYAE84QACAFEgks1gpMgg0Q6gAGRAYCCZ2yAQRSAeNaCB/2BAH4BiIEjhIALRQGEgQCOgCoZgGkkggpUATaCRV2BQzUBbIAFngE2gAQbg5DfAhA0ggHdgACMgBN2incXgACngY9Wg19ShRIZg0G7gAUngRpRgQokgWVJg0G9BEE5QSqBJY+AAdSCp0+CK4mBAv6DS0qCNWeDUoqACpeAS++BAGaAE6ODCCuEQ/oGQYgRNgK4gI+lgAALgB8IgBRvgo+xgHpvAayDABWACJaAALyBABUB4IAAFQGggwAVgAijgADfgQAVAX6CeBOAKpCDAL2BAK4BLIAGIoRbhIVEKIIoEgFEgDgahDK+ghZehQuBhkQhgiqgAiA3gQbcgQCrgG1ihQAShEQ3AUiDAReAMFsCDGyAGOQClCCBCVoBNoALK4EDbwJBkIQADwGMgwAPAZKEAA8BgIMADwGWhAAPAXyBDmACC0ODGVyBWjCXGVyCDWuBOE2CGVyBAAqAATmAeSgBSYIEGgMLC+OAjWKAAhQEC6EEaYCzYAVmZmljaYCy5QEgg7TZEwAxLjMuMS4xLW1vdGxleQBpbnaAs20VZCBsaXRlcmFsL2xlbmd0aHMgc2V0hgAcBWNvZGUgiQAZD3Vua25vd24gaGVhZGVyIICz0wFniwAyAmRpgLN3AW6AtAmKABYDYml0hABHECByZXBlYXQAdG9vIG1hbnmFABcHc3ltYm9sc44AGAJvcoYAU4YAJIUAVoKz9IAAXYC0QAFrhQCmAgBigAD4gACaDGVycm9yAHN0cmVhbYQADYoA1QstLSBtaXNzaW5nIIC0pwQtb2YtggBHgAAlAmNvgLQtAmN0hQDjA2NoZYoAF4QAmI0AFwRkYXRhhgAViwELASCBANQFZmFyIGKAtJABAIUAVwJyY4EAgQVtYXRjaIYAMgF3gLT0BG93IHOBtQOGATuCAN4DdHlwhwATiwGyggDQjwB1ggAWhQGvBGNvbXCAtSQBc4C06YACDgR0aG9kgDInEwwLpQIDAAQABQAGAAcACAAJAAqAKQcNDQAPABEAEwAXABsAH4CVbhYrADMAOwBDAFMAYwBzAIMAowDDAOMAgAY4ggABAYCMAAIBgYQAAgGChAACAYOEAAIBhIQAAgGFhAACBZAASQDIghjMgK1JggCEAQeAAIABDYAAegEZgCkpATGAA4wBYYAARgHBgEjqAYGBSOyAQBYEAQYBCIApDAMQARiABbwJMAFAAWABgAHAiQB4hQBwhQBoAYaAAAIBh4AAAgGIgAACAYmAAAIBioAAAgGLgAACAYyAAAIBjYAAAgGOgAACARCAAHIBEoAAiAEIggCAAQaAAQIBBYABBAMEAAyAAJaAHJwCAA6AAKIBD4CwMwQOC7cMtQEsgBzVggABARCMAAIBEYQAAgEShAACAROEAAIBFIQAAgEVhAACARDAASyJAICFAHSFAGyBAGQBFoAAAgEXgAACARiAAAIBGYAAAgEagAACARuAAAIBHIAAAgEdgAACAUCAAAIGoAgAAKANgACIgADQAR6AAAQBD4AAVAEggAAQAiAOgwDgAR6AAASBABSBAAEBoIQAFAETgAAEAQeEABQBDIABOAGMgAAEAUyAAAQBzIAABAEsgAAEAayAAAQBbIAABAHsgAAEARyAAAQBnIAABAFcgAAEAdyAAAQBPIAABAG8gAAEAXyAAAQB/IAABAECgAAEAYKAAAQBQoAABAHCgAAEASKAAAQBooAABAFigAAEAeKAAAQBEoAABAGSgAAEAVKAAAQB0oAABAEygAAEAbKAAAQBcoAABAHygAAEAQqAAAQBioAABAFKgAAEAcqAAAQBKoAABAGqgAAEAWqAAAQB6oAABAEagAAEAZqAAAQBWoAABAHagAAEgHm4AgC6gAAEAXqAAAQB+oAABAEGgAAEAYaAAAQBRoAABAHGgAAEASaAAAQBpoAABAFmgAAEAeaAAAQBFoAABAGWgAAEAVaAAAQB1oAABAE2gAAEAbaAAAQBdoAABAH2gAAEAQ6AAAQBjoAABAFOgAAEAc6AAAQBLoAABAGugAAEAW6AAAQB7oAABAEegAAEAZ6AAAQBXoAABAHegAAEAT6AAAQBvoAABAF+gAAEAf6AAAQBAYAABAGBgAAEAUGAAAQBwYAABAEhgAAEAaGAAAQBYYAABAHhgAAEARGAAAQBkYAABAFRgAAEAdGAAAQBMYAABAGxgAAEAXGAAAQB8YAABAEJgAAEAYmAAAQBSYAABAHJgAAEASmAAAQBqYAABAFpgAAEAemAAAQBGYAABAGZgAAEAVmAAAQB2YAABAE5gAAEAbmAAAQBeYAABAH5gAAEAQWAAAQBhYAABAFFgAAEAcWAAAQBJYAABAGlgAAEAWWAAAQB5YAABAEVgAAEAZWAAAQBVYAABAHVgAAEATWAAAQBtYAABAF1gAAEAfWAAAQBDYAABAGNgAAEAU2AAAQBzYAABIARMwIArYAABAFtgAAEAe2AAAQBHYAABAGdgAAEAV2AAAQB3YAABAE9gAAEAb2AAAQBfYAABAH9gAAEAROAAMIFEwEJAJOAAAgBk4AACAFTgAAIAVOAAAgB04AACAHTgAAIATOAAAgBM4AACAGzgAAIAbOAAAgBc4AACAFzgAAIAfOAAAgB84AACAELgAAIgBDagAQCgAAEgAAIAUuAAAgBS4AACAHLgAAIAcuAAAgBK4AACAErgAAIAauAAAgBq4AACAFrgAAIAWuAAAgB64AACAHrgAAIARuAAAgBG4AACAGbgAAIAZuAAAgBW4AACAFbgAAIAduAAAgB24AACAE7gAAIATuAAAgBu4AACAG7gAAIAXuAAAgBe4AACAH7gAAIAfuAAAiBA7YBB4AACAGHgAAIAYeAAAgBR4AACAFHgAAIAceAAAgBx4AACAEngAAIASeAAAgBp4AACAGngAAIAWeAAAgBZ4AACAHngAAIAeeAAAgBF4AACAEXgAAIAZeAAAgBl4AACAFXgAAIAVeAAAgB14AACAHXgAAIATeAAAgBN4AACAG3gAAIAbeAAAgBd4AACAF3gAAIAfeAAAgB94AACAEPgAAIAQ+AAAgBj4AACAGPgAAIAU+AAAgBT4AACAHPgAAIAc+AAAgBL4AACAEvgAAIAa+AAAgBr4AACAFvgAAIAW+AAAgB74AACAHvgAAIAR+AAAgBH4AACAGfgAAIAZ+AAAgBX4AACAFfgAAIAd+AAAgB34AACAE/gAAIAT+AAAgBv4AACAG/gAAIAX+AAAgBf4AACAH/gAAIAf+AAAiBBAoBQIAABAEggAAEAWCAAAQBEIAABAFQgAAEATCAAAQBcIIFVgMHAEiAAAQBKIAABAFogAAEARiAAAQBWIAABAE4gAAEAXiAAAQBBIAABAFEgAAEASSAAAQBZIAABAEUgAAEAVSAAAQBNIAABAF0gAAEAQOAAEIBg4AABAFDgAAEAcOAAAQBI4AABAGjgAAEAWOAAAQB44AABIC+K4AAdIECxgEFgABcAQWCBUoBFIAABAEMgAAEARyAAASAvlaABEQBBYIGBAEaggXqAQWAA9QBBYADuAEFgAOcgE92gAAEARGAAAQBCYAABAEZgAAEgQACARWAAAQBDYAABAEdgAAEgL59gAKkgQZAAQWAAiyBBaYBBYABtAEFgD3fAxsLTYMfuYcABIC+rooABIEHUYkABAEEjAAEAQWKAAQEQbAcC4C9CosAS40AO4UALwEGhAAEgQWIgQAEgQEKgQAEgQGSgQAEgIS2ggAEAQuEAAQBDIQABIAF24FHeQTgHQsjhQBfhQXLAhARgAVtBgcJBgoFC4A6uAQNAg4BgAclBJQeC2mFAJCFAIiFAICFAHiBAGiBAFyBBh8BEIAABAEUgAAEARiAAAQBHIAABAEggAAEASiAAAQBMIAABAE4gAAEAUCAAAQBUIAABIEGvQFwgAAEAYCAAAQBoIAABAHAgAAEAeCAAG8DHwtyjQBvgQBrgQBngQBjgQBfgQBbgQBXgQBTgQBPgQBLgQBHgQBDgQE8AYCvAEGAUc0CC22BAMcBBIAAAgEIgAAEgQEzgQJLARCAAA6DAAyBnqyAqmuEACSBB3OBAE8BCIAACIEAGIUADIEIt4MADAEggQCUgDKEgQBrAYCBCC8BBIMADIA/SAoBABAMAEGRIQv/gCUfgMDAgIKxBQgJCQoKgEk3gAABAQ2AAAEBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),t)})}var Ra,_S,xf,W1;function NZ(e){if(Ra=e,{malloc:_S,free:xf,memory:W1}=Ra,typeof _S!="function"||typeof xf!="function"||!W1)throw Ra=_S=xf=W1=null,new Error("Invalid WASM module")}function YCe(e,t,n={}){let i=typeof n.level=="number"?n.level:-1,o=typeof n.outBuffer=="number"?n.outBuffer:64*1024,r=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){let a;if(this.out=_S(o),this.in=_S(r),this.inBufferSize=r,this._scratch=new Uint8Array(o),e?(this._process=Ra.deflate_process,this._last_consumed=Ra.deflate_last_consumed,this._end=Ra.deflate_end,this.streamHandle=Ra.deflate_new(),t==="gzip"?a=Ra.deflate_init_gzip(this.streamHandle,i):t==="deflate-raw"?a=Ra.deflate_init_raw(this.streamHandle,i):a=Ra.deflate_init(this.streamHandle,i)):t==="deflate64-raw"?(this._process=Ra.inflate9_process,this._last_consumed=Ra.inflate9_last_consumed,this._end=Ra.inflate9_end,this.streamHandle=Ra.inflate9_new(),a=Ra.inflate9_init_raw(this.streamHandle)):(this._process=Ra.inflate_process,this._last_consumed=Ra.inflate_last_consumed,this._end=Ra.inflate_end,this.streamHandle=Ra.inflate_new(),t==="deflate-raw"?a=Ra.inflate_init_raw(this.streamHandle):t==="gzip"?a=Ra.inflate_init_gzip(this.streamHandle):a=Ra.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)},transform(a,s){try{let c=a,u=new Uint8Array(W1.buffer),f=this._process,d=this._last_consumed,p=this.out,g=this._scratch,m=0;for(;m<c.length;){let A=Math.min(c.length-m,32768);(!this.in||this.inBufferSize<A)&&(this.in&&xf&&xf(this.in),this.in=_S(A),this.inBufferSize=A),u.set(c.subarray(m,m+A),this.in);let y=f(this.streamHandle,this.in,A,p,o,0),x=y&16777215;if(x&&(g.set(u.subarray(p,p+x),0),s.enqueue(g.slice(0,x))),!e){let T=y>>24&255,E=T&128?T-256:T;if(E<0)throw new Error("process error:"+E)}let b=d(this.streamHandle);if(b===0)break;m+=b}}catch(c){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&xf&&xf(this.in),this.out&&xf&&xf(this.out),s.error(c)}},flush(a){try{let s=new Uint8Array(W1.buffer),c=this._process,u=this.out,f=this._scratch;for(;;){let d=c(this.streamHandle,0,0,u,o,4),p=d&16777215,g=d>>24&255;if(!e){let m=g&128?g-256:g;if(m<0)throw new Error("process error:"+m)}if(p&&(f.set(s.subarray(u,u+p),0),a.enqueue(f.slice(0,p))),g===1||p===0)break}}catch(s){a.error(s)}finally{if(this._end&&this.streamHandle){let s=this._end(this.streamHandle);s!==0&&a.error(new Error("end error:"+s))}this.in&&xf&&xf(this.in),this.out&&xf&&xf(this.out)}}})}var q1=class{constructor(t="deflate",n){return YCe(!0,t,n)}},Y1=class{constructor(t="deflate",n){return YCe(!1,t,n)}};var XCe=!1;async function KCe(e,{baseURI:t}){if(!XCe){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(r){if(e.startsWith("data:application/wasm;base64,"))n=kgt(e);else throw r}let o=await WebAssembly.instantiate(n);NZ(o.instance.exports),XCe=!0}}function kgt(e){let t=e.split(",")[1],n=atob(t),i=n.length,o=new Uint8Array(i);for(let r=0;r<i;++r)o[r]=n.charCodeAt(r);return o.buffer}var FZ;qCe(Rp);FTe({initModule:e=>{if(!FZ){let{wasmURI:t}=e;typeof t==Af&&(t=t()),FZ=KCe(t,e)}return FZ}});Rp({CompressionStreamZlib:q1,DecompressionStreamZlib:Y1});function zgt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Bn=zgt;function Ugt(e,t){this.position=e,this.headingPitchRange=t}var I8=Ugt;function D8(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new ye,this.tourEnd=new ye,this.entryStart=new ye,this.entryEnd=new ye,this._activeEntries=[]}D8.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};D8.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;$Ce.call(this,e,t,function(i){n.playlistIndex=0,i||QCe(n._activeEntries),n.tourEnd.raiseEvent(i)})};D8.prototype.stop=function(){QCe(this._activeEntries)};function QCe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function $Ce(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=Vgt.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 a=r._activeEntries.indexOf(i);a>=0&&r._activeEntries.splice(a,1)}),o(e,t,n)}}else l(n)&&n(!1)}function Vgt(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++,$Ce.call(this,e,t,n)}}var P8=D8;var Vi=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-Vi.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?Vi.Bounce.In(e*2)*.5:Vi.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}}}}),X1=function(){return performance.now()},jgt=(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 a=r[o];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},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=X1()),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]],a=!n;r&&r.update(t,a)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),AS={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=AS.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=AS.Utils.Bernstein,a=0;a<=i;a++)n+=o(1-t,i-a)*o(t,a)*e[a]*r(i,a);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=AS.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=AS.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,a=(i-t)*.5,s=o*o,c=o*s;return(2*t-2*n+r+a)*c+(-3*t+3*n-2*r-a)*s+r*o+t}}},JCe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),kZ=new jgt,ZCe=(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=Vi.Linear.None,this._interpolationFunction=AS.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=JCe.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=kZ,kZ.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=X1()),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 a in i){var s=t[a],c=Array.isArray(s),u=c?"array":typeof s,f=!c&&Array.isArray(i[a]);if(!(u==="undefined"||u==="function")){if(f){var d=i[a];if(d.length===0)continue;for(var p=[s],g=0,m=d.length;g<m;g+=1){var A=this._handleRelativeValue(s,d[g]);if(isNaN(A)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(A)}f&&(i[a]=p)}if((u==="object"||c)&&s&&!f){n[a]=c?[]:{};var y=s;for(var x in y)n[a][x]=y[x];o[a]=c?[]:{};var d=i[a];if(!this._isDynamic){var b={};for(var x in d)b[x]=d[x];i[a]=d=b}this._setupProperties(y,n[a],d,o[a],r)}else(typeof n[a]>"u"||r)&&(n[a]=s),c||(n[a]*=1),f?o[a]=i[a].slice().reverse():o[a]=n[a]||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=X1()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=X1()),!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=Vi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=AS.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=X1()),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 a=t-this._startTime,s=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*s,u=function(){if(i._duration===0||a>c)return 1;var A=Math.trunc(a/s),y=a-A*s,x=Math.min(y/i._duration,1);return x===0&&a===i._duration?1:x},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||a>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((a-this._duration)/s)+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+=s*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;g<m;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 a=n[r]||0,s=i[r],c=Array.isArray(t[r]),u=Array.isArray(s),f=!c&&u;f?t[r]=this._interpolationFunction(s,o):typeof s=="object"&&s?this._updateProperties(t[r],a,s,o):(s=this._handleRelativeValue(a,s),typeof s=="number"&&(t[r]=a+(s-a)*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 eIi=JCe.nextId,Fp=kZ,tIi=Fp.getAll.bind(Fp),nIi=Fp.removeAll.bind(Fp),iIi=Fp.add.bind(Fp),oIi=Fp.remove.bind(Fp),rIi=Fp.update.bind(Fp);var Ggt={LINEAR_NONE:Vi.Linear.None,QUADRATIC_IN:Vi.Quadratic.In,QUADRATIC_OUT:Vi.Quadratic.Out,QUADRATIC_IN_OUT:Vi.Quadratic.InOut,CUBIC_IN:Vi.Cubic.In,CUBIC_OUT:Vi.Cubic.Out,CUBIC_IN_OUT:Vi.Cubic.InOut,QUARTIC_IN:Vi.Quartic.In,QUARTIC_OUT:Vi.Quartic.Out,QUARTIC_IN_OUT:Vi.Quartic.InOut,QUINTIC_IN:Vi.Quintic.In,QUINTIC_OUT:Vi.Quintic.Out,QUINTIC_IN_OUT:Vi.Quintic.InOut,SINUSOIDAL_IN:Vi.Sinusoidal.In,SINUSOIDAL_OUT:Vi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Vi.Sinusoidal.InOut,EXPONENTIAL_IN:Vi.Exponential.In,EXPONENTIAL_OUT:Vi.Exponential.Out,EXPONENTIAL_IN_OUT:Vi.Exponential.InOut,CIRCULAR_IN:Vi.Circular.In,CIRCULAR_OUT:Vi.Circular.Out,CIRCULAR_IN_OUT:Vi.Circular.InOut,ELASTIC_IN:Vi.Elastic.In,ELASTIC_OUT:Vi.Elastic.Out,ELASTIC_IN_OUT:Vi.Elastic.InOut,BACK_IN:Vi.Back.In,BACK_OUT:Vi.Back.Out,BACK_IN_OUT:Vi.Back.InOut,BOUNCE_IN:Vi.Bounce.In,BOUNCE_OUT:Vi.Bounce.Out,BOUNCE_IN_OUT:Vi.Bounce.InOut},Oa=Object.freeze(Ggt);function R8(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}R8.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)}};R8.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};R8.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Oa.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=It(t,e)),t};var O8=R8;function zZ(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}zZ.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};zZ.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var M8=zZ;var lEe={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=Yg(t),lEe[t]}},qZ;typeof DOMParser<"u"&&(qZ=new DOMParser);var Hgt=new B4({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),XA=32,eEe=2414016,tEe=1,nEe=16093e3,iEe=.1,oEe=[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"],rEe=["http://www.google.com/kml/ext/2.2"],Wgt=["http://www.w3.org/2005/Atom"],ze={kml:oEe,gx:rEe,atom:Wgt,kmlgx:oEe.concat(rEe)},YZ={Document:yEe,Folder:u_t,Placemark:f_t,NetworkLink:x_t,GroundOverlay:__t,PhotoOverlay:TEe,ScreenOverlay:g_t,Tour:h_t};function kp(e){this._dataSource=e,this._deferred=Gu(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(kp.prototype,{dataSource:{get:function(){return this._dataSource}}});kp.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};kp.prototype.addPromise=function(e){this._promises.push(e)};kp.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};kp.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Cf._getTimestamp()),this._process(e)};kp.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Cf._getTimestamp(),e._process(!0)},0)};kp.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]};kp.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};kp.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=YZ[i.localName];if(l(o)&&(ze.kml.indexOf(i.namespaceURI)!==-1||ze.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Cf._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function qgt(e){let t=e.slice(0,Math.min(4,e.size)),n=Gu(),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 Ygt(e){let t=Gu(),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 uEe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let a in t)t.hasOwnProperty(a)&&(o=RegExp(`[< ]${a}:`),r=`xmlns:${a}=`,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[a]}"`));return l(n)&&(e=n+i),e}function fEe(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}async function Xgt(e,t){let n=await e.getData(new w1);n=uEe(n),n=fEe(n),t.kml=qZ.parseFromString(n,"application/xml")}async function UZ(e,t){let n=lEe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new v1(n));t[e.filename]=i}function bf(e,t,n,i){let o=i.keys,r=new K1.default("."),a=e.querySelectorAll(t);for(let s=0;s<a.length;s++){let c=a[s],u=c.getAttribute(n);if(l(u)){let d=new K1.default(u).absoluteTo(r).toString(),p=o.indexOf(d);if(p!==-1){let g=o[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Tf(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let a=o[r],s=a.getAttribute(n),c=XZ(s,i);l(c)&&a.setAttribute(n,c.url)}}function dEe(e,t,n){let i=ps(e,"id");i=l(i)&&i.length!==0?i:Hn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Hn(),l(n)&&(i=n+i)),o=t.add(new Yo({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new E_t),o}function Q1(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function F8(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 B8(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 a=0;a<i;a++)o[r++]=F8(n[a],t);return o}function KA(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 ps(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function ji(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let a=i[r];if(a.localName===t&&n.indexOf(a.namespaceURI)!==-1)return a}}function aEe(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let a=0;a<r;a++){let s=o[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function Xh(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let a=0;a<r;a++){let s=o[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function gi(e,t,n){let i=ji(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function On(e,t,n){let i=ji(e,t,n);if(l(i))return i.textContent.trim()}function Kh(e,t,n){let i=ji(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function XZ(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 De({url:o});else{let r=new K1.default(t.getUrlComponent()),a=new K1.default(e);o=n[a.absoluteTo(r)],l(o)&&(i=new De({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Du={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function HZ(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?(Du.maximumRed=r,Du.red=void 0):(Du.maximumRed=void 0,Du.red=0),o>0?(Du.maximumGreen=o,Du.green=void 0):(Du.maximumGreen=void 0,Du.green=0),i>0?(Du.maximumBlue=i,Du.blue=void 0):(Du.maximumBlue=void 0,Du.blue=0),Du.alpha=n,U.fromRandom(Du)):new U(r,o,i,n)}function Db(e,t,n){let i=On(e,t,n);if(l(i))return HZ(i,On(e,"colorMode",n)==="random")}function Kgt(e){let t=ji(e,"TimeStamp",ze.kmlgx),n=On(t,"when",ze.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=Q.fromIso8601(n),o=new Ia;return o.addInterval(new wn({start:i,stop:Qe.MAXIMUM_VALUE})),o}function Qgt(e){let t=ji(e,"TimeSpan",ze.kmlgx);if(!l(t))return;let n,i=ji(t,"begin",ze.kmlgx),o=l(i)?Q.fromIso8601(i.textContent):void 0,r=ji(t,"end",ze.kmlgx),a=l(r)?Q.fromIso8601(r.textContent):void 0;if(l(o)&&l(a)){if(Q.lessThan(a,o)){let s=o;o=a,a=s}n=new Ia,n.addInterval(new wn({start:o,stop:a}))}else l(o)?(n=new Ia,n.addInterval(new wn({start:o,stop:Qe.MAXIMUM_VALUE}))):l(a)&&(n=new Ia,n.addInterval(new wn({start:Qe.MINIMUM_VALUE,stop:a})));return n}function hEe(){let e=new bl;return e.width=XA,e.height=XA,e.scaleByDistance=new Ut(eEe,tEe,nEe,iEe),e.pixelOffsetScaleByDistance=new Ut(eEe,tEe,nEe,iEe),e}function KZ(){let e=new Rm;return e.outline=!0,e.outlineColor=U.WHITE,e}function mEe(){let e=new Pm;return e.translucencyByDistance=new Ut(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=Bi.LEFT,e.font="16px sans-serif",e.style=_r.FILL_AND_OUTLINE,e}function QZ(e,t,n,i,o){let r=On(e,"href",ze.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let s=r.charAt(21),c=gi(e,"x",ze.gx)??0,u=gi(e,"y",ze.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${s}/icon${f}.png`}let a=XZ(r,n,i);if(o){let s=On(e,"refreshMode",ze.kml),c=On(e,"viewRefreshMode",ze.kml);s==="onInterval"||s==="onExpire"?_t(`kml-refreshMode-${s}`,`KML - Unsupported Icon refreshMode: ${s}`):(c==="onStop"||c==="onRegion")&&_t(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=On(e,"viewBoundScale",ze.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=On(e,"viewFormat",ze.kml)??f,p=On(e,"httpQuery",ze.kml);l(d)&&a.setQueryParameters(Uf(N8(d))),l(p)&&a.setQueryParameters(Uf(N8(p)));let g=t._ellipsoid;return JZ(a,t.camera,t.canvas,u,t._lastCameraView.bbox,g),a}return a}function $gt(e,t,n,i,o){let r=gi(t,"scale",ze.kml),a=gi(t,"heading",ze.kml),s=Db(t,"color",ze.kml),c=ji(t,"Icon",ze.kml),u=QZ(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=gi(c,"x",ze.gx),d=gi(c,"y",ze.gx),p=gi(c,"w",ze.gx),g=gi(c,"h",ze.gx),m=ji(t,"hotSpot",ze.kml),A=KA(m,"x"),y=KA(m,"y"),x=ps(m,"xunits"),b=ps(m,"yunits"),T=n.billboard;l(T)||(T=hEe(),n.billboard=T),T.image=u,T.scale=r,T.color=s,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new Je(f,d,p,g)),l(a)&&a!==0&&(T.rotation=D.toRadians(-a),T.alignedAxis=h.UNIT_Z),r=r??1;let E,S;l(A)&&(x==="pixels"?E=-A*r:x==="insetPixels"?E=(A-XA)*r:x==="fraction"&&(E=-A*XA*r),E+=XA*.5*r),l(y)&&(b==="pixels"?S=y*r:b==="insetPixels"?S=(-y+XA)*r:b==="fraction"&&(S=y*XA*r),S-=XA*.5*r),(l(E)||l(S))&&(T.pixelOffset=new z(E,S))}function L8(e,t,n,i,o){for(let r=0,a=t.childNodes.length;r<a;r++){let s=t.childNodes.item(r);if(s.localName==="IconStyle")$gt(e,s,n,i,o);else if(s.localName==="LabelStyle"){let c=n.label;l(c)||(c=mEe(),n.label=c),c.scale=gi(s,"scale",ze.kml)??c.scale,c.fillColor=Db(s,"color",ze.kml)??c.fillColor,c.text=n.name}else if(s.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new El,n.polyline=c),c.width=gi(s,"width",ze.kml),c.material=Db(s,"color",ze.kml),l(Db(s,"outerColor",ze.gx))&&_t("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(gi(s,"outerWidth",ze.gx))&&_t("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(gi(s,"physicalWidth",ze.gx))&&_t("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Kh(s,"labelVisibility",ze.gx))&&_t("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(s.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=KZ(),n.polygon=c),c.material=Db(s,"color",ze.kml)??c.material,c.fill=Kh(s,"fill",ze.kml)??c.fill,c.outline=Kh(s,"outline",ze.kml)??c.outline}else if(s.localName==="BalloonStyle"){let c=HZ(On(s,"bgColor",ze.kml))??U.WHITE,u=HZ(On(s,"textColor",ze.kml))??U.BLACK,f=On(s,"text",ze.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(s.localName==="ListStyle"){let c=On(s,"listItemType",ze.kml);(c==="radioFolder"||c==="checkOffOnly")&&_t(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function Jgt(e,t,n,i,o){let r=new Yo,a,s=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(s=d)}if(s!==-1){let d=c[s];if(d.localName==="Style")L8(e,d,r,i,o);else{let p=Xh(d,"Pair",ze.kml);for(let g=0;g<p.length;g++){let m=p[g],A=On(m,"key",ze.kml);if(A==="normal"){let y=On(m,"styleUrl",ze.kml);if(l(y))a=n.getById(y),l(a)||(a=n.getById(`#${y}`)),l(a)&&r.merge(a);else{let x=ji(m,"Style",ze.kml);L8(e,x,r,i,o)}}else _t(`kml-styleMap-${A}`,`KML - Unsupported StyleMap key: ${A}`)}}}let f=On(t,"styleUrl",ze.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}a=n.getById(d),l(a)||(a=n.getById(`#${d}`)),l(a)&&r.merge(a)}return r}function Zgt(e,t,n){return t.fetchXML().then(function(i){return pEe(e,i,n,t,!0)})}function pEe(e,t,n,i,o,r){let a,s,c,u,f=aEe(t,"Style",ze.kml);if(l(f)){let A=f.length;for(a=0;a<A;a++)u=f[a],s=ps(u,"id"),l(s)&&(s=`#${s}`,o&&l(i)&&(s=i.getUrlComponent()+s),l(n.getById(s))||(c=new Yo({id:s}),n.add(c),L8(e,u,c,i,r)))}let d=aEe(t,"StyleMap",ze.kml);if(l(d)){let A=d.length;for(a=0;a<A;a++){let y=d[a];if(s=ps(y,"id"),l(s)){let x=Xh(y,"Pair",ze.kml);for(let b=0;b<x.length;b++){let T=x[b],E=On(T,"key",ze.kml);if(E==="normal"){if(s=`#${s}`,o&&l(i)&&(s=i.getUrlComponent()+s),!l(n.getById(s))){c=n.getOrCreateEntity(s);let S=On(T,"styleUrl",ze.kml);if(l(S)){S[0]!=="#"&&(S=`#${S}`),o&&l(i)&&(S=i.getUrlComponent()+S);let w=n.getById(S);l(w)&&c.merge(w)}else u=ji(T,"Style",ze.kml),L8(e,u,c,i,r)}}else _t(`kml-styleMap-${E}`,`KML - Unsupported StyleMap key: ${E}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(a=0;a<m;a++){let A=g[a].textContent;if(A[0]!=="#"){let y=A.split("#");if(y.length===2){let x=y[0],b=i.getDerivedResource({url:x});p.push(Zgt(e,b,n))}}}return p}function $Z(e,t,n){let i=new CA(e,t.id,["position"]),o=new ug(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new El,t.polyline.positions=new bA([i,o])}function gEe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?nt.CLAMP_TO_GROUND:e==="relativeToGround"?nt.RELATIVE_TO_GROUND:e==="absolute"?nt.NONE:t==="clampToSeaFloor"?(_t("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),nt.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(_t("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),nt.RELATIVE_TO_GROUND):(l(e)?_t("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):_t("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),nt.CLAMP_TO_GROUND)}function e_t(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new ug(e))}function t_t(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")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let a=e[r];i.scaleToGeodeticSurface(a,a)}return e}function k8(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():mEe(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():hEe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(U.YELLOW,64);let a=1;l(r.scale)&&(a=r.scale.getValue(),a!==0?o.pixelOffset=new z(a*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function _Ee(e,t){let n=e.path;l(n)||(n=new m_,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function n_t(e,t,n,i,o){let r=On(n,"coordinates",ze.kml),a=On(n,"altitudeMode",ze.kml),s=On(n,"altitudeMode",ze.gx),c=Kh(n,"extrude",ze.kml),u=e._ellipsoid,f=F8(r,u);return i.position=f,k8(e,i,o,gEe(a,s)),c&&Q1(a,s)&&$Z(t,i,o),!0}function sEe(e,t,n,i,o){let r=ji(n,"coordinates",ze.kml),a=On(n,"altitudeMode",ze.kml),s=On(n,"altitudeMode",ze.gx),c=Kh(n,"extrude",ze.kml),u=Kh(n,"tessellate",ze.kml),f=Q1(a,s),d=gi(n,"drawOrder",ze.gx),p=e._ellipsoid,g=B8(r,p),m=o.polyline;if(f&&c){let A=new p_;i.wall=A,A.positions=g;let y=o.polygon;l(y)&&(A.fill=y.fill,A.material=y.material),A.outline=!0,l(m)?(A.outlineColor=l(m.material)?m.material.color:U.WHITE,A.outlineWidth=m.width):l(y)&&(A.outlineColor=l(y.material)?y.material.color:U.WHITE)}else if(e._clampToGround&&!f&&u){let A=new El;A.clampToGround=!0,i.polyline=A,A.positions=g,l(m)?(A.material=l(m.material)?m.material.color.getValue(Qe.MINIMUM_VALUE):U.WHITE,A.width=m.width??1):(A.material=U.WHITE,A.width=1),A.zIndex=d}else l(d)&&_t("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&_t("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new El,i.polyline=m,m.positions=t_t(g,a,s,p),(!u||f)&&(m.arcType=rn.NONE);return!0}function i_t(e,t,n,i,o){let r=ji(n,"outerBoundaryIs",ze.kml),a=ji(r,"LinearRing",ze.kml),s=ji(a,"coordinates",ze.kml),c=e._ellipsoid,u=B8(s,c),f=Kh(n,"extrude",ze.kml),d=On(n,"altitudeMode",ze.kml),p=On(n,"altitudeMode",ze.gx),g=Q1(d,p),m=l(o.polygon)?o.polygon.clone():KZ(),A=o.polyline;if(l(A)&&(m.outlineColor=l(A.material)?A.material.color:U.WHITE,m.outlineWidth=A.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let y=new Gc(u),x=Xh(n,"innerBoundaryIs",ze.kml);for(let b=0;b<x.length;b++){a=Xh(x[b],"LinearRing",ze.kml);for(let T=0;T<a.length;T++)s=ji(a[T],"coordinates",ze.kml),u=B8(s,c),l(u)&&y.holes.push(new Gc(u))}m.hierarchy=y}return!0}function o_t(e,t,n,i,o){let r=On(n,"altitudeMode",ze.kml),a=On(n,"altitudeMode",ze.gx),s=Xh(n,"coord",ze.gx),c=Xh(n,"angles",ze.gx),u=Xh(n,"when",ze.kml),f=Kh(n,"extrude",ze.kml),d=Q1(r,a),p=e._ellipsoid;c.length>0&&_t("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(s.length,u.length),m=[],A=[];for(let x=0;x<g;x++){let b=F8(s[x].textContent,p);m.push(b),A.push(Q.fromIso8601(u[x].textContent))}let y=new Tc;return y.addSamples(A,m),i.position=y,k8(e,i,o,gEe(r,a)),_Ee(i,o),i.availability=new Ia,u.length>0&&i.availability.addInterval(new wn({start:A[0],stop:A[A.length-1]})),d&&f&&$Z(t,i,o),!0}function cEe(e,t,n,i,o,r,a,s,c){let u=e[0],f=e[e.length-1],d=new Tc;d.addSamples(e,t),n.intervals.addInterval(new wn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:e_t(d,a,s)})),i.addInterval(new wn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new wn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function r_t(e,t,n,i,o){let r=Kh(n,"interpolate",ze.gx),a=Xh(n,"Track",ze.gx),s,c,u,f=!1,d=new SA,p=new Ia,g=new bc,m=e._ellipsoid;for(let A=0,y=a.length;A<y;A++){let x=a[A],b=Xh(x,"when",ze.kml),T=Xh(x,"coord",ze.gx),E=On(x,"altitudeMode",ze.kml),S=On(x,"altitudeMode",ze.gx),w=Q1(E,S),P=Kh(x,"extrude",ze.kml),O=Math.min(T.length,b.length),B=[];s=[];for(let L=0;L<O;L++){let _=F8(T[L].textContent,m);B.push(_),s.push(Q.fromIso8601(b[L].textContent))}r&&(l(c)&&cEe([c,s[0]],[u,B[0]],g,p,d,!1,"absolute",void 0,!1),c=s[O-1],u=B[B.length-1]),cEe(s,B,g,p,d,w&&P,E,S,!0),f=f||w&&P}return i.availability=p,i.position=g,k8(e,i,o),_Ee(i,o),f&&($Z(t,i,o),i.polyline.show=d),!0}var AEe={Point:n_t,LineString:sEe,LinearRing:sEe,Polygon:i_t,Track:o_t,MultiTrack:r_t,MultiGeometry:a_t,Model:s_t};function a_t(e,t,n,i,o,r){let a=n.childNodes,s=!1;for(let c=0,u=a.length;c<u;c++){let f=a.item(c),d=AEe[f.localName];if(l(d)){let p=dEe(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,o)&&(s=!0)}}return s}function s_t(e,t,n,i,o){return _t("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function c_t(e,t){let n=ji(e,"ExtendedData",ze.kml);if(!l(n))return;l(ji(n,"SchemaData",ze.kml))&&_t("kml-schemaData","KML - SchemaData is unsupported"),l(ps(n,"xmlns:prefix"))&&_t("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Xh(n,"Data",ze.kml);if(l(o)){let r=o.length;for(let a=0;a<r;a++){let s=o[a],c=ps(s,"name");l(c)&&(i[c]={displayName:On(s,"displayName",ze.kml),value:On(s,"value",ze.kml)})}}t.kml.extendedData=i}var Do;typeof document<"u"&&(Do=document.createElement("div"));function l_t(e,t,n,i,o){let r,a,s,c=t.kml,u=c.extendedData,f=On(e,"description",ze.kml),d=t.balloonStyle??n.balloonStyle,p=U.WHITE,g=U.BLACK,m=f;l(d)&&(p=d.bgColor??U.WHITE,g=d.textColor??U.BLACK,m=d.text??f);let A;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let b=m.match(/\$\[.+?\]/g);if(b!==null)for(r=0;r<b.length;r++){let T=b[r],E=T.substr(2,T.length-3),S=/\/displayName$/.test(E);E=E.replace(/\/displayName$/,""),A=u[E],l(A)&&(A=S?A.displayName:A.value),l(A)&&(m=m.replace(T,A??""))}}}else if(l(u)&&(s=Object.keys(u),s.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<s.length;r++)a=s[r],A=u[a],m+=`<tr><th>${A.displayName??a}</th><td>${A.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=Hgt.link(m),Do.innerHTML=m;let y=Do.querySelectorAll("a");for(r=0;r<y.length;r++)y[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(bf(Do,"a","href",i),bf(Do,"link","href",i),bf(Do,"area","href",i),bf(Do,"img","src",i),bf(Do,"iframe","src",i),bf(Do,"video","src",i),bf(Do,"audio","src",i),bf(Do,"source","src",i),bf(Do,"track","src",i),bf(Do,"input","src",i),bf(Do,"embed","src",i),bf(Do,"script","src",i),bf(Do,"video","poster",i)),Tf(Do,"a","href",o),Tf(Do,"link","href",o),Tf(Do,"area","href",o),Tf(Do,"img","src",o),Tf(Do,"iframe","src",o),Tf(Do,"video","src",o),Tf(Do,"audio","src",o),Tf(Do,"source","src",o),Tf(Do,"track","src",o),Tf(Do,"input","src",o),Tf(Do,"embed","src",o),Tf(Do,"script","src",o),Tf(Do,"video","poster",o);let x='<div class="cesium-infoBox-description-lighter" style="';x+="overflow:auto;",x+="word-wrap:break-word;",x+=`background-color:${p.toCssColorString()};`,x+=`color:${g.toCssColorString()};`,x+='">',x+=`${Do.innerHTML}</div>`,Do.innerHTML="",t.description=x}function z8(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,a=n.uriResolver,s=dEe(t,i,n.context),c=s.kml,u=Jgt(e,t,n.styleCollection,r,a),f=On(t,"name",ze.kml);s.name=f,s.parent=o;let d=Qgt(t);l(d)||(d=Kgt(t)),s.availability=d,eee(s);function p(T){return T?T.show&&p(T.parent):!0}let g=Kh(t,"visibility",ze.kml);s.show=p(o)&&(g??!0);let m=ji(t,"author",ze.atom),A=c.author;A.name=On(m,"name",ze.atom),A.uri=On(m,"uri",ze.atom),A.email=On(m,"email",ze.atom);let y=ji(t,"link",ze.atom),x=c.link;x.href=ps(y,"href"),x.hreflang=ps(y,"hreflang"),x.rel=ps(y,"rel"),x.type=ps(y,"type"),x.title=ps(y,"title"),x.length=ps(y,"length"),c.address=On(t,"address",ze.kml),c.phoneNumber=On(t,"phoneNumber",ze.kml),c.snippet=On(t,"Snippet",ze.kml),c_t(t,s),l_t(t,s,u,a,r);let b=e._ellipsoid;return bEe(t,s,b),xEe(t,s,b),l(ji(t,"Region",ze.kml))&&_t("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:u}}function yEe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function u_t(e,t,n,i){let o=z8(e,t,n),r=qe(n);r.parentEntity=o.entity,yEe(e,t,r,i)}function f_t(e,t,n,i){let o=z8(e,t,n),r=o.entity,a=o.styleEntity,s=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!s;u++){let d=c.item(u),p=AEe[d.localName];l(p)&&(p(e,n.entityCollection,d,r,a,r.id),s=!0)}s||(r.merge(a),k8(e,r,a))}var d_t={FlyTo:p_t,Wait:m_t,SoundCue:VZ,AnimatedUpdate:VZ,TourControl:VZ};function h_t(e,t,n,i){let o=On(t,"name",ze.kml),r=ps(t,"id"),a=new P8(o,r),s=ji(t,"Playlist",ze.gx);if(s){let c=e._ellipsoid,u=s.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=d_t[d.localName];p?p(a,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(a)}function VZ(e,t){_t(`KML Tour unsupported node ${t.localName}`)}function m_t(e,t){let n=gi(t,"duration",ze.gx);e.addPlaylistEntry(new M8(n))}function p_t(e,t,n){let i=gi(t,"duration",ze.gx),o=On(t,"flyToMode",ze.gx),r={kml:{}};bEe(t,r,n),xEe(t,r,n);let a=r.kml.lookAt||r.kml.camera,s=new O8(i,o,a);e.addPlaylistEntry(s)}function xEe(e,t,n){let i=ji(e,"Camera",ze.kml);if(l(i)){let o=gi(i,"longitude",ze.kml)??0,r=gi(i,"latitude",ze.kml)??0,a=gi(i,"altitude",ze.kml)??0,s=gi(i,"heading",ze.kml)??0,c=gi(i,"tilt",ze.kml)??0,u=gi(i,"roll",ze.kml)??0,f=h.fromDegrees(o,r,a,n),d=kc.fromDegrees(s,c-90,u);t.kml.camera=new F4(f,d)}}function bEe(e,t,n){let i=ji(e,"LookAt",ze.kml);if(l(i)){let o=gi(i,"longitude",ze.kml)??0,r=gi(i,"latitude",ze.kml)??0,a=gi(i,"altitude",ze.kml)??0,s=gi(i,"heading",ze.kml),c=gi(i,"tilt",ze.kml),u=gi(i,"range",ze.kml)??0;c=D.toRadians(c??0),s=D.toRadians(s??0);let f=new Hh(s,c-D.PI_OVER_TWO,u),d=h.fromDegrees(o,r,a,n);t.kml.lookAt=new I8(d,f)}}function g_t(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,a=n.uriResolver,s=ji(t,"Icon",ze.kml),c=QZ(s,e,r,a,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=ji(t,"screenXY",ze.kml),p=ji(t,"overlayXY",ze.kml),g=ji(t,"size",ze.kml),m,A,y,x,b,T;l(g)&&(m=KA(g,"x"),A=KA(g,"y"),y=ps(g,"xunits"),x=ps(g,"yunits"),l(m)&&m!==-1&&m!==0&&(y==="fraction"?b=`width: ${Math.floor(m*100)}%`:y==="pixels"&&(b=`width: ${m}px`),f.push(b)),l(A)&&A!==-1&&A!==0&&(x==="fraction"?T=`height: ${Math.floor(A*100)}%`:x==="pixels"&&(T=`height: ${A}px`),f.push(T))),u.style=f.join(";");let E=0,S=u.height;l(p)&&(m=KA(p,"x"),A=KA(p,"y"),y=ps(p,"xunits"),x=ps(p,"yunits"),l(m)&&(y==="fraction"?E=m*u.width:(y==="pixels"||y==="insetPixels")&&(E=m)),l(A)&&(x==="fraction"?S=A*u.height:(x==="pixels"||x==="insetPixels")&&(S=A))),l(d)&&(m=KA(d,"x"),A=KA(d,"y"),y=ps(d,"xunits"),x=ps(d,"yunits"),l(m)&&(y==="fraction"?b=`left: calc(${Math.floor(m*100)}% - ${E}px)`:y==="pixels"?b=`left: ${m-E}px`:y==="insetPixels"&&(b=`right: ${m-E}px`),f.push(b)),l(A)&&(x==="fraction"?T=`bottom: calc(${Math.floor(A*100)}% - ${S}px)`:x==="pixels"?T=`bottom: ${A-S}px`:x==="insetPixels"&&(T=`top: ${A-S}px`),f.push(T))),u.style=f.join(";")},o.appendChild(u)}function __t(e,t,n,i){let r=z8(e,t,n).entity,a,s=!1,c=e._ellipsoid,u=B8(ji(t,"LatLonQuad",ze.gx),c),f=gi(t,"drawOrder",ze.kml);if(l(u))a=KZ(),a.hierarchy=new Gc(u),a.zIndex=f,r.polygon=a,s=!0;else{a=new Om,a.zIndex=f,r.rectangle=a;let m=ji(t,"LatLonBox",ze.kml);if(l(m)){let A=gi(m,"west",ze.kml),y=gi(m,"south",ze.kml),x=gi(m,"east",ze.kml),b=gi(m,"north",ze.kml);l(A)&&(A=D.negativePiToPi(D.toRadians(A))),l(y)&&(y=D.clampToLatitudeRange(D.toRadians(y))),l(x)&&(x=D.negativePiToPi(D.toRadians(x))),l(b)&&(b=D.clampToLatitudeRange(D.toRadians(b))),a.coordinates=new oe(A,y,x,b);let T=gi(m,"rotation",ze.kml);if(l(T)){let E=D.toRadians(T);a.rotation=E,a.stRotation=E}}}let d=ji(t,"Icon",ze.kml),p=QZ(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){s&&_t("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=gi(d,"x",ze.gx),A=gi(d,"y",ze.gx),y=gi(d,"w",ze.gx),x=gi(d,"h",ze.gx);(l(m)||l(A)||l(y)||l(x))&&_t("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),a.material=p,a.material.color=Db(t,"color",ze.kml),a.material.transparent=!0}else a.material=Db(t,"color",ze.kml);let g=On(t,"altitudeMode",ze.kml);l(g)?g==="absolute"?(a.height=gi(t,"altitude",ze.kml),a.zIndex=void 0):g!=="clampToGround"&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=On(t,"altitudeMode",ze.gx),g==="relativeToSeaFloor"?(_t("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),a.height=gi(t,"altitude",ze.kml),a.zIndex=void 0):g==="clampToSeaFloor"?_t("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function TEe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),_t(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var QA={INTERVAL:0,EXPIRE:1,STOP:2};function N8(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var A_t=new oe,yS=new de,jZ=new z,y_t=new h;function JZ(e,t,n,i,o,r){function a(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function s(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=OT(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ie.MORPHING){let u,f;if(o=o??A_t,l(n)&&(jZ.x=n.clientWidth*.5,jZ.y=n.clientHeight*.5,u=t.pickEllipsoid(jZ,r,y_t)),l(u)?f=r.cartesianToCartographic(u,yS):(f=oe.center(o,yS),u=r.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.EPSILON9)){let x=o.width*i*.5,b=o.height*i*.5;o=new oe(s(f.longitude-x),a(f.latitude-b),s(f.longitude+x),a(f.latitude+b))}c=c.replace("[bboxWest]",D.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(o.north).toString());let d=D.toDegrees(f.longitude).toString(),p=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,yS),c=c.replace("[cameraLon]",D.toDegrees(yS.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(yS.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(yS.height).toString());let g=t.frustum,m=g.aspectRatio,A="",y="";if(l(m)){let x=D.toDegrees(g.fov);m>1?(A=x,y=x/m):(y=x,A=x*m)}c=c.replace("[horizFov]",A.toString()),c=c.replace("[vertFov]",y.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(Uf(c))}function x_t(e,t,n,i){let r=z8(e,t,n).entity,a=n.sourceResource,s=n.uriResolver,c=ji(t,"Link",ze.kml);if(l(c)||(c=ji(t,"Url",ze.kml)),l(c)){let u=On(c,"href",ze.kml),f,d;if(l(u)){let p=u;if(u=XZ(u,a,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(a.getUrlComponent())||(p=a.getDerivedResource({url:p}));else{if(p=u.clone(),f=On(c,"viewRefreshMode",ze.kml),f==="onRegion"){_t("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=On(c,"viewBoundScale",ze.kml)??1;let y=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",x=On(c,"viewFormat",ze.kml)??y,b=On(c,"httpQuery",ze.kml);l(x)&&u.setQueryParameters(Uf(N8(x))),l(b)&&u.setQueryParameters(Uf(N8(b)));let T=e._ellipsoid;JZ(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:s,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new Js,A=ZZ(e,m,u,g).then(function(y){let x=e._entityCollection,b=m.values;x.suspendEvents();for(let S=0;S<b.length;S++){let w=b[S];l(w.parent)||(w.parent=r,eee(w)),x.add(w)}x.resumeEvents();let T=On(c,"refreshMode",ze.kml),E=gi(c,"refreshInterval",ze.kml)??0;if(T==="onInterval"&&E>0||T==="onExpire"||f==="onStop"){let S=ji(y,"NetworkLinkControl",ze.kml),w=l(S),P=Q.now(),O={id:Hn(),href:u,cookie:{},lastUpdated:P,updating:!1,entity:r,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:P},B=0;if(w&&(O.cookie=Uf(On(S,"cookie",ze.kml)??""),B=gi(S,"minRefreshPeriod",ze.kml)??0),T==="onInterval")w&&(E=Math.max(B,E)),O.refreshMode=QA.INTERVAL,O.time=E;else if(T==="onExpire"){let L;if(w&&(L=On(S,"expires",ze.kml)),l(L))try{let _=Q.fromIso8601(L),C=Q.secondsDifference(_,P);C>0&&C<B&&Q.addSeconds(P,B,_),O.refreshMode=QA.EXPIRE,O.time=_}catch{_t("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else _t("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(O.refreshMode=QA.STOP,O.time=gi(c,"viewRefreshTime",ze.kml)??0):_t("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(O.refreshMode)&&e._networkLinks.set(O.id,O)}}).catch(function(y){_t(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,y)});i.addPromise(A)}}}function b_t(e,t,n,i){let o=YZ[t.localName];return l(o)?o(e,t,n,i):TEe(e,t,n,i)}function WZ(e,t,n,i,o,r,a){t.removeAll();let s=n.documentElement,c=s.localName==="Document"?s:ji(s,"Document",ze.kml),u=On(c,"name",ze.kml);l(u)||(u=xA(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Cf._DeferredLoading(e),d=new Js(e);return Promise.all(pEe(e,n,d,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let A=0;A<m.length;A++){let y=m[A];if(l(YZ[y.localName])){p=y;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:o,context:a,screenOverlayContainer:r};return t.suspendEvents(),b_t(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function T_t(e,t,n,i,o){let r=Xt("ThirdParty/Workers/zip-web-worker.js"),a=Xt("ThirdParty/zip-module.wasm");Rp({workerURI:r,wasmURI:a});let s=new Sb(new Bp(n)),c=await s.getEntries(),u=[],f={},d;for(let p=0;p<c.length;p++){let g=c[p];g.directory||(/\.kml$/i.test(g.filename)&&(!l(d)||!/\//i.test(g.filename))?(l(d)&&u.push(UZ(d,f)),d=g):u.push(UZ(g,f)))}if(l(d)&&u.push(Xgt(d,f)),await Promise.all(u),s.close(),!l(f.kml))throw new re("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),WZ(e,t,f.kml,i,f,o)}function ZZ(e,t,n,i){i=i??G.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,a=i.context,s=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else o=o??De.DEFAULT.clone();return o=De.createIfNeeded(o),l(s)&&(s=Bn(s)),Promise.resolve(c).then(function(u){return u instanceof Blob?qgt(u).then(function(f){return f?T_t(e,t,u,o,s):Ygt(u).then(function(d){d=uEe(d),d=fEe(d);let p,g;try{p=qZ.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new re(m)}return WZ(e,t,p,o,r,s,a)})}):WZ(e,t,u,o,r,s,a)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function Cf(e){e=e??G.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new ye,this._error=new ye,this._loading=new ye,this._refresh=new ye,this._unsupportedNode=new ye,this._clock=void 0,this._entityCollection=new Js(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new FA,this._networkLinks=new Nt,this._entityCluster=new Ed,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():oe.clone(oe.MAX_VALUE)},this._ellipsoid=e.ellipsoid??te.default;let i=e.credit;typeof i=="string"&&(i=new xt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Cf.load=function(e,t){return t=t??G.EMPTY_OBJECT,new Cf(t).load(e,t)};Object.defineProperties(Cf.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}}});Cf.prototype.load=function(e,t){t=t??G.EMPTY_OBJECT,Da.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return ZZ(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),a=r.start,s=r.stop,c=Q.equals(a,Qe.MINIMUM_VALUE),u=Q.equals(s,Qe.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),a=Q.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),s=Q.fromDate(d)),o=new gp,o.startTime=a,o.stopTime=s,o.currentTime=Q.clone(a),o.clockRange=Pa.LOOP_STOP,o.clockStep=Bo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(s,a)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Da.setLoading(i,!1),i}).catch(function(o){return Da.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Cf.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function eee(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 C_t(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let a=!1,s=ji(r,"NetworkLinkControl",ze.kml),c=l(s),u=0;if(c){if(l(ji(s,"Update",ze.kml))){_t("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Uf(On(s,"cookie",ze.kml)??""),u=gi(s,"minRefreshPeriod",ze.kml)??0}let f=Q.now(),d=t.refreshMode;if(d===QA.INTERVAL)l(s)&&(t.time=Math.max(u,t.time));else if(d===QA.EXPIRE){let P;if(l(s)&&(P=On(s,"expires",ze.kml)),l(P))try{let O=Q.fromIso8601(P),B=Q.secondsDifference(O,f);B>0&&B<u&&Q.addSeconds(f,u,O),t.time=O}catch{_t("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),a=!0}else _t("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),a=!0}let p=t.entity,g=e._entityCollection,m=n.values;function A(P){g.remove(P);let O=P._children,B=O.length;for(let L=0;L<B;++L)A(O[L])}g.suspendEvents();let y=g.values.slice(),x;for(x=0;x<y.length;++x){let P=y[x];P.parent===p&&(P.parent=void 0,A(P))}for(g.resumeEvents(),g.suspendEvents(),x=0;x<m.length;x++){let P=m[x];l(P.parent)||(P.parent=p,eee(P)),g.add(P)}g.resumeEvents(),a?i.remove(t.id):t.lastUpdated=f;let b=g.computeAvailability(),T=b.start,E=b.stop,S=Q.equals(T,Qe.MINIMUM_VALUE),w=Q.equals(E,Qe.MAXIMUM_VALUE);if(!S||!w){let P=e._clock;(P.startTime!==T||P.stopTime!==E)&&(P.startTime=T,P.stopTime=E,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var GZ=new Nt;Cf.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=Q.now(),i=this;GZ.removeAll();function o(f){let d=f._children,p=d.length;for(let g=0;g<p;++g){let m=d[g];GZ.set(m.id,m),o(m)}}let r=!1,a=this._lastCameraView,s=this.camera;l(s)&&!(s.positionWC.equalsEpsilon(a.position,D.EPSILON7)&&s.directionWC.equalsEpsilon(a.direction,D.EPSILON7)&&s.upWC.equalsEpsilon(a.up,D.EPSILON7))&&(a.position=h.clone(s.positionWC),a.direction=h.clone(s.directionWC),a.up=h.clone(s.upWC),a.bbox=s.computeViewRectangle(),r=!0);let c=new Nt,u=!1;return t.values.forEach(function(f){let d=f.entity;if(!GZ.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===QA.INTERVAL?Q.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===QA.EXPIRE?Q.greaterThan(n,f.time)&&(p=!0):f.refreshMode===QA.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&Q.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(d),f.updating=!0;let g=new Js,m=f.href.clone();m.setQueryParameters(f.cookie);let A=i._ellipsoid??te.default;JZ(m,i.camera,i.canvas,f.viewBoundScale,a.bbox,A),ZZ(i,g,m,{context:d.id}).then(C_t(i,f,g,c,m)).catch(function(y){let x=`NetworkLink ${f.href} refresh failed: ${y}`;console.log(x),i._error.raiseEvent(i,x)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function E_t(){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}Cf._DeferredLoading=kp;Cf._getTimestamp=zi;var xS=Cf;function $1(){_e.throwInstantiationError()}$1.prototype.update=_e.throwInstantiationError;$1.prototype.getBoundingSphere=_e.throwInstantiationError;$1.prototype.isDestroyed=_e.throwInstantiationError;$1.prototype.destroy=_e.throwInstantiationError;var CEe=$1;var tee=32,v_t="http://www.opengis.net/kml/2.2",$h="http://www.google.com/kml/ext/2.2",S_t="http://www.w3.org/2000/xmlns/";function U8(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var w_t=/^data:image\/([^,;]+)/;U8.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(w_t);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 I_t(e,t){return function(n){e._files[t]=n}}U8.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new re("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 a=Promise.resolve(i[r]);this._promises.push(a),a.then(I_t(this,r))}return o};Object.defineProperties(U8.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function V8(e){this._time=e}V8.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};V8.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return Rb(n)};V8.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function nee(){this._ids={},this._styles={},this._count=0}nee.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};nee.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 SEe(){this._ids={}}SEe.prototype.get=function(e){if(!l(e))return this.get(Hn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function iee(e){e=e??G.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=iee._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,a=r.documentElement;a.setAttributeNS(S_t,"xmlns:gx",$h);let s=r.createElement("Document");a.appendChild(s),IEe(i,s,o),i.styleCache.save(s);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?D_t(f,c.files):{kml:f,externalFiles:c.files}})}async function D_t(e,t){let n=Xt("ThirdParty/Workers/zip-web-worker.js"),i=Xt("ThirdParty/zip-module.wasm");Rp({workerURI:n,wasmURI:i});let o=new uS("application/vnd.google-earth.kmz"),r=new H1(o);await r.add("doc.kml",new S1(e));let a=Object.keys(t);return await wEe(r,a,t,0),await r.close(),{kmz:await o.getData()}}async function wEe(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new Bp(n[o])),wEe(e,t,n,i+1)}iee._createState=function(e){let t=e.entities,n=new nee,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,a=e.sampleDuration??60;r.start===Qe.MINIMUM_VALUE?r.stop===Qe.MAXIMUM_VALUE?r=new wn:Q.addSeconds(r.stop,-10*a,r.start):r.stop===Qe.MAXIMUM_VALUE&&Q.addSeconds(r.start,10*a,r.stop);let s=new U8(e.modelCallback);return{kmlDoc:document.implementation.createDocument(v_t,"kml"),ellipsoid:e.ellipsoid??te.default,idManager:new SEe,styleCache:n,externalFileHandler:s,time:o,valueGetter:new V8(o),sampleDuration:a,defaultAvailability:new Ia([r])}};function IEe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,a=e.idManager,s=n.length,c,u,f;for(let d=0;d<s;++d){let p=n[d];c=[],u=[],f=[],P_t(e,p,u,f),R_t(e,p.polyline,u,f),vEe(e,p.rectangle,u,f,c),vEe(e,p.polygon,u,f,c),L_t(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),Q.equals(m.start,Qe.MINIMUM_VALUE)||g.appendChild(pn(i,"begin",Q.toIso8601(m.start))),Q.equals(m.stop,Qe.MAXIMUM_VALUE)||g.appendChild(pn(i,"end",Q.toIso8601(m.stop))));for(let x=0;x<c.length;++x){let b=c[x];b.setAttribute("id",a.get(p.id)),b.appendChild(pn(i,"name",p.name)),b.appendChild(pn(i,"visibility",p.show)),b.appendChild(pn(i,"description",p.description)),l(g)&&b.appendChild(g),t.appendChild(b)}let A=u.length;if(A>0){let x=i.createElement("Placemark");x.setAttribute("id",a.get(p.id));let b=p.name,T=p.label;if(l(T)){let S=i.createElement("LabelStyle"),w=r.get(T.text);b=l(w)&&w.length>0?w:b;let P=r.getColor(T.fillColor);l(P)&&(S.appendChild(pn(i,"color",P)),S.appendChild(pn(i,"colorMode","normal")));let O=r.get(T.scale);l(O)&&S.appendChild(pn(i,"scale",O)),f.push(S)}x.appendChild(pn(i,"name",b)),x.appendChild(pn(i,"visibility",p.show)),x.appendChild(pn(i,"description",p.description)),l(g)&&x.appendChild(g),t.appendChild(x);let E=f.length;if(E>0){let S=i.createElement("Style");for(let w=0;w<E;++w)S.appendChild(f[w]);x.appendChild(pn(i,"styleUrl",o.get(S)))}if(u.length===1)x.appendChild(u[0]);else if(u.length>1){let S=i.createElement("MultiGeometry");for(let w=0;w<A;++w)S.appendChild(u[w]);x.appendChild(S)}}let y=p._children;if(y.length>0){let x=i.createElement("Folder");x.setAttribute("id",a.get(p.id)),x.appendChild(pn(i,"name",p.name)),x.appendChild(pn(i,"visibility",p.show)),x.appendChild(pn(i,"description",p.description)),t.appendChild(x),IEe(e,x,y)}}}var Pu=new h,jl=new de,Qh=new Q;function P_t(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,a=e.valueGetter,s=t.billboard??t.point;if(!l(s)&&!l(t.path))return;let c=t.position;if(!c.isConstant){DEe(e,t,s,n,i);return}a.get(c,void 0,Pu);let u=pn(o,"coordinates",Pb(Pu,r)),f=o.createElement("Point"),d=o.createElement("altitudeMode");d.appendChild(Ob(e,s.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=s instanceof bl?REe(e,s):PEe(e,s);i.push(p)}function DEe(e,t,n,i,o){let r=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter,c,u=t.position,f=!0;u instanceof bc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof h_,p,g,m,A=[];for(p=0;p<c.length;++p){let x=c.get(p),b=f?u:x.data,T=r.createElement("altitudeMode");b instanceof ug?(b=b._value,T.appendChild(Ob(e,nt.CLAMP_TO_GROUND))):l(n)?T.appendChild(Ob(e,n.heightReference)):T.appendChild(Ob(e,nt.NONE));let E=[],S=[];if(b.isConstant){s.get(b,void 0,Pu);let P=pn(r,"coordinates",Pb(Pu,a));E.push(Q.toIso8601(x.start)),S.push(P),E.push(Q.toIso8601(x.stop)),S.push(P)}else if(b instanceof Tc)for(m=b._property._times,g=0;g<m.length;++g)E.push(Q.toIso8601(m[g])),b.getValueInReferenceFrame(m[g],Ni.FIXED,Pu),S.push(Pb(Pu,a));else if(b instanceof wd){m=b._times;let P=b._values;for(g=0;g<m.length;++g)E.push(Q.toIso8601(m[g])),h.fromArray(P,g*3,Pu),S.push(Pb(Pu,a))}else{let P=e.sampleDuration;x.start.clone(Qh),x.isStartIncluded||Q.addSeconds(Qh,P,Qh);let O=x.stop;for(;Q.lessThan(Qh,O);)b.getValue(Qh,Pu),E.push(Q.toIso8601(Qh)),S.push(Pb(Pu,a)),Q.addSeconds(Qh,P,Qh);x.isStopIncluded&&Q.equals(Qh,O)&&(b.getValue(Qh,Pu),E.push(Q.toIso8601(Qh)),S.push(Pb(Pu,a)))}let w=r.createElementNS($h,"Track");w.appendChild(T);for(let P=0;P<E.length;++P){let O=pn(r,"when",E[P]),B=pn(r,"coord",S[P],$h);w.appendChild(O),w.appendChild(B)}d&&w.appendChild(OEe(e,n)),A.push(w)}if(A.length===1)i.push(A[0]);else if(A.length>1){let x=r.createElementNS($h,"MultiTrack");for(p=0;p<A.length;++p)x.appendChild(A[p]);i.push(x)}if(l(n)&&!d){let x=n instanceof bl?REe(e,n):PEe(e,n);o.push(x)}let y=t.path;if(l(y)){let x=s.get(y.width),b=y.material;if(l(b)||l(x)){let T=r.createElement("LineStyle");l(x)&&T.appendChild(pn(r,"width",x)),oee(e,b,T),o.push(T)}}}function PEe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(pn(n,"color",r)),o.appendChild(pn(n,"colorMode","normal")));let a=i.get(t.pixelSize);return l(a)&&o.appendChild(pn(n,"scale",a/tee)),o}function REe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),a=i.get(t.image);if(l(a)){a=o.texture(a);let p=n.createElement("Icon");p.appendChild(pn(n,"href",a));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(pn(n,"x",g.x,$h)),p.appendChild(pn(n,"y",g.y,$h)),p.appendChild(pn(n,"w",g.width,$h)),p.appendChild(pn(n,"h",g.height,$h))),r.appendChild(p)}let s=i.getColor(t.color);l(s)&&(r.appendChild(pn(n,"color",s)),r.appendChild(pn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(pn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,z.divideByScalar(u,c,u);let p=i.get(t.width,tee),g=i.get(t.height,tee),m=i.get(t.horizontalOrigin,Bi.CENTER);m===Bi.CENTER?u.x-=p*.5:m===Bi.RIGHT&&(u.x-=p);let A=i.get(t.verticalOrigin,zn.CENTER);A===zn.TOP?u.y+=g:A===zn.CENTER&&(u.y+=g*.5);let y=n.createElement("hotSpot");y.setAttribute("x",-u.x),y.setAttribute("y",u.y),y.setAttribute("xunits","pixels"),y.setAttribute("yunits","pixels"),r.appendChild(y)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=D.toDegrees(-f),f===0&&(f=360),r.appendChild(pn(n,"heading",f))),r}function R_t(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,a=e.valueGetter;if(!l(t))return;let s=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=a.get(t.clampToGround,!1),f;u?(s.appendChild(pn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),s.appendChild(c);let d=t.positions,p=a.get(d),g=pn(o,"coordinates",Pb(p,r));s.appendChild(g);let m=a.get(t.zIndex);u&&l(m)&&s.appendChild(pn(o,"drawOrder",m,$h)),n.push(s);let A=o.createElement("LineStyle"),y=a.get(t.width);l(y)&&A.appendChild(pn(o,"width",y)),oee(e,t.material,A),i.push(A)}function O_t(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let a=t.coordinates,s=o.get(a),c=[],u=[oe.northeast,oe.southeast,oe.southwest,oe.northwest];for(let g=0;g<4;++g)u[g](s,jl),c.push(`${D.toDegrees(jl.longitude)},${D.toDegrees(jl.latitude)},${r}`);let f=pn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function EEe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,a=[],s=t.length;for(let f=0;f<s;++f)de.fromCartesian(t[f],r,jl),a.push(`${D.toDegrees(jl.longitude)},${D.toDegrees(jl.latitude)},${i?jl.height:n}`);let c=pn(o,"coordinates",a.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function M_t(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),a=o.get(t.perPositionHeight,!1);!a&&n>0&&(r=n);let s=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(EEe(e,f,r,a)),s.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let A=i.createElement("innerBoundaryIs");A.appendChild(EEe(e,p[m].positions,r,a)),s.push(A)}}return s}function vEe(e,t,n,i,o){let r=e.kmlDoc,a=e.valueGetter;if(!l(t))return;let s=t instanceof Om;if(s&&a.getMaterialType(t.material)==="Image"){B_t(e,t,o);return}let c=r.createElement("Polygon"),u=a.get(t.extrudedHeight,0);u>0&&c.appendChild(pn(r,"extrude",!0));let f=s?O_t(e,t,u):M_t(e,t,u),d=f.length;for(let y=0;y<d;++y)c.appendChild(f[y]);let p=r.createElement("altitudeMode");p.appendChild(Ob(e,t.heightReference)),c.appendChild(p),n.push(c);let g=r.createElement("PolyStyle"),m=a.get(t.fill,!1);m&&g.appendChild(pn(r,"fill",m)),oee(e,t.material,g);let A=a.get(t.outline,!1);if(A){g.appendChild(pn(r,"outline",A));let y=r.createElement("LineStyle"),x=a.get(t.outlineWidth,1);y.appendChild(pn(r,"width",x));let b=a.getColor(t.outlineColor,U.BLACK);y.appendChild(pn(r,"color",b)),y.appendChild(pn(r,"colorMode","normal")),i.push(y)}i.push(g)}function B_t(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,a=i.createElement("GroundOverlay"),s=i.createElement("altitudeMode");s.appendChild(Ob(e,t.heightReference)),a.appendChild(s);let c=o.get(t.height);l(c)&&a.appendChild(pn(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(pn(i,"north",D.toDegrees(u.north))),f.appendChild(pn(i,"south",D.toDegrees(u.south))),f.appendChild(pn(i,"east",D.toDegrees(u.east))),f.appendChild(pn(i,"west",D.toDegrees(u.west))),a.appendChild(f);let d=o.get(t.material),p=r.texture(d.image),g=i.createElement("Icon");g.appendChild(pn(i,"href",p)),a.appendChild(g);let m=d.color;l(m)&&a.appendChild(pn(i,"color",Rb(d.color))),n.push(a)}function OEe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),a=i.get(t.scale);if(l(a)){let u=n.createElement("scale");u.appendChild(pn(n,"x",a)),u.appendChild(pn(n,"y",a)),u.appendChild(pn(n,"z",a)),r.appendChild(u)}let s=n.createElement("Link"),c=o.model(t,e.time);return s.appendChild(pn(n,"href",c)),r.appendChild(s),r}function L_t(e,t,n,i,o){let r=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){DEe(e,t,n,i,o);return}let u=OEe(e,n),f=r.createElement("altitudeMode");f.appendChild(Ob(e,n.heightReference)),u.appendChild(f),s.get(c,void 0,Pu),de.fromCartesian(Pu,a,jl);let d=r.createElement("Location");d.appendChild(pn(r,"longitude",D.toDegrees(jl.longitude))),d.appendChild(pn(r,"latitude",D.toDegrees(jl.latitude))),d.appendChild(pn(r,"altitude",jl.height)),u.appendChild(d),i.push(u)}function oee(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let a,s=o.getMaterialType(t),c,u;switch(s){case"Image":a=Rb(U.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":a=Rb(r.color);break;case"PolylineOutline":a=Rb(r.color),c=Rb(r.outlineColor),u=r.outlineWidth,n.appendChild(pn(i,"outerColor",c,$h)),n.appendChild(pn(i,"outerWidth",u,$h));break;case"Stripe":a=Rb(r.oddColor);break}l(a)&&(n.appendChild(pn(i,"color",a)),n.appendChild(pn(i,"colorMode","normal")))}function Ob(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,nt.NONE),r;switch(o){case nt.NONE:r=n.createTextNode("absolute");break;case nt.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case nt.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function Pb(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)de.fromCartesian(e[o],t,jl),i.push(`${D.toDegrees(jl.longitude)},${D.toDegrees(jl.latitude)},${jl.height}`);return i.join(" ")}function pn(e,t,n,i){n=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 Rb(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 MEe=iee;async function N_t(e,t,n,i){return l(i)||(i=!1),z_t(e,t,n,i)}function F_t(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(LEe(i)):r=o.then(LEe(i)).catch(U_t(i)),e.shift(),t.push(r),!0}function k_t(e){return new Promise(function(t){setTimeout(t,e)})}function ree(e,t,n){return e.length?F_t(e,t,n)?ree(e,t,n):k_t(100).then(()=>ree(e,t,n)):Promise.resolve()}function z_t(e,t,n,i){let o=e.tilingScheme,r,a=[],s={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!s.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};s[f]=d,a.push(d)}s[f].positions.push(n[r])}let c=[];return ree(a,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function BEe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function LEe(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 a=t[r];if(!BEe(a,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 a=t[r];BEe(a,i,n)}}):Promise.resolve()}}function U_t(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var j8=N_t;var aee=new z;async function NEe(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,a=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,aee);let p=e.loadTileDataAvailability(aee.x,aee.y,1);l(p)&&a.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(a),await Promise.all(i.map(function(c,u){if(l(c))return j8(e,u,c,n)}));let s=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&s.push(u)}return s.length>0&&await NEe(e,s,n),t}var bS=NEe;async function see(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,a=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ie.SCENE3D?r=o.cartesianToCartographic(a):r=i.unproject(a),!l(n))return r;let s=n.availability;if(!l(s)||t.mode===ie.SCENE2D)return r;let c=[oe.center(e),oe.southeast(e),oe.southwest(e),oe.northeast(e),oe.northwest(e)],u=await see._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=r;return f&&(p.height+=d),p}see._sampleTerrainMostDetailed=bS;var TS=see;var FEe={NONE:0,LERC:1};Object.freeze(FEe);var Jh=FEe;var kEe={NONE:0,BITS12:1};Object.freeze(kEe);var rc=kEe;var J1=new h,V_t=new h,Bd=new z,j_t=new R,G_t=new R,H_t=Math.pow(2,12);function Ec(e,t,n,i,o,r,a,s,c,u){let f=rc.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,m=t.maximum,A=h.subtract(m,g,V_t),y=i-n;Math.max(h.maximumComponent(A),y)<H_t-1?f=rc.BITS12:f=rc.NONE;let b=R.fromScale(A,j_t);b=R.setTranslation(b,g,b);let T=R.fromScale(h.fromElements(1/A.x,1/A.y,1/A.z,J1),G_t);T=R.multiplyByTranslation(T,h.negate(g,J1),T),p=R.clone(o,new R);let E=R.getTranslation(o,J1);E=h.subtract(E,e,J1),p=R.setTranslation(p,E,p),p=R.multiply(p,b,p),d=R.inverseTransformation(o,new R),d=R.multiply(T,d,d),o=R.multiply(o,b,new R)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r??!1,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=s??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Ec.prototype.encode=function(e,t,n,i,o,r,a,s){let c=i.x,u=i.y;if(this.quantization===rc.BITS12){n=R.multiplyByPoint(this.toScaledENU,n,J1),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=D.clamp((o-this.minimumHeight)/f,0,1);z.fromElements(n.x,n.y,Bd);let p=on.compressTextureCoordinates(Bd);z.fromElements(n.z,d,Bd);let g=on.compressTextureCoordinates(Bd);z.fromElements(c,u,Bd);let m=on.compressTextureCoordinates(Bd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){z.fromElements(a,0,Bd);let A=on.compressTextureCoordinates(Bd);e[t++]=A}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=a);return this.hasVertexNormals&&(e[t++]=on.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=s.x,e[t++]=s.y,e[t++]=s.z),t};var W_t=new h,zEe=new h;Ec.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 a=0;a<o;a++){for(let f=0;f<i;f++){let d=a*i+f,p=a*r+f;t[p]=e[d]}let s=this.decodePosition(t,a,W_t),c=n.geodeticSurfaceNormal(s,zEe),u=a*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Ec.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 a=0;a<o;a++){let s=r*n+a,c=r*o+a;t[c]=e[s]}};Ec.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===rc.BITS12){let i=on.decompressTextureCoordinates(e[t],Bd);n.x=i.x,n.y=i.y;let o=on.decompressTextureCoordinates(e[t+1],Bd);return n.z=o.x,R.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)};Ec.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 a=this.decodeGeodeticSurfaceNormal(e,t,zEe),s=this.decodeHeight(e,t),c=ho.getHeight(s,i,o)-s;n.x+=a.x*c,n.y+=a.y*c,n.z+=a.z*c}return n};Ec.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new z),t*=this.stride,this.quantization===rc.BITS12?on.decompressTextureCoordinates(e[t+2],n):z.fromElements(e[t+4],e[t+5],n)};Ec.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===rc.BITS12?on.decompressTextureCoordinates(e[t+1],Bd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Ec.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===rc.BITS12?on.decompressTextureCoordinates(e[t+3],Bd).x:e[t+6]};Ec.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 z.fromElements(o,r,n)};Ec.prototype.decodeNormal=function(e,t,n){let i=t=t*this.stride+this._offsetVertexNormal;return on.octDecodeFloat(e[i],n)};Ec.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};Ec.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===rc.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var G8={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H8={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Ec.prototype.getAttributes=function(e){let t=Y.FLOAT,n=Y.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function a(s,c){r.push({index:s,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===rc.NONE){a(G8.position3DAndHeight,4);let s=2;s+=this.hasWebMercatorT?1:0,s+=this.hasVertexNormals?1:0,a(G8.textureCoordAndEncodedNormals,s),this.hasGeodeticSurfaceNormals&&a(G8.geodeticSurfaceNormal,3)}else{let s=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;a(H8.compressed0,s?4:3),c&&a(H8.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H8.geodeticSurfaceNormal,3)}return r};Ec.prototype.getAttributeLocations=function(){return this.quantization===rc.NONE?G8:H8};Ec.clone=function(e,t){if(l(e))return l(t)||(t=new Ec),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=R.clone(e.toScaledENU),t.fromScaledENU=R.clone(e.fromScaledENU),t.matrix=R.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 yr=Ec;var zp={};zp.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var cee=new h,q_t=new R,Y_t=new h,X_t=new h;zp.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,a=D.PI_OVER_TWO,s=D.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=e.isGeographic??!0,m=e.ellipsoid??te.default,A=1/m.maximumRadius,y=oe.clone(e.nativeRectangle),x=oe.clone(e.rectangle),b,T,E,S;l(x)?(b=x.west,T=x.south,E=x.east,S=x.north):g?(b=s(y.west),T=s(y.south),E=s(y.east),S=s(y.north)):(b=y.west*A,T=a-2*o(r(-y.south*A)),E=y.east*A,S=a-2*o(r(-y.north*A)));let w=e.relativeToCenter,P=l(w);w=P?w:h.ZERO;let O=e.includeWebMercatorT??!1,B=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,C=B!==1,v=e.structure??zp.DEFAULT_STRUCTURE,I=v.heightScale??zp.DEFAULT_STRUCTURE.heightScale,M=v.heightOffset??zp.DEFAULT_STRUCTURE.heightOffset,N=v.elementsPerHeight??zp.DEFAULT_STRUCTURE.elementsPerHeight,j=v.stride??zp.DEFAULT_STRUCTURE.stride,k=v.elementMultiplier??zp.DEFAULT_STRUCTURE.elementMultiplier,V=v.isBigEndian??zp.DEFAULT_STRUCTURE.isBigEndian,F=oe.computeWidth(y),W=oe.computeHeight(y),q=F/(u-1),J=W/(f-1);g||(F*=A,W*=A);let H=m.radiiSquared,Z=H.x,K=H.y,le=H.z,me=65536,ae=-65536,be=pt.eastNorthUpToFixedFrame(w,m),ge=R.inverseTransformation(be,q_t),we,Ee;O&&(we=di.geodeticLatitudeToMercatorAngle(T),Ee=1/(di.geodeticLatitudeToMercatorAngle(S)-we));let Be=Y_t;Be.x=Number.POSITIVE_INFINITY,Be.y=Number.POSITIVE_INFINITY,Be.z=Number.POSITIVE_INFINITY;let ke=X_t;ke.x=Number.NEGATIVE_INFINITY,ke.y=Number.NEGATIVE_INFINITY,ke.z=Number.NEGATIVE_INFINITY;let Ge=Number.POSITIVE_INFINITY,rt=u*f,et=d>0?u*2+f*2:0,Pe=rt+et,Ye=new Array(Pe),ut=new Array(Pe),Ct=new Array(Pe),en=O?new Array(Pe):[],Gt=C?new Array(Pe):[],yt=0,wt=f,xn=0,at=u;p&&(--yt,++wt,--xn,++at);let st=1e-5;for(let Gn=yt;Gn<wt;++Gn){let sn=Gn;sn<0&&(sn=0),sn>=f&&(sn=f-1);let Qn=y.north-J*sn;g?Qn=s(Qn):Qn=a-2*o(r(-Qn*A));let Tr=(Qn-T)/(S-T);Tr=D.clamp(Tr,0,1);let ma=Gn===yt,Qa=Gn===wt-1;d>0&&(ma?Qn+=st*W:Qa&&(Qn-=st*W));let Ba=t(Qn),$a=n(Qn),lr=le*$a,ii;O&&(ii=(di.geodeticLatitudeToMercatorAngle(Qn)-we)*Ee);for(let Lr=xn;Lr<at;++Lr){let So=Lr;So<0&&(So=0),So>=u&&(So=u-1);let Di=sn*(u*j)+So*j,ai;if(N===1)ai=c[Di];else{ai=0;let _o;if(V)for(_o=0;_o<N;++_o)ai=ai*k+c[Di+_o];else for(_o=N-1;_o>=0;--_o)ai=ai*k+c[Di+_o]}ai=ai*I+M,ae=Math.max(ae,ai),me=Math.min(me,ai);let Oo=y.west+q*So;g?Oo=s(Oo):Oo=Oo*A;let uc=(Oo-b)/(E-b);uc=D.clamp(uc,0,1);let Jr=sn*u+So;if(d>0){let _o=Lr===xn,La=Lr===at-1,Vg=ma||Qa||_o||La;if((ma||Qa)&&(_o||La))continue;Vg&&(ai-=d,_o?(Jr=rt+(f-sn-1),Oo-=st*F):Qa?Jr=rt+f+(u-So-1):La?(Jr=rt+f+u+sn,Oo+=st*F):ma&&(Jr=rt+f+u+f+So))}let Uu=Ba*t(Oo),ks=Ba*n(Oo),Ug=Z*Uu,Go=K*ks,Qd=1/i(Ug*Uu+Go*ks+lr*$a),Nr=Ug*Qd,Pc=Go*Qd,Rc=lr*Qd,fc=new h;fc.x=Nr+Uu*ai,fc.y=Pc+ks*ai,fc.z=Rc+$a*ai,R.multiplyByPoint(ge,fc,cee),h.minimumByComponent(cee,Be,Be),h.maximumByComponent(cee,ke,ke),Ge=Math.min(Ge,ai),Ye[Jr]=fc,Ct[Jr]=new z(uc,Tr),ut[Jr]=ai,O&&(en[Jr]=ii),C&&(Gt[Jr]=m.geodeticSurfaceNormal(fc))}}let Ln=ce.fromPoints(Ye),Nn;l(x)&&(Nn=$t.fromRectangle(x,me,ae,m));let so;P&&(so=new mp(m).computeHorizonCullingPointPossiblyUnderEllipsoid(w,Ye,me));let jo=new Xf(Be,ke,w),to=new yr(w,jo,Ge,ae,be,!1,O,C,B,L),no=new Float32Array(Pe*to.stride),jn=0;for(let Gn=0;Gn<Pe;++Gn)jn=to.encode(no,jn,Ye[Gn],Ct[Gn],ut[Gn],void 0,en[Gn],Gt[Gn]);return{vertices:no,maximumHeight:ae,minimumHeight:me,encoding:to,boundingSphere3D:Ln,orientedBoundingBox:Nn,occludeePointInScaledSpace:so}};var Z1=zp;function $A(){_e.throwInstantiationError()}Object.defineProperties($A.prototype,{credits:{get:_e.throwInstantiationError},waterMask:{get:_e.throwInstantiationError}});$A.prototype.interpolateHeight=_e.throwInstantiationError;$A.prototype.isChildAvailable=_e.throwInstantiationError;$A.prototype.createMesh=_e.throwInstantiationError;$A.prototype.upsample=_e.throwInstantiationError;$A.prototype.wasCreatedByUpsampling=_e.throwInstantiationError;$A.maximumAsynchronousTasks=5;var Ef=$A;var K_t=3;function fee(e,t,n){this._vertices=e,this._indices=t,this._encoding=n,this._inverseTransform=new R,this._needsRebuild=!0,this._rootNode=new uee}var Q_t=new Wn("incrementallyBuildTerrainPicker");Object.defineProperties(fee.prototype,{needsRebuild:{get:function(){return this._needsRebuild},set:function(e){this._needsRebuild=e}}});function uee(){this.x=0,this.y=0,this.level=0,this.aabb=UEe(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}uee.prototype.addChild=function(e){let t=new uee;t.x=this.x*2+(e&1),t.y=this.y*2+(e>>1&1),t.level=this.level+1,t.aabb=UEe(t.x,t.y,t.level),this.children[e]=t};var $_t=new An,W8=[new h,new h,new h];fee.prototype.rayIntersect=function(e,t,n,i,o){this._needsRebuild&&J_t(this,t);let r=this._inverseTransform,a=$_t;a.origin=R.multiplyByPoint(r,e.origin,a.origin),a.direction=R.multiplyByPointAsVector(r,e.direction,a.direction);let s=[];return VEe(this._rootNode,a,s),iAt(this,s,e,n,i,o)};function J_t(e,t){R.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let o=0;o<n;++o)i[o]=o;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var Z_t=new h,eAt=new h;function UEe(e,t,n){let i=1/Math.pow(2,n),o=h.fromElements(e*i-.5,t*i-.5,-.5,Z_t),r=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,eAt);return Xf.fromCorners(o,r)}function tAt(e,t,n,i,o){h.pack(n[0],e,9*o),h.pack(n[1],e,9*o+3),h.pack(n[2],e,9*o+6),t[o]=i}var nAt=new ia;function VEe(e,t,n){let i=ui.rayAxisAlignedBoundingBox(t,e.aabb,nAt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new ia(i.start,i.stop)});return}for(let r=0;r<e.children.length;r++)VEe(e.children[r],t,n)}function iAt(e,t,n,i,o,r){let a=t.sort(function(c,u){return c.interval.start-u.interval.start}),s=Number.MAX_VALUE;for(let c=0;c<a.length;c++){let u=a[c],f=oAt(e,n,u.node,i,o,r);if(s=Math.min(f,s),s!==Number.MAX_VALUE)break}if(s!==Number.MAX_VALUE)return An.getPoint(n,s)}function oAt(e,t,n,i,o,r){let a=Number.MAX_VALUE,s=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=K_t)&&!n.buildingChildren,g,m;p&&(g=new Float64Array(f*9),m=new Uint32Array(f));for(let A=0;A<f;A++){let y=n.intersectingTriangles[A],x=lee(s,o,r,t,u,c[3*y],W8[0]),b=lee(s,o,r,t,u,c[3*y+1],W8[1]),T=lee(s,o,r,t,u,c[3*y+2],W8[2]),E=ui.rayTriangleParametric(t,x,b,T,i);l(E)&&E<a&&E>=0&&(a=E),p&&tAt(g,m,W8,y,A)}if(p){for(let A=0;A<4;A++)n.addChild(A);aAt(e._inverseTransform,n,m,g)}return a}var rAt=new de;function lee(e,t,n,i,o,r,a){let s=e.getExaggeratedPosition(o,r,a);if(t===ie.SCENE3D)return s;let u=n.ellipsoid.cartesianToCartographic(s,rAt);s=n.project(u,a),s=h.fromElements(s.z,s.x,s.y,a);let f=D.TWO_PI*n.ellipsoid.maximumRadius,d=Math.round((i.origin.y-s.y)/f);return s.y+=d*f,s}async function aAt(e,t,n,i){t.buildingChildren=!0;let o=new Float64Array(16);R.pack(e,o,0);let r=new Float64Array(24);for(let f=0;f<4;f++)h.pack(t.children[f].aabb.minimum,r,f*6),h.pack(t.children[f].aabb.maximum,r,f*6+3);let a={aabbs:r,inverseTransform:o,triangleIndices:n,trianglePositions:i},s=[r.buffer,o.buffer,n.buffer,i.buffer],c=Q_t.scheduleTask(a,s);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,d)=>{l(t.children[d])&&(t.children[d].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var q8=fee;function eR(e,t,n,i,o,r,a,s,c,u,f,d,p,g,m,A,y){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=a,this.rectangle=s,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=d,this.encoding=p,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=A,this.northIndicesWestToEast=y,this._transform=new R,this._lastPickSceneMode=void 0,this._terrainPicker=new q8(t,n,p)}eR.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===ie.SCENE3D?sAt(this,this._transform):mAt(this,t,this._transform))};function sAt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,o=ho.getHeight(e.minimumHeight,n,i),r=ho.getHeight(e.maximumHeight,n,i),a=$t.fromRectangle(e.rectangle,o,r,te.default,e.orientedBoundingBox);return $t.computeTransformation(a,t),R.getScale(t,dee).z<=D.EPSILON16&&(dee.z=1,R.setScale(t,dee,t)),t}var cAt=new h,lAt=new h,uAt=new de,fAt=new de,dAt=new h,hAt=new h,dee=new h;function mAt(e,t,n){let i=e.encoding.exaggeration,o=e.encoding.exaggerationRelativeHeight,r=ho.getHeight(e.minimumHeight,i,o),a=ho.getHeight(e.maximumHeight,i,o),s=t.project(de.fromRadians(e.rectangle.west,e.rectangle.south,0,uAt),cAt),c=t.project(de.fromRadians(e.rectangle.east,e.rectangle.north,0,fAt),lAt),u=a-r,f=h.fromElements(c.x-s.x,c.y-s.y,u>0?u:1,dAt),d=h.fromElements(s.x+f.x*.5,s.y+f.y*.5,r+f.z*.5,hAt);return R.fromTranslation(d,n),R.setScale(n,f,n),R.multiply(pt.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}eR.prototype.pick=function(e,t,n,i){let o=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,o};eR.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};eR.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var vc=eR;function _g(e){e=e??G.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??Jh.NONE;let t=Z1.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Jh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(_g.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var jEe="createVerticesFromHeightmap",pAt=new Wn(jEe),gAt=new Wn(jEe,Ef.maximumAsynchronousTasks);_g.prototype.createMesh=function(e){e=e??G.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),d=c.cartographicToCartesian(oe.center(f)),p=this._structure,m=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let y=(s?gAt:pAt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Hi,exaggeration:r,exaggerationRelativeHeight:a,encoding:this._encoding});if(!l(y))return;let x=this;return Promise.resolve(y).then(function(b){let T;x._skirtHeight>0?T=zo.getRegularGridAndSkirtIndicesAndEdgeIndices(b.gridWidth,b.gridHeight):T=zo.getRegularGridIndicesAndEdgeIndices(b.gridWidth,b.gridHeight);let E=b.gridWidth*b.gridHeight;return x._mesh=new vc(d,new Float32Array(b.vertices),T.indices,T.indexCountWithoutSkirts,E,b.minimumHeight,b.maximumHeight,f,ce.clone(b.boundingSphere3D),h.clone(b.occludeePointInScaledSpace),b.numberOfAttributes,$t.clone(b.orientedBoundingBox),yr.clone(b.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),x._buffer=void 0,x._mesh})};_g.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=s.cartographicToCartesian(oe.center(u)),d=this._structure,g=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(s,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let m=Z1.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:s,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Hi,exaggeration:r,exaggerationRelativeHeight:a});this._buffer=void 0;let A;this._skirtHeight>0?A=zo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):A=zo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let y=m.gridWidth*m.gridHeight;return this._mesh=new vc(f,m.vertices,A.indices,A.indexCountWithoutSkirts,y,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),this._mesh};_g.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,a=r.stride,s=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,d=r.heightScale,p=l(this._mesh),g=this._encoding===Jh.LERC;if(!p&&g)return;let A;if(p){let y=this._mesh.vertices,x=this._mesh.encoding;A=GEe(y,x,f,d,e,i,o,t,n)}else A=_At(this._buffer,s,c,a,u,e,i,o,t,n),A=A*d+f;return A};_g.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;if(!l(s))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=s.vertices,m=s.encoding,A=e.tileXYToRectangle(t,n,i),y=e.tileXYToRectangle(o,r,a),x=f.heightOffset,b=f.heightScale,T=f.elementsPerHeight,E=f.elementMultiplier,S=f.isBigEndian,w=Math.pow(E,T-1);for(let P=0;P<u;++P){let O=D.lerp(y.north,y.south,P/(u-1));for(let B=0;B<c;++B){let L=D.lerp(y.west,y.east,B/(c-1)),_=GEe(g,m,x,b,A,c,u,L,O);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,AAt(p,T,E,w,d,S,P*c+B,_)}}return Promise.resolve(new _g({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};_g.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};_g.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function _At(e,t,n,i,o,r,a,s,c,u){let f=(c-r.west)*(a-1)/(r.east-r.west),d=(u-r.south)*(s-1)/(r.north-r.south),p=f|0,g=p+1;g>=a&&(g=a-1,p=a-2);let m=d|0,A=m+1;A>=s&&(A=s-1,m=s-2);let y=f-p,x=d-m;m=s-1-m,A=s-1-A;let b=Y8(e,t,n,i,o,m*a+p),T=Y8(e,t,n,i,o,m*a+g),E=Y8(e,t,n,i,o,A*a+p),S=Y8(e,t,n,i,o,A*a+g);return HEe(y,x,b,T,E,S)}function GEe(e,t,n,i,o,r,a,s,c){let u=(s-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(a-1)/(o.north-o.south),d=u|0,p=d+1;p>=r&&(p=r-1,d=r-2);let g=f|0,m=g+1;m>=a&&(m=a-1,g=a-2);let A=u-d,y=f-g;g=a-1-g,m=a-1-m;let x=(t.decodeHeight(e,g*r+d)-n)/i,b=(t.decodeHeight(e,g*r+p)-n)/i,T=(t.decodeHeight(e,m*r+d)-n)/i,E=(t.decodeHeight(e,m*r+p)-n)/i;return HEe(A,y,x,b,T,E)}function HEe(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function Y8(e,t,n,i,o,r){r*=i;let a=0,s;if(o)for(s=0;s<t;++s)a=a*n+e[r+s];else for(s=t-1;s>=0;--s)a=a*n+e[r+s];return a}function AAt(e,t,n,i,o,r,a,s){a*=o;let c;if(r)for(c=0;c<t-1;++c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;else for(c=t-1;c>0;--c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;e[a+c]=s}var ol=_g;function CS(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Yi({ellipsoid:e.ellipsoid??te.default})),this._levelZeroMaximumGeometricError=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye}Object.defineProperties(CS.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(){}}});CS.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new ol({buffer:new Uint8Array(256),width:16,height:16}))};CS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};CS.prototype.getTileDataAvailable=function(e,t,n){};CS.prototype.loadTileDataAvailability=function(e,t,n){};var Ag=CS;var X8=`uniform vec4 u_initialColor;
  10346. #if TEXTURE_UNITS > 0
  10347. uniform sampler2D u_dayTextures[TEXTURE_UNITS];
  10348. uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];
  10349. uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];
  10350. #ifdef APPLY_ALPHA
  10351. uniform float u_dayTextureAlpha[TEXTURE_UNITS];
  10352. #endif
  10353. #ifdef APPLY_DAY_NIGHT_ALPHA
  10354. uniform float u_dayTextureNightAlpha[TEXTURE_UNITS];
  10355. uniform float u_dayTextureDayAlpha[TEXTURE_UNITS];
  10356. #endif
  10357. #ifdef APPLY_SPLIT
  10358. uniform float u_dayTextureSplit[TEXTURE_UNITS];
  10359. #endif
  10360. #ifdef APPLY_BRIGHTNESS
  10361. uniform float u_dayTextureBrightness[TEXTURE_UNITS];
  10362. #endif
  10363. #ifdef APPLY_CONTRAST
  10364. uniform float u_dayTextureContrast[TEXTURE_UNITS];
  10365. #endif
  10366. #ifdef APPLY_HUE
  10367. uniform float u_dayTextureHue[TEXTURE_UNITS];
  10368. #endif
  10369. #ifdef APPLY_SATURATION
  10370. uniform float u_dayTextureSaturation[TEXTURE_UNITS];
  10371. #endif
  10372. #ifdef APPLY_GAMMA
  10373. uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];
  10374. #endif
  10375. #ifdef APPLY_IMAGERY_CUTOUT
  10376. uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
  10377. #endif
  10378. #ifdef APPLY_COLOR_TO_ALPHA
  10379. uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
  10380. #endif
  10381. uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
  10382. #endif
  10383. #if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
  10384. uniform sampler2D u_waterMask;
  10385. uniform vec4 u_waterMaskTranslationAndScale;
  10386. uniform float u_zoomedOutOceanSpecularIntensity;
  10387. #endif
  10388. #ifdef SHOW_OCEAN_WAVES
  10389. uniform sampler2D u_oceanNormalMap;
  10390. #endif
  10391. #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
  10392. uniform vec2 u_lightingFadeDistance;
  10393. #endif
  10394. #ifdef TILE_LIMIT_RECTANGLE
  10395. uniform vec4 u_cartographicLimitRectangle;
  10396. #endif
  10397. #ifdef GROUND_ATMOSPHERE
  10398. uniform vec2 u_nightFadeDistance;
  10399. #endif
  10400. #ifdef ENABLE_CLIPPING_PLANES
  10401. uniform highp sampler2D u_clippingPlanes;
  10402. uniform mat4 u_clippingPlanesMatrix;
  10403. uniform vec4 u_clippingPlanesEdgeStyle;
  10404. #endif
  10405. #ifdef ENABLE_CLIPPING_POLYGONS
  10406. uniform highp sampler2D u_clippingDistance;
  10407. in vec2 v_clippingPosition;
  10408. flat in int v_regionIndex;
  10409. #endif
  10410. #if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
  10411. uniform float u_minimumBrightness;
  10412. #endif
  10413. // Based on colorCorrect
  10414. // The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift
  10415. // are nonzero AND when (applyFog || showGroundAtmosphere) in the tile provider
  10416. // - The tileProvider.hue/saturation/brightnessShift are just passed through
  10417. // from the Globe hue/saturation/brightness, like atmosphereBrightnessShift
  10418. // - The applyFog depends on enableFog, and some tile distance from the viewer
  10419. // - The showGroundAtmosphere is a flag that is passed through from the Globe,
  10420. // and is true by default when the ellipsoid is WGS84
  10421. #ifdef COLOR_CORRECT
  10422. uniform vec3 u_hsbShift; // Hue, saturation, brightness
  10423. #endif
  10424. // Based on highlightFillTile
  10425. // This is set for terrain tiles when they are "fill" tiles, and
  10426. // the terrainProvider.fillHighlightColor was set to a value with
  10427. // nonzero alpha
  10428. #ifdef HIGHLIGHT_FILL_TILE
  10429. uniform vec4 u_fillHighlightColor;
  10430. #endif
  10431. // Based on translucent
  10432. // This is set depending on the GlobeTranslucencyState
  10433. #ifdef TRANSLUCENT
  10434. uniform vec4 u_frontFaceAlphaByDistance;
  10435. uniform vec4 u_backFaceAlphaByDistance;
  10436. uniform vec4 u_translucencyRectangle;
  10437. #endif
  10438. // Based on showUndergroundColor
  10439. // This is set when GlobeSurfaceTileProvider.isUndergroundVisible
  10440. // returns true, AND the tileProvider.undergroundColor had a value with
  10441. // nonzero alpha, and the tileProvider.undergroundColorAlphaByDistance
  10442. // was in the right range
  10443. #ifdef UNDERGROUND_COLOR
  10444. uniform vec4 u_undergroundColor;
  10445. uniform vec4 u_undergroundColorAlphaByDistance;
  10446. #endif
  10447. // Based on enableLighting && hasVertexNormals
  10448. // The enableLighting flag is passed in directly from the Globe.
  10449. // The hasVertexNormals flag is from the tileProvider
  10450. #ifdef ENABLE_VERTEX_LIGHTING
  10451. uniform float u_lambertDiffuseMultiplier;
  10452. uniform float u_vertexShadowDarkness;
  10453. #endif
  10454. in vec3 v_positionMC;
  10455. in vec3 v_positionEC;
  10456. in vec3 v_textureCoordinates;
  10457. in vec3 v_normalMC;
  10458. in vec3 v_normalEC;
  10459. #ifdef APPLY_MATERIAL
  10460. in float v_height;
  10461. in float v_slope;
  10462. in float v_aspect;
  10463. #endif
  10464. #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
  10465. in float v_distance;
  10466. #endif
  10467. #if defined(GROUND_ATMOSPHERE) || defined(FOG)
  10468. in vec3 v_atmosphereRayleighColor;
  10469. in vec3 v_atmosphereMieColor;
  10470. in float v_atmosphereOpacity;
  10471. #endif
  10472. #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
  10473. float interpolateByDistance(vec4 nearFarScalar, float distance)
  10474. {
  10475. float startDistance = nearFarScalar.x;
  10476. float startValue = nearFarScalar.y;
  10477. float endDistance = nearFarScalar.z;
  10478. float endValue = nearFarScalar.w;
  10479. float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
  10480. return mix(startValue, endValue, t);
  10481. }
  10482. #endif
  10483. #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)
  10484. vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
  10485. {
  10486. return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
  10487. }
  10488. #endif
  10489. #ifdef TRANSLUCENT
  10490. bool inTranslucencyRectangle()
  10491. {
  10492. return
  10493. v_textureCoordinates.x > u_translucencyRectangle.x &&
  10494. v_textureCoordinates.x < u_translucencyRectangle.z &&
  10495. v_textureCoordinates.y > u_translucencyRectangle.y &&
  10496. v_textureCoordinates.y < u_translucencyRectangle.w;
  10497. }
  10498. #endif
  10499. vec4 sampleAndBlend(
  10500. vec4 previousColor,
  10501. sampler2D textureToSample,
  10502. vec2 tileTextureCoordinates,
  10503. vec4 textureCoordinateRectangle,
  10504. vec4 textureCoordinateTranslationAndScale,
  10505. float textureAlpha,
  10506. float textureNightAlpha,
  10507. float textureDayAlpha,
  10508. float textureBrightness,
  10509. float textureContrast,
  10510. float textureHue,
  10511. float textureSaturation,
  10512. float textureOneOverGamma,
  10513. float split,
  10514. vec4 colorToAlpha,
  10515. float nightBlend)
  10516. {
  10517. // This crazy step stuff sets the alpha to 0.0 if this following condition is true:
  10518. // tileTextureCoordinates.s < textureCoordinateRectangle.s ||
  10519. // tileTextureCoordinates.s > textureCoordinateRectangle.p ||
  10520. // tileTextureCoordinates.t < textureCoordinateRectangle.t ||
  10521. // tileTextureCoordinates.t > textureCoordinateRectangle.q
  10522. // In other words, the alpha is zero if the fragment is outside the rectangle
  10523. // covered by this texture. Would an actual 'if' yield better performance?
  10524. vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
  10525. textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
  10526. alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
  10527. textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
  10528. #if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
  10529. textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
  10530. #endif
  10531. vec2 translation = textureCoordinateTranslationAndScale.xy;
  10532. vec2 scale = textureCoordinateTranslationAndScale.zw;
  10533. vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
  10534. vec4 value = texture(textureToSample, textureCoordinates);
  10535. vec3 color = value.rgb;
  10536. float alpha = value.a;
  10537. #ifdef APPLY_COLOR_TO_ALPHA
  10538. vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
  10539. colorDiff.r = czm_maximumComponent(colorDiff);
  10540. alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);
  10541. #endif
  10542. #if !defined(APPLY_GAMMA)
  10543. vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
  10544. color = tempColor.rgb;
  10545. alpha = tempColor.a;
  10546. #else
  10547. color = pow(color, vec3(textureOneOverGamma));
  10548. #endif
  10549. #ifdef APPLY_SPLIT
  10550. float splitPosition = czm_splitPosition;
  10551. // Split to the left
  10552. if (split < 0.0 && gl_FragCoord.x > splitPosition) {
  10553. alpha = 0.0;
  10554. }
  10555. // Split to the right
  10556. else if (split > 0.0 && gl_FragCoord.x < splitPosition) {
  10557. alpha = 0.0;
  10558. }
  10559. #endif
  10560. #ifdef APPLY_BRIGHTNESS
  10561. color = mix(vec3(0.0), color, textureBrightness);
  10562. #endif
  10563. #ifdef APPLY_CONTRAST
  10564. color = mix(vec3(0.5), color, textureContrast);
  10565. #endif
  10566. #ifdef APPLY_HUE
  10567. color = czm_hue(color, textureHue);
  10568. #endif
  10569. #ifdef APPLY_SATURATION
  10570. color = czm_saturation(color, textureSaturation);
  10571. #endif
  10572. float sourceAlpha = alpha * textureAlpha;
  10573. float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
  10574. outAlpha += sign(outAlpha) - 1.0;
  10575. vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;
  10576. // When rendering imagery for a tile in multiple passes,
  10577. // some GPU/WebGL implementation combinations will not blend fragments in
  10578. // additional passes correctly if their computation includes an unmasked
  10579. // divide-by-zero operation,
  10580. // even if it's not in the output or if the output has alpha zero.
  10581. //
  10582. // For example, without sanitization for outAlpha,
  10583. // this renders without artifacts:
  10584. // if (outAlpha == 0.0) { outColor = vec3(0.0); }
  10585. //
  10586. // but using czm_branchFreeTernary will cause portions of the tile that are
  10587. // alpha-zero in the additional pass to render as black instead of blending
  10588. // with the previous pass:
  10589. // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);
  10590. //
  10591. // So instead, sanitize against divide-by-zero,
  10592. // store this state on the sign of outAlpha, and correct on return.
  10593. return vec4(outColor, max(outAlpha, 0.0));
  10594. }
  10595. vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);
  10596. vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);
  10597. const float fExposure = 2.0;
  10598. vec3 computeEllipsoidPosition()
  10599. {
  10600. float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);
  10601. vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
  10602. xy *= czm_viewport.zw * mpp * 0.5;
  10603. vec3 direction;
  10604. if (czm_orthographicIn3D == 1.0)
  10605. {
  10606. direction = vec3(0.0, 0.0, -1.0);
  10607. }
  10608. else
  10609. {
  10610. direction = normalize(vec3(xy, -czm_currentFrustum.x));
  10611. }
  10612. czm_ray ray = czm_ray(vec3(0.0), direction);
  10613. vec3 ellipsoid_center = czm_view[3].xyz;
  10614. czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
  10615. vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);
  10616. return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;
  10617. }
  10618. void main()
  10619. {
  10620. #ifdef TILE_LIMIT_RECTANGLE
  10621. if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
  10622. v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
  10623. {
  10624. discard;
  10625. }
  10626. #endif
  10627. #ifdef ENABLE_CLIPPING_PLANES
  10628. float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
  10629. #endif
  10630. #if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
  10631. vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates
  10632. vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordinates
  10633. #endif
  10634. #if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
  10635. float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
  10636. #else
  10637. float nightBlend = 0.0;
  10638. #endif
  10639. // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0
  10640. // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the
  10641. // fragments on the edges of tiles even though the vertex shader is outputting
  10642. // coordinates strictly in the 0-1 range.
  10643. vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);
  10644. #ifdef SHOW_TILE_BOUNDARIES
  10645. if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
  10646. v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
  10647. {
  10648. color = vec4(1.0, 0.0, 0.0, 1.0);
  10649. }
  10650. #endif
  10651. #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
  10652. float cameraDist;
  10653. if (czm_sceneMode == czm_sceneMode2D)
  10654. {
  10655. cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
  10656. }
  10657. else if (czm_sceneMode == czm_sceneModeColumbusView)
  10658. {
  10659. cameraDist = -czm_view[3].z;
  10660. }
  10661. else
  10662. {
  10663. cameraDist = length(czm_view[3]);
  10664. }
  10665. float fadeOutDist = u_lightingFadeDistance.x;
  10666. float fadeInDist = u_lightingFadeDistance.y;
  10667. if (czm_sceneMode != czm_sceneMode3D) {
  10668. vec3 radii = czm_ellipsoidRadii;
  10669. float maxRadii = max(radii.x, max(radii.y, radii.z));
  10670. fadeOutDist -= maxRadii;
  10671. fadeInDist -= maxRadii;
  10672. }
  10673. float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
  10674. #else
  10675. float fade = 0.0;
  10676. #endif
  10677. #if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
  10678. vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
  10679. vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
  10680. vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
  10681. waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;
  10682. float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;
  10683. #ifdef SHOW_REFLECTIVE_OCEAN
  10684. if (mask > 0.0)
  10685. {
  10686. mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);
  10687. vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC);
  10688. vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx);
  10689. vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));
  10690. color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);
  10691. }
  10692. #endif
  10693. #endif
  10694. #ifdef APPLY_MATERIAL
  10695. czm_materialInput materialInput;
  10696. materialInput.st = v_textureCoordinates.st;
  10697. materialInput.normalEC = normalize(v_normalEC);
  10698. materialInput.positionToEyeEC = -v_positionEC;
  10699. materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));
  10700. materialInput.slope = v_slope;
  10701. materialInput.height = v_height;
  10702. materialInput.aspect = v_aspect;
  10703. #ifdef HAS_WATER_MASK
  10704. materialInput.waterMask = mask;
  10705. #endif
  10706. czm_material material = czm_getMaterial(materialInput);
  10707. vec4 materialColor = vec4(material.diffuse, material.alpha);
  10708. color = alphaBlend(materialColor, color);
  10709. #endif
  10710. #ifdef ENABLE_VERTEX_LIGHTING
  10711. float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);
  10712. vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
  10713. #elif defined(ENABLE_DAYNIGHT_SHADING)
  10714. float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
  10715. diffuseIntensity = mix(1.0, diffuseIntensity, fade);
  10716. vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
  10717. #else
  10718. vec4 finalColor = color;
  10719. #endif
  10720. #ifdef ENABLE_CLIPPING_PLANES
  10721. vec4 clippingPlanesEdgeColor = vec4(1.0);
  10722. clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
  10723. float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;
  10724. if (clipDistance < clippingPlanesEdgeWidth)
  10725. {
  10726. finalColor = clippingPlanesEdgeColor;
  10727. }
  10728. #endif
  10729. #ifdef ENABLE_CLIPPING_POLYGONS
  10730. vec2 clippingPosition = v_clippingPosition;
  10731. int regionIndex = v_regionIndex;
  10732. clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
  10733. #endif
  10734. #ifdef HIGHLIGHT_FILL_TILE
  10735. finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);
  10736. #endif
  10737. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
  10738. vec3 atmosphereLightDirection = czm_sunDirectionWC;
  10739. #else
  10740. vec3 atmosphereLightDirection = czm_lightDirectionWC;
  10741. #endif
  10742. #if defined(GROUND_ATMOSPHERE) || defined(FOG)
  10743. if (!czm_backFacing())
  10744. {
  10745. bool dynamicLighting = false;
  10746. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
  10747. dynamicLighting = true;
  10748. #endif
  10749. vec3 rayleighColor;
  10750. vec3 mieColor;
  10751. float opacity;
  10752. vec3 positionWC;
  10753. vec3 lightDirection;
  10754. // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.
  10755. // Otherwise, the scattering is computed in the vertex shader.
  10756. #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE
  10757. positionWC = computeEllipsoidPosition();
  10758. lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
  10759. computeAtmosphereScattering(
  10760. positionWC,
  10761. lightDirection,
  10762. rayleighColor,
  10763. mieColor,
  10764. opacity
  10765. );
  10766. #else
  10767. positionWC = v_positionMC;
  10768. lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
  10769. rayleighColor = v_atmosphereRayleighColor;
  10770. mieColor = v_atmosphereMieColor;
  10771. opacity = v_atmosphereOpacity;
  10772. #endif
  10773. #ifdef COLOR_CORRECT
  10774. const bool ignoreBlackPixels = true;
  10775. rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels);
  10776. mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels);
  10777. #endif
  10778. vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
  10779. // Fog is applied to tiles selected for fog, close to the Earth.
  10780. #ifdef FOG
  10781. vec3 fogColor = groundAtmosphereColor.rgb;
  10782. // If there is lighting, apply that to the fog.
  10783. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
  10784. float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);
  10785. fogColor *= darken;
  10786. #endif
  10787. #ifndef HDR
  10788. fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
  10789. fogColor.rgb = czm_inverseGamma(fogColor.rgb);
  10790. #endif
  10791. finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, czm_fogVisualDensityScalar), finalColor.a);
  10792. #else
  10793. // Apply ground atmosphere. This happens when the camera is far away from the earth.
  10794. // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.
  10795. // This value is larger near the "circumference", as it is further away from the camera. We use it to
  10796. // brighten up that area of the ground atmosphere.
  10797. const float transmittanceModifier = 0.5;
  10798. float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);
  10799. vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;
  10800. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
  10801. float fadeInDist = u_nightFadeDistance.x;
  10802. float fadeOutDist = u_nightFadeDistance.y;
  10803. float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);
  10804. float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);
  10805. vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);
  10806. finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);
  10807. #endif
  10808. #ifndef HDR
  10809. finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);
  10810. #else
  10811. finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);
  10812. #endif
  10813. finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);
  10814. #endif
  10815. }
  10816. #endif
  10817. #ifdef UNDERGROUND_COLOR
  10818. if (czm_backFacing())
  10819. {
  10820. float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);
  10821. float distance = max(v_distance - distanceFromEllipsoid, 0.0);
  10822. float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);
  10823. vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);
  10824. finalColor = alphaBlend(undergroundColor, finalColor);
  10825. }
  10826. #endif
  10827. #ifdef TRANSLUCENT
  10828. if (inTranslucencyRectangle())
  10829. {
  10830. vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
  10831. finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
  10832. }
  10833. #endif
  10834. out_FragColor = finalColor;
  10835. }
  10836. #ifdef SHOW_REFLECTIVE_OCEAN
  10837. float waveFade(float edge0, float edge1, float x)
  10838. {
  10839. float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
  10840. return pow(1.0 - y, 5.0);
  10841. }
  10842. float linearFade(float edge0, float edge1, float x)
  10843. {
  10844. return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
  10845. }
  10846. // Based on water rendering by Jonas Wagner:
  10847. // http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
  10848. // low altitude wave settings
  10849. const float oceanFrequencyLowAltitude = 825000.0;
  10850. const float oceanAnimationSpeedLowAltitude = 0.004;
  10851. const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
  10852. const float oceanSpecularIntensity = 0.5;
  10853. // high altitude wave settings
  10854. const float oceanFrequencyHighAltitude = 125000.0;
  10855. const float oceanAnimationSpeedHighAltitude = 0.008;
  10856. const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;
  10857. vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
  10858. {
  10859. vec3 positionToEyeEC = -positionEyeCoordinates;
  10860. float positionToEyeECLength = length(positionToEyeEC);
  10861. // The double normalize below works around a bug in Firefox on Android devices.
  10862. vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));
  10863. // Fade out the waves as the camera moves far from the surface.
  10864. float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);
  10865. #ifdef SHOW_OCEAN_WAVES
  10866. // high altitude waves
  10867. float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
  10868. vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
  10869. vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);
  10870. // low altitude waves
  10871. time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
  10872. noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
  10873. vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);
  10874. // blend the 2 wave layers based on distance to surface
  10875. float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
  10876. float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
  10877. vec3 normalTangentSpace =
  10878. (highAltitudeFade * normalTangentSpaceHighAltitude) +
  10879. (lowAltitudeFade * normalTangentSpaceLowAltitude);
  10880. normalTangentSpace = normalize(normalTangentSpace);
  10881. // fade out the normal perturbation as we move farther from the water surface
  10882. normalTangentSpace.xy *= waveIntensity;
  10883. normalTangentSpace = normalize(normalTangentSpace);
  10884. #else
  10885. vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
  10886. #endif
  10887. vec3 normalEC = enuToEye * normalTangentSpace;
  10888. const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);
  10889. // Use diffuse light to highlight the waves
  10890. float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
  10891. vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);
  10892. #ifdef SHOW_OCEAN_WAVES
  10893. // Where diffuse light is low or non-existent, use wave highlights based solely on
  10894. // the wave bumpiness and no particular light direction.
  10895. float tsPerturbationRatio = normalTangentSpace.z;
  10896. vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
  10897. #else
  10898. vec3 nonDiffuseHighlight = vec3(0.0);
  10899. #endif
  10900. // Add specular highlights in 3D, and in all modes when zoomed in.
  10901. float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
  10902. float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
  10903. float specular = specularIntensity * surfaceReflectance;
  10904. #ifdef HDR
  10905. specular *= 1.4;
  10906. float e = 0.2;
  10907. float d = 3.3;
  10908. float c = 1.7;
  10909. vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
  10910. #else
  10911. vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
  10912. #endif
  10913. return vec4(color, imageryColor.a);
  10914. }
  10915. #endif // #ifdef SHOW_REFLECTIVE_OCEAN
  10916. `;var K8=`#ifdef QUANTIZATION_BITS12
  10917. in vec4 compressed0;
  10918. in float compressed1;
  10919. #else
  10920. in vec4 position3DAndHeight;
  10921. in vec4 textureCoordAndEncodedNormals;
  10922. #endif
  10923. #ifdef GEODETIC_SURFACE_NORMALS
  10924. in vec3 geodeticSurfaceNormal;
  10925. #endif
  10926. #ifdef EXAGGERATION
  10927. uniform vec2 u_verticalExaggerationAndRelativeHeight;
  10928. #endif
  10929. uniform vec3 u_center3D;
  10930. uniform mat4 u_modifiedModelView;
  10931. uniform mat4 u_modifiedModelViewProjection;
  10932. uniform vec4 u_tileRectangle;
  10933. // Uniforms for 2D Mercator projection
  10934. uniform vec2 u_southAndNorthLatitude;
  10935. uniform vec2 u_southMercatorYAndOneOverHeight;
  10936. out vec3 v_positionMC;
  10937. out vec3 v_positionEC;
  10938. out vec3 v_textureCoordinates;
  10939. out vec3 v_normalMC;
  10940. out vec3 v_normalEC;
  10941. #ifdef APPLY_MATERIAL
  10942. out float v_slope;
  10943. out float v_aspect;
  10944. out float v_height;
  10945. #endif
  10946. #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
  10947. out float v_distance;
  10948. #endif
  10949. #if defined(FOG) || defined(GROUND_ATMOSPHERE)
  10950. out vec3 v_atmosphereRayleighColor;
  10951. out vec3 v_atmosphereMieColor;
  10952. out float v_atmosphereOpacity;
  10953. #endif
  10954. #ifdef ENABLE_CLIPPING_POLYGONS
  10955. uniform highp sampler2D u_clippingExtents;
  10956. out vec2 v_clippingPosition;
  10957. flat out int v_regionIndex;
  10958. #endif
  10959. // These functions are generated at runtime.
  10960. vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
  10961. float get2DYPositionFraction(vec2 textureCoordinates);
  10962. vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)
  10963. {
  10964. return u_modifiedModelViewProjection * vec4(position, 1.0);
  10965. }
  10966. float get2DMercatorYPositionFraction(vec2 textureCoordinates)
  10967. {
  10968. // The width of a tile at level 11, in radians and assuming a single root tile, is
  10969. // 2.0 * czm_pi / pow(2.0, 11.0)
  10970. // We want to just linearly interpolate the 2D position from the texture coordinates
  10971. // when we're at this level or higher. The constant below is the expression
  10972. // above evaluated and then rounded up at the 4th significant digit.
  10973. const float maxTileWidth = 0.003068;
  10974. float positionFraction = textureCoordinates.y;
  10975. float southLatitude = u_southAndNorthLatitude.x;
  10976. float northLatitude = u_southAndNorthLatitude.y;
  10977. if (northLatitude - southLatitude > maxTileWidth)
  10978. {
  10979. float southMercatorY = u_southMercatorYAndOneOverHeight.x;
  10980. float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;
  10981. float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);
  10982. currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);
  10983. positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);
  10984. }
  10985. return positionFraction;
  10986. }
  10987. float get2DGeographicYPositionFraction(vec2 textureCoordinates)
  10988. {
  10989. return textureCoordinates.y;
  10990. }
  10991. vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)
  10992. {
  10993. float yPositionFraction = get2DYPositionFraction(textureCoordinates);
  10994. vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
  10995. return u_modifiedModelViewProjection * rtcPosition2D;
  10996. }
  10997. vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)
  10998. {
  10999. return getPositionPlanarEarth(position, 0.0, textureCoordinates);
  11000. }
  11001. vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)
  11002. {
  11003. return getPositionPlanarEarth(position, height, textureCoordinates);
  11004. }
  11005. vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)
  11006. {
  11007. // We do not do RTC while morphing, so there is potential for jitter.
  11008. // This is unlikely to be noticeable, though.
  11009. vec3 position3DWC = position + u_center3D;
  11010. float yPositionFraction = get2DYPositionFraction(textureCoordinates);
  11011. vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
  11012. vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);
  11013. vec4 morphPositionEC = czm_modelView * morphPosition;
  11014. return czm_projection * morphPositionEC;
  11015. }
  11016. #ifdef QUANTIZATION_BITS12
  11017. uniform vec2 u_minMaxHeight;
  11018. uniform mat4 u_scaleAndBias;
  11019. #endif
  11020. void main()
  11021. {
  11022. #ifdef QUANTIZATION_BITS12
  11023. vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
  11024. vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
  11025. vec3 position = vec3(xy, zh.x);
  11026. float height = zh.y;
  11027. vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);
  11028. height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
  11029. position = (u_scaleAndBias * vec4(position, 1.0)).xyz;
  11030. #if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL)
  11031. float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
  11032. float encodedNormal = compressed1;
  11033. #elif defined(INCLUDE_WEB_MERCATOR_Y)
  11034. float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
  11035. float encodedNormal = 0.0;
  11036. #elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
  11037. float webMercatorT = textureCoordinates.y;
  11038. float encodedNormal = compressed0.w;
  11039. #else
  11040. float webMercatorT = textureCoordinates.y;
  11041. float encodedNormal = 0.0;
  11042. #endif
  11043. #else
  11044. // A single float per element
  11045. vec3 position = position3DAndHeight.xyz;
  11046. float height = position3DAndHeight.w;
  11047. vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;
  11048. #if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
  11049. float webMercatorT = textureCoordAndEncodedNormals.z;
  11050. float encodedNormal = textureCoordAndEncodedNormals.w;
  11051. #elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
  11052. float webMercatorT = textureCoordinates.y;
  11053. float encodedNormal = textureCoordAndEncodedNormals.z;
  11054. #elif defined(INCLUDE_WEB_MERCATOR_Y)
  11055. float webMercatorT = textureCoordAndEncodedNormals.z;
  11056. float encodedNormal = 0.0;
  11057. #else
  11058. float webMercatorT = textureCoordinates.y;
  11059. float encodedNormal = 0.0;
  11060. #endif
  11061. #endif
  11062. vec3 position3DWC = position + u_center3D;
  11063. #ifdef GEODETIC_SURFACE_NORMALS
  11064. vec3 ellipsoidNormal = geodeticSurfaceNormal;
  11065. #else
  11066. vec3 ellipsoidNormal = normalize(position3DWC);
  11067. #endif
  11068. #if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
  11069. float exaggeration = u_verticalExaggerationAndRelativeHeight.x;
  11070. float relativeHeight = u_verticalExaggerationAndRelativeHeight.y;
  11071. float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;
  11072. // stop from going through center of earth
  11073. float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);
  11074. newHeight = max(newHeight, -minRadius);
  11075. vec3 offset = ellipsoidNormal * (newHeight - height);
  11076. position += offset;
  11077. position3DWC += offset;
  11078. height = newHeight;
  11079. #endif
  11080. gl_Position = getPosition(position, height, textureCoordinates);
  11081. v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
  11082. v_positionMC = position3DWC; // position in model coordinates
  11083. v_textureCoordinates = vec3(textureCoordinates, webMercatorT);
  11084. #if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
  11085. vec3 normalMC = czm_octDecode(encodedNormal);
  11086. #if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
  11087. vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
  11088. vec3 rejection = normalMC - projection;
  11089. normalMC = normalize(projection + rejection * exaggeration);
  11090. #endif
  11091. v_normalMC = normalMC;
  11092. v_normalEC = czm_normal3D * v_normalMC;
  11093. #endif
  11094. #ifdef ENABLE_CLIPPING_POLYGONS
  11095. vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);
  11096. sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
  11097. vec2 minDistance = vec2(czm_infinity);
  11098. v_clippingPosition = vec2(czm_infinity);
  11099. v_regionIndex = -1;
  11100. for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
  11101. vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);
  11102. vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;
  11103. vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
  11104. vec2 distance = abs(rectUv - clamped) * extents.wz;
  11105. float threshold = 0.01;
  11106. if (minDistance.x > distance.x || minDistance.y > distance.y) {
  11107. minDistance = distance;
  11108. v_clippingPosition = rectUv;
  11109. if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
  11110. v_regionIndex = regionIndex;
  11111. }
  11112. }
  11113. }
  11114. #endif
  11115. #if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))
  11116. bool dynamicLighting = false;
  11117. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
  11118. dynamicLighting = true;
  11119. #endif
  11120. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
  11121. vec3 atmosphereLightDirection = czm_sunDirectionWC;
  11122. #else
  11123. vec3 atmosphereLightDirection = czm_lightDirectionWC;
  11124. #endif
  11125. vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));
  11126. computeAtmosphereScattering(
  11127. position3DWC,
  11128. lightDirection,
  11129. v_atmosphereRayleighColor,
  11130. v_atmosphereMieColor,
  11131. v_atmosphereOpacity
  11132. );
  11133. #endif
  11134. #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
  11135. v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);
  11136. #endif
  11137. #ifdef APPLY_MATERIAL
  11138. float northPoleZ = czm_ellipsoidRadii.z;
  11139. vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);
  11140. vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));
  11141. float dotProd = abs(dot(ellipsoidNormal, v_normalMC));
  11142. v_slope = acos(dotProd);
  11143. vec3 normalRejected = ellipsoidNormal * dotProd;
  11144. vec3 normalProjected = v_normalMC - normalRejected;
  11145. vec3 aspectVector = normalize(normalProjected);
  11146. v_aspect = acos(dot(aspectVector, vectorEastMC));
  11147. float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);
  11148. v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);
  11149. v_height = height;
  11150. #endif
  11151. }
  11152. `;var tR=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
  11153. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  11154. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  11155. czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
  11156. float atmosphereInnerRadius = length(positionWC);
  11157. computeScattering(
  11158. primaryRay,
  11159. length(cameraToPositionWC),
  11160. lightDirection,
  11161. atmosphereInnerRadius,
  11162. rayleighColor,
  11163. mieColor,
  11164. opacity
  11165. );
  11166. }
  11167. `;var yAt=new z;function xAt(e,t){let n=e.unionClippingRegions,i=e.length,o=ba.useFloatTexture(t),r=ba.getTextureResolution(e,t,yAt),a=r.x,s=r.y,c=o?CAt(a,s):EAt(a,s);return c+=`
  11168. `,c+=n?bAt(i):TAt(i),c}function bAt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
  11169. {
  11170. vec4 position = czm_windowToEyeCoordinates(fragCoord);
  11171. vec3 clipNormal = vec3(0.0);
  11172. vec3 clipPosition = vec3(0.0);
  11173. float clipAmount;
  11174. float pixelWidth = czm_metersPerPixel(position);
  11175. bool breakAndDiscard = false;
  11176. for (int i = 0; i < ${e}; ++i)
  11177. {
  11178. vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
  11179. clipNormal = clippingPlane.xyz;
  11180. clipPosition = -clippingPlane.w * clipNormal;
  11181. float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
  11182. clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
  11183. if (amount <= 0.0)
  11184. {
  11185. breakAndDiscard = true;
  11186. // HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6
  11187. break;
  11188. }
  11189. }
  11190. if (breakAndDiscard) {
  11191. discard;
  11192. }
  11193. return clipAmount;
  11194. }
  11195. `}function TAt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
  11196. {
  11197. bool clipped = true;
  11198. vec4 position = czm_windowToEyeCoordinates(fragCoord);
  11199. vec3 clipNormal = vec3(0.0);
  11200. vec3 clipPosition = vec3(0.0);
  11201. float clipAmount = 0.0;
  11202. float pixelWidth = czm_metersPerPixel(position);
  11203. for (int i = 0; i < ${e}; ++i)
  11204. {
  11205. vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
  11206. clipNormal = clippingPlane.xyz;
  11207. clipPosition = -clippingPlane.w * clipNormal;
  11208. float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
  11209. clipAmount = max(amount, clipAmount);
  11210. clipped = clipped && (amount <= 0.0);
  11211. }
  11212. if (clipped)
  11213. {
  11214. discard;
  11215. }
  11216. return clipAmount;
  11217. }
  11218. `}function CAt(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)
  11219. {
  11220. int pixY = clippingPlaneNumber / ${e};
  11221. int pixX = clippingPlaneNumber - (pixY * ${e});
  11222. // Sample from center of pixel
  11223. float u = (float(pixX) + 0.5) * ${o};
  11224. float v = (float(pixY) + 0.5) * ${r};
  11225. vec4 plane = texture(packedClippingPlanes, vec2(u, v));
  11226. return czm_transformPlane(plane, transform);
  11227. }
  11228. `}function EAt(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)
  11229. {
  11230. int clippingPlaneStartIndex = clippingPlaneNumber * 2;
  11231. int pixY = clippingPlaneStartIndex / ${e};
  11232. int pixX = clippingPlaneStartIndex - (pixY * ${e});
  11233. // Sample from center of pixel
  11234. float u = (float(pixX) + 0.5) * ${o};
  11235. float v = (float(pixY) + 0.5) * ${r};
  11236. vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
  11237. vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
  11238. vec4 plane;
  11239. plane.xyz = czm_octDecode(oct, 65535.0);
  11240. plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v)));
  11241. return czm_transformPlane(plane, transform);
  11242. }
  11243. `}var ES=xAt;function vAt(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 hee(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function SAt(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 ie.SCENE3D:o=t;break;case ie.SCENE2D:case ie.COLUMBUS_VIEW:o=n;break;case ie.MORPHING:o=i;break}return o}function wAt(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
  11244. czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex);
  11245. }`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
  11246. }`}function IAt(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
  11247. return czm_unpackClippingExtents(extentsTexture, index);
  11248. }`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
  11249. return vec4();
  11250. }`}function DAt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}hee.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,a=e.applyHue,s=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,m=e.showOceanWaves,A=e.enableLighting,y=e.dynamicAtmosphereLighting,x=e.dynamicAtmosphereLightingFromSun,b=e.showGroundAtmosphere,T=e.perFragmentGroundAtmosphere,E=e.hasVertexNormals,S=e.useWebMercatorProjection,w=e.enableFog,P=e.enableClippingPlanes,O=e.clippingPlanes,B=e.enableClippingPolygons,L=e.clippingPolygons,_=e.clippedByBoundaries,C=e.hasImageryLayerCutout,v=e.colorCorrect,I=e.highlightFillTile,M=e.colorToAlpha,N=e.hasGeodeticSurfaceNormals,j=e.hasExaggeration,k=e.showUndergroundColor,V=e.translucent,F=0,W="",J=n.renderedMesh.encoding;J.quantization===rc.BITS12&&(F=1,W="QUANTIZATION_BITS12");let Z=0,K="";_&&(Z=1,K="TILE_LIMIT_RECTANGLE");let le=0,me="";C&&(le=1,me="APPLY_IMAGERY_CUTOUT");let ae=t.mode,be=((ae|o<<2|r<<3|a<<4|s<<5|c<<6|u<<7|p<<8|g<<9|m<<10|A<<11|y<<12|x<<13|b<<14|T<<15|E<<16|S<<17|w<<18|F<<19|d<<20|P<<21|B<<22|Z<<23|le<<24|v<<25|I<<26|M<<27|N<<28|j<<29|k<<30|V<<31)>>>0)+(f?4294967296:0),ge=0;l(O)&&O.length>0&&(ge=P?O.clippingPlanesState:0);let we=0;l(L)&&L.length>0&&(we=B?L.clippingPolygonsState:0);let Ee=n.surfaceShader;if(l(Ee)&&Ee.numberOfDayTextures===i&&Ee.flags===be&&Ee.material===this.material&&Ee.clippingShaderState===ge&&Ee.clippingPolygonShaderState===we)return Ee.shaderProgram;let Be=this._shadersByTexturesFlags[i];if(l(Be)||(Be=this._shadersByTexturesFlags[i]=[]),Ee=Be[be],!l(Ee)||Ee.material!==this.material||Ee.clippingShaderState!==ge||Ee.clippingPolygonShaderState!==we){let ke=this.baseVertexShaderSource.clone(),Ge=this.baseFragmentShaderSource.clone();ge!==0&&Ge.sources.unshift(ES(O,t.context)),we!==0&&(Ge.sources.unshift(wAt(t.context)),ke.sources.unshift(IAt(t.context))),ke.defines.push(W),Ge.defines.push(`TEXTURE_UNITS ${i}`,K,me),o&&Ge.defines.push("APPLY_BRIGHTNESS"),r&&Ge.defines.push("APPLY_CONTRAST"),a&&Ge.defines.push("APPLY_HUE"),s&&Ge.defines.push("APPLY_SATURATION"),c&&Ge.defines.push("APPLY_GAMMA"),u&&Ge.defines.push("APPLY_ALPHA"),f&&Ge.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&Ge.defines.push("HAS_WATER_MASK"),g&&(Ge.defines.push("SHOW_REFLECTIVE_OCEAN"),ke.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&Ge.defines.push("SHOW_OCEAN_WAVES"),M&&Ge.defines.push("APPLY_COLOR_TO_ALPHA"),k&&(ke.defines.push("UNDERGROUND_COLOR"),Ge.defines.push("UNDERGROUND_COLOR")),V&&(ke.defines.push("TRANSLUCENT"),Ge.defines.push("TRANSLUCENT")),A&&(E?(ke.defines.push("ENABLE_VERTEX_LIGHTING"),Ge.defines.push("ENABLE_VERTEX_LIGHTING")):(ke.defines.push("ENABLE_DAYNIGHT_SHADING"),Ge.defines.push("ENABLE_DAYNIGHT_SHADING"))),y&&(ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Ge.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Ge.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),b&&(ke.defines.push("GROUND_ATMOSPHERE"),Ge.defines.push("GROUND_ATMOSPHERE"),T&&(ke.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Ge.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),ke.defines.push("INCLUDE_WEB_MERCATOR_Y"),Ge.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(ke.defines.push("FOG"),Ge.defines.push("FOG")),d&&Ge.defines.push("APPLY_SPLIT"),P&&Ge.defines.push("ENABLE_CLIPPING_PLANES"),B&&(Ge.defines.push("ENABLE_CLIPPING_POLYGONS"),ke.defines.push("ENABLE_CLIPPING_POLYGONS"),L.inverse&&Ge.defines.push("CLIPPING_INVERSE"),Ge.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`),ke.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`)),v&&Ge.defines.push("COLOR_CORRECT"),I&&Ge.defines.push("HIGHLIGHT_FILL_TILE"),N&&ke.defines.push("GEODETIC_SURFACE_NORMALS"),j&&ke.defines.push("EXAGGERATION");let rt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
  11251. {
  11252. vec4 color = initialColor;
  11253. `;C&&(rt+=` vec4 cutoutAndColorResult;
  11254. bool texelUnclipped;
  11255. `);for(let Pe=0;Pe<i;++Pe)C?rt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Pe}];
  11256. texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
  11257. cutoutAndColorResult = sampleAndBlend(
  11258. `:rt+=` color = sampleAndBlend(
  11259. `,rt+=` color,
  11260. u_dayTextures[${Pe}],
  11261. u_dayTextureUseWebMercatorT[${Pe}] ? textureCoordinates.xz : textureCoordinates.xy,
  11262. u_dayTextureTexCoordsRectangle[${Pe}],
  11263. u_dayTextureTranslationAndScale[${Pe}],
  11264. ${u?`u_dayTextureAlpha[${Pe}]`:"1.0"},
  11265. ${f?`u_dayTextureNightAlpha[${Pe}]`:"1.0"},
  11266. ${f?`u_dayTextureDayAlpha[${Pe}]`:"1.0"},
  11267. ${o?`u_dayTextureBrightness[${Pe}]`:"0.0"},
  11268. ${r?`u_dayTextureContrast[${Pe}]`:"0.0"},
  11269. ${a?`u_dayTextureHue[${Pe}]`:"0.0"},
  11270. ${s?`u_dayTextureSaturation[${Pe}]`:"0.0"},
  11271. ${c?`u_dayTextureOneOverGamma[${Pe}]`:"0.0"},
  11272. ${d?`u_dayTextureSplit[${Pe}]`:"0.0"},
  11273. ${M?`u_colorsToAlpha[${Pe}]`:"vec4(0.0)"},
  11274. nightBlend);
  11275. `,C&&(rt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
  11276. `);rt+=` return color;
  11277. }`,Ge.sources.push(rt),ke.sources.push(SAt(ae)),ke.sources.push(DAt(S));let et=Qt.fromCache({context:t.context,vertexShaderSource:ke,fragmentShaderSource:Ge,attributeLocations:J.getAttributeLocations()});Ee=Be[be]=new vAt(i,be,this.material,et,ge,we)}return n.surfaceShader=Ee,Ee.shaderProgram};hee.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 fe(this)};var Q8=hee;var WEe={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(WEe);var Qr=WEe;var qEe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(qEe);var ac=qEe;var YEe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(YEe);var Po=YEe;function sr(){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=Po.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(sr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===Po.RECEIVING||e===Po.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let a=i[o];n=!l(a.loadingImagery)||a.loadingImagery.state!==Vn.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});sr.prototype.pick=function(e,t,n,i,o){if(!l(this.renderedMesh))return;let r=this.renderedMesh.pick(e,i,t,n);return h.clone(r,o)};sr.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=Po.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()};sr.prototype.freeVertexArray=function(){sr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,sr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};sr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new sr),e.state===ac.START&&(PAt(e,t,n),e.state=ac.LOADING)};sr.processStateMachine=function(e,t,n,i,o,r,a){sr.initialize(e,n,i);let s=e.data;if(e.state===ac.LOADING&&RAt(e,t,n,i,o,r),a)return;let c=e.renderable;e.renderable=l(s.vertexArray);let u=s.terrainState===Po.READY;e.upsampledFromParent=l(s.terrainData)&&s.terrainData.wasCreatedByUpsampling();let f=s.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=ac.DONE}c&&(e.renderable=!0)};sr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,a=!1,s=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){r=!1;continue}if(d.loadingImagery.state===Vn.PLACEHOLDER){let g=d.loadingImagery.imageryLayer;if(g.ready){d.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=d.processStateMachine(e,n,i);s=s&&p,a=a||p||l(d.readyImagery),r=r&&l(d.loadingImagery)&&(d.loadingImagery.state===Vn.FAILED||d.loadingImagery.state===Vn.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(a||s),s};function XEe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,a=o.encoding,s=r.length/a.stride,c=yr.clone(a);c.hasGeodeticSurfaceNormals=t,c=yr.clone(c);let u=c.stride,f=new Float32Array(s*u);t?a.addGeodeticSurfaceNormals(r,f,n):a.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(sr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=sr._createVertexArrayForMesh(i.context,o)):(sr._freeVertexArray(e.vertexArray),e.vertexArray=sr._createVertexArrayForMesh(i.context,o)),sr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}sr.prototype.addGeodeticSurfaceNormals=function(e,t){XEe(this,!0,e,t)};sr.prototype.removeGeodeticSurfaceNormals=function(e){XEe(this,!1,void 0,e)};sr.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,a=t.verticalExaggerationRelativeHeight,s=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==a;if(u||f){if(u)if(s&&!c.hasGeodeticSurfaceNormals){let p=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(p,t)}else!s&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=a,n!==void 0){n._tileToUpdateHeights.push(e);let p=e.customData;for(let g of p)g.level=-1}o.updateExaggeration(r,a)}};sr.prototype.updateSceneMode=function(e){let n=this.renderedMesh;n!==void 0&&n.updateSceneMode(e)};function PAt(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=Po.FAILED);for(let o=0,r=n.length;o<r;++o){let a=n.get(o);a.show&&a._createTileImagerySkeletons(e,t)}}function RAt(e,t,n,i,o,r){let a=e.data,s=e.parent;if(a.terrainState===Po.FAILED&&s!==void 0&&(s.data!==void 0&&s.data.terrainData!==void 0&&s.data.terrainData.canUpsample!==!1||sr.processStateMachine(s,t,n,i,o,r,!0)),a.terrainState===Po.FAILED&&OAt(a,e,t,n,e.x,e.y,e.level),a.terrainState===Po.UNLOADED&&MAt(a,n,e.x,e.y,e.level),a.terrainState===Po.RECEIVED&&LAt(a,t,n,e.x,e.y,e.level),a.terrainState===Po.TRANSFORMED&&(NAt(a,t.context,n,e.x,e.y,e.level,r),a.updateExaggeration(e,t,o)),a.terrainState>=Po.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)kAt(t.context,a);else{let u=a._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(a.waterMaskTexture=u.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,u,a.waterMaskTranslationAndScale))}}function OAt(e,t,n,i,o,r,a){let s=t.parent;if(!s){t.state=ac.FAILED;return}let c=s.data.terrainData,u=s.x,f=s.y,d=s.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,o,r,a);l(p)&&(e.terrainState=Po.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=Po.RECEIVED)}).catch(function(){e.terrainState=Po.FAILED}))}function MAt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=Po.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=Po.RECEIVED,e.request=void 0}function a(c){if(e.request.state===Ai.CANCELLED){e.terrainData=void 0,e.terrainState=Po.UNLOADED,e.request=void 0;return}e.terrainState=Po.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Qo.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&s()}function s(){let c=new Cr({throttle:!1,throttleByServer:!0,type:ts.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=Po.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){a(f)})):(e.terrainState=Po.UNLOADED,e.request=void 0)}s()}var BAt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function LAt(e,t,n,i,o,r){let a=n.tilingScheme,s=BAt;s.tilingScheme=a,s.x=i,s.y=o,s.level=r,s.exaggeration=t.verticalExaggeration,s.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,s.throttle=!0;let u=e.terrainData.createMesh(s);l(u)&&(e.terrainState=Po.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=Po.TRANSFORMED}).catch(function(){e.terrainState=Po.FAILED}))}sr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=Ke.createVertexBuffer({context:e,typedArray:n,usage:Oe.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},a=r[e.id];if(!l(a)||a.isDestroyed()){let s=t.indices;a=Ke.createIndexBuffer({context:e,typedArray:s,usage:Oe.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(s.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,r[e.id]=a,t.indices.indexBuffers=r}else++a.referenceCount;return new Fn({context:e,attributes:o,indexBuffer:a})};sr._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 NAt(e,t,n,i,o,r,a){e.vertexArray=sr._createVertexArrayForMesh(t,e.mesh),e.terrainState=Po.READY,e.fill=e.fill&&e.fill.destroy(a)}function FAt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Dt.create({context:e,pixelFormat:Xe.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.LINEAR,magnificationFilter:ti.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function kAt(e,t){let n=t.terrainData.waterMask,i=FAt(e),o,r=n.length;if(n instanceof ImageBitmap)o=Dt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let a=Math.sqrt(r);o=Dt.create({context:e,pixelFormat:Xe.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{width:a,height:a,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}sr.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};sr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,a=o.height,s=r/i.width,c=a/i.height;return n.x=s*(o.west-i.west)/r,n.y=c*(o.south-i.south)/a,n.z=s,n.w=c,n};var Zh=sr;var zAt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Cn=zAt;var KEe={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>=KEe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},ri=KEe;function SS(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}SS.prototype.update=function(e,t,n){this.changedThisFrame&&(nve(e,t,this.tile,n),this.changedThisFrame=!1)};SS.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};SS.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Zh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var UAt=new dx;SS.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,a=o._lastSelectionFrameNumber,s=UAt;s.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&s.enqueue(t[u])}let c=s.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),d=c.findTileToEast(r),p=c.findTileToNorth(r);gs(e,n,c,u,a,Cn.EAST,!1,s,i),gs(e,n,c,f,a,Cn.NORTH,!1,s,i),gs(e,n,c,d,a,Cn.WEST,!1,s,i),gs(e,n,c,p,a,Cn.SOUTH,!1,s,i);let g=u.findTileToNorth(r),m=u.findTileToSouth(r),A=d.findTileToNorth(r),y=d.findTileToSouth(r);gs(e,n,c,g,a,Cn.SOUTHEAST,!1,s,i),gs(e,n,c,A,a,Cn.SOUTHWEST,!1,s,i),gs(e,n,c,m,a,Cn.NORTHEAST,!1,s,i),gs(e,n,c,y,a,Cn.NORTHWEST,!1,s,i),c=s.dequeue()}};function gs(e,t,n,i,o,r,a,s,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||ri.wasKicked(u._lastSelectionResult)||ri.originalResult(u._lastSelectionResult)===ri.CULLED);){if(a)return;let f=u.parent;if(r>=Cn.NORTHWEST&&f!==void 0)switch(r){case Cn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case Cn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case Cn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case Cn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===ri.RENDERED){if(l(u.data.vertexArray))return;VAt(e,t,n,u,r,o,s,c);return}if(ri.originalResult(i._lastSelectionResult)!==ri.CULLED)switch(r){case Cn.WEST:gs(e,t,n,i.northwestChild,o,r,!0,s,c),gs(e,t,n,i.southwestChild,o,r,!0,s,c);break;case Cn.EAST:gs(e,t,n,i.southeastChild,o,r,!0,s,c),gs(e,t,n,i.northeastChild,o,r,!0,s,c);break;case Cn.SOUTH:gs(e,t,n,i.southwestChild,o,r,!0,s,c),gs(e,t,n,i.southeastChild,o,r,!0,s,c);break;case Cn.NORTH:gs(e,t,n,i.northeastChild,o,r,!0,s,c),gs(e,t,n,i.northwestChild,o,r,!0,s,c);break;case Cn.NORTHWEST:gs(e,t,n,i.northwestChild,o,r,!0,s,c);break;case Cn.NORTHEAST:gs(e,t,n,i.northeastChild,o,r,!0,s,c);break;case Cn.SOUTHWEST:gs(e,t,n,i.southwestChild,o,r,!0,s,c);break;case Cn.SOUTHEAST:gs(e,t,n,i.southeastChild,o,r,!0,s,c);break;default:throw new _e("Invalid edge")}}}function VAt(e,t,n,i,o,r,a,s){let c=i.data;if(c.fill===void 0)c.fill=new SS(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,a.enqueue(i)),jAt(e,t,n,i,o,s)}function jAt(e,t,n,i,o,r){let a=i.data.fill,s,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(nve(e,t,n,r),c.changedThisFrame=!1),s=n.data.fill.mesh):s=n.data.mesh;let u,f;switch(o){case Cn.WEST:u=a.westMeshes,f=a.westTiles;break;case Cn.SOUTH:u=a.southMeshes,f=a.southTiles;break;case Cn.EAST:u=a.eastMeshes,f=a.eastTiles;break;case Cn.NORTH:u=a.northMeshes,f=a.northTiles;break;case Cn.NORTHWEST:a.changedThisFrame=a.changedThisFrame||a.northwestMesh!==s,a.northwestMesh=s,a.northwestTile=n;return;case Cn.NORTHEAST:a.changedThisFrame=a.changedThisFrame||a.northeastMesh!==s,a.northeastMesh=s,a.northeastTile=n;return;case Cn.SOUTHWEST:a.changedThisFrame=a.changedThisFrame||a.southwestMesh!==s,a.southwestMesh=s,a.southwestTile=n;return;case Cn.SOUTHEAST:a.changedThisFrame=a.changedThisFrame||a.southeastMesh!==s,a.southeastMesh=s,a.southeastTile=n;return}if(n.level<=i.level){a.changedThisFrame=a.changedThisFrame||u[0]!==s||u.length!==1,u[0]=s,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,A=n.rectangle,y,x=i.rectangle;switch(o){case Cn.WEST:for(y=(x.north-x.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(A.north,m.south,y));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.greaterThanOrEquals(A.south,m.north,y));++p);break;case Cn.SOUTH:for(y=(x.east-x.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(A.west,m.east,y));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(A.east,m.west,y));++p);break;case Cn.EAST:for(y=(x.north-x.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(A.south,m.north,y));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(A.north,m.south,y));++p);break;case Cn.NORTH:for(y=(x.east-x.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(A.east,m.west,y));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.greaterThanOrEquals(A.west,m.east,y));++p);break}p-d===1?(a.changedThisFrame=a.changedThisFrame||u[d]!==s,u[d]=s,f[d]=n):(a.changedThisFrame=!0,u.splice(d,p-d,s),f.splice(d,p-d,n))}var Mb=new de,GAt=new de,vS=new h,_ee=new h,mee=new z,pee=new z,vf=new z;function ij(){this.height=0,this.encodedNormal=new z}function $8(e,t,n,i,o,r,a,s,c){if(l(o))return o;let u;if(l(r)&&l(a))u=(r.height+a.height)*.5;else if(l(r))u=r.height;else if(l(a))u=a.height;else if(l(s))u=s.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return ive(e,t,n,i,u,c),c}var HAt={minimumHeight:0,maximumHeight:0},WAt=new h,QEe=new ij,$Ee=new ij,JEe=new ij,ZEe=new ij,qAt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,YAt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function nve(e,t,n,i){Zh.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,a=n.rectangle,s=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=s!==1,f=n.tilingScheme.ellipsoid,d=Z8(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,JEe),p=Z8(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,QEe),g=Z8(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,$Ee),m=Z8(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,ZEe);d=$8(r,f,0,1,d,p,m,g,JEe),p=$8(r,f,0,0,p,d,g,m,QEe),g=$8(r,f,1,1,g,p,m,d,$Ee),m=$8(r,f,1,1,m,g,d,p,ZEe);let A=p.height,y=g.height,x=d.height,b=m.height,T=Math.min(A,y,x,b),E=Math.max(A,y,x,b),S=(T+E)*.5,w,P,O=e.getLevelMaximumGeometricError(n.level),B=f.maximumRadius-O,L=Math.acos(B/f.maximumRadius)*4;if(L*=1.5,a.width>L&&E-T<=O){let v=new ol({width:9,height:9,buffer:qAt,structure:{heightOffset:E}}),I=YAt;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=s,I.exaggerationRelativeHeight=c,r.mesh=v._createMeshSync(I)}else{let v=u,I=oe.center(a,GAt);I.height=S;let M=f.cartographicToCartesian(I,WAt),N=new yr(M,void 0,void 0,void 0,void 0,!0,!0,v,s,c),j=5,k;for(k=r.westMeshes,w=0,P=k.length;w<P;++w)j+=k[w].eastIndicesNorthToSouth.length;for(k=r.southMeshes,w=0,P=k.length;w<P;++w)j+=k[w].northIndicesWestToEast.length;for(k=r.eastMeshes,w=0,P=k.length;w<P;++w)j+=k[w].westIndicesSouthToNorth.length;for(k=r.northMeshes,w=0,P=k.length;w<P;++w)j+=k[w].southIndicesEastToWest.length;let V=HAt;V.minimumHeight=T,V.maximumHeight=E;let F=N.stride,W=new Float32Array(j*F),q=0,J=q;q=J8(f,a,N,W,q,0,1,d.height,d.encodedNormal,1,V),q=tj(r,f,N,W,q,r.westTiles,r.westMeshes,Cn.EAST,V);let H=q;q=J8(f,a,N,W,q,0,0,p.height,p.encodedNormal,0,V),q=tj(r,f,N,W,q,r.southTiles,r.southMeshes,Cn.NORTH,V);let Z=q;q=J8(f,a,N,W,q,1,0,g.height,g.encodedNormal,0,V),q=tj(r,f,N,W,q,r.eastTiles,r.eastMeshes,Cn.WEST,V);let K=q;q=J8(f,a,N,W,q,1,1,m.height,m.encodedNormal,1,V),q=tj(r,f,N,W,q,r.northTiles,r.northMeshes,Cn.SOUTH,V),T=V.minimumHeight,E=V.maximumHeight;let le=$t.fromRectangle(a,T,E,n.tilingScheme.ellipsoid),me=di.geodeticLatitudeToMercatorAngle(a.south),ae=1/(di.geodeticLatitudeToMercatorAngle(a.north)-me),be=(di.geodeticLatitudeToMercatorAngle(I.latitude)-me)*ae,ge=f.geodeticSurfaceNormalCartographic(Mb,_ee),we=on.octEncode(ge,mee),Ee=q;N.encode(W,q*F,le.center,z.fromElements(.5,.5,vf),S,we,be,ge),++q;let Be=q,ke=Be<256?1:2,Ge=(Be-1)*3,rt=Ge*ke,et=(W.length-Be*F)*Float32Array.BYTES_PER_ELEMENT,Pe;if(et>=rt){let yt=Be*F*Float32Array.BYTES_PER_ELEMENT;Pe=Be<256?new Uint8Array(W.buffer,yt,Ge):new Uint16Array(W.buffer,yt,Ge)}else Pe=Be<256?new Uint8Array(Ge):new Uint16Array(Ge);W=new Float32Array(W.buffer,0,Be*F);let Ye=0;for(w=0;w<Be-2;++w)Pe[Ye++]=Ee,Pe[Ye++]=w,Pe[Ye++]=w+1;Pe[Ye++]=Ee,Pe[Ye++]=w,Pe[Ye++]=0;let ut=[];for(w=H;w>=J;--w)ut.push(w);let Ct=[];for(w=Z;w>=H;--w)Ct.push(w);let en=[];for(w=K;w>=Z;--w)en.push(w);let Gt=[];for(Gt.push(0),w=Ee-1;w>=K;--w)Gt.push(w);r.mesh=new vc(N.center,W,Pe,Ge,Be,T,E,a,ce.fromOrientedBoundingBox(le),eyt(e,le.center,a,T,E),N.stride,le,N,ut,Ct,en,Gt)}let _=t.context;r._destroyVertexArray(i),r.vertexArray=Zh._createVertexArrayForMesh(_,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let C=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let v=o._findAncestorTileWithTerrainData(n);l(v)&&l(v.data.waterMaskTexture)&&(r.waterMaskTexture=v.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,v,r.waterMaskTranslationAndScale))}l(C)&&(--C.referenceCount,C.referenceCount===0&&C.destroy())}function J8(e,t,n,i,o,r,a,s,c,u,f){let d=Mb;d.longitude=D.lerp(t.west,t.east,r),d.latitude=D.lerp(t.south,t.north,a),d.height=s;let p=e.cartographicToCartesian(d,vS),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,_ee));let m=pee;return m.x=r,m.y=a,n.encode(i,o*n.stride,p,m,s,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,s),f.maximumHeight=Math.max(f.maximumHeight,s),o+1}var nj=new oe;function nR(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=oe.clone(e.rectangle,nj),o.west-=D.TWO_PI,o.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=oe.clone(e.rectangle,nj),o.west+=D.TWO_PI,o.east+=D.TWO_PI);let a=o.east-o.west,s=(r.west-o.west)/a,c=(r.east-o.west)/a,u=o.north-o.south,f=(r.south-o.south)/u,d=(r.north-o.south)/u,p=(n.x-s)/(c-s),g=(n.y-f)/(d-f);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 XAt=new z;function gee(e,t,n,i,o){let r=e.encoding,a=e.vertices;if(o.height=r.decodeHeight(a,t),r.hasVertexNormals)r.getOctEncodedNormal(a,t,o.encodedNormal);else{let s=o.encodedNormal;s.x=0,s.y=0}}var KAt=new z,QAt=new h;function $At(e,t,n,i,o,r,a,s,c,u){let f=i.encoding,d=i.vertices,p=nR(t,n,f.decodeTextureCoordinates(d,o,vf),vf),g=nR(t,n,f.decodeTextureCoordinates(d,r,pee),pee),m;c?m=(a-p.x)/(g.x-p.x):m=(s-p.y)/(g.y-p.y);let A=f.decodeHeight(d,o),y=f.decodeHeight(d,r),x=n.rectangle;Mb.longitude=D.lerp(x.west,x.east,a),Mb.latitude=D.lerp(x.south,x.north,s),u.height=Mb.height=D.lerp(A,y,m);let b;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,o,XAt),E=f.getOctEncodedNormal(d,r,KAt),S=on.octDecode(T.x,T.y,vS),w=on.octDecode(E.x,E.y,QAt);b=h.lerp(S,w,m,vS),h.normalize(b,b),on.octEncode(b,u.encodedNormal)}else b=e.geodeticSurfaceNormalCartographic(Mb,vS),on.octEncode(b,u.encodedNormal)}function ive(e,t,n,i,o,r){r.height=o;let a=t.geodeticSurfaceNormalCartographic(Mb,vS);on.octEncode(a,r.encodedNormal)}function Z8(e,t,n,i,o,r,a,s,c,u,f){if(tve(e,t,s,a,!1,n,i,f)||tve(e,t,u,c,!0,n,i,f))return f;let p;if(Aee(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],gee(r,p,n,i,f),f;let g;if(n===0?i===0?g=ej(e.westMeshes,e.westTiles,Cn.EAST,e.southMeshes,e.southTiles,Cn.NORTH,n,i):g=ej(e.northMeshes,e.northTiles,Cn.SOUTH,e.westMeshes,e.westTiles,Cn.EAST,n,i):i===0?g=ej(e.southMeshes,e.southTiles,Cn.NORTH,e.eastMeshes,e.eastTiles,Cn.WEST,n,i):g=ej(e.eastMeshes,e.eastTiles,Cn.WEST,e.northMeshes,e.northTiles,Cn.SOUTH,n,i),l(g))return ive(e,t,n,i,g,f),f}function ej(e,t,n,i,o,r,a,s){let c=eve(e,t,!1,n,a,s),u=eve(i,o,!0,r,a,s);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function tj(e,t,n,i,o,r,a,s,c){for(let u=0;u<r.length;++u)o=JAt(e,t,n,i,o,r[u],a[u],s,c);return o}function JAt(e,t,n,i,o,r,a,s,c){let u=r.rectangle;s===Cn.EAST&&e.tile.x===0?(u=oe.clone(r.rectangle,nj),u.west-=D.TWO_PI,u.east-=D.TWO_PI):s===Cn.WEST&&r.x===0&&(u=oe.clone(r.rectangle,nj),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,d,p;o>0&&(n.decodeTextureCoordinates(i,o-1,vf),d=vf.x,p=vf.y);let g,m;switch(s){case Cn.WEST:g=a.westIndicesSouthToNorth,m=!1;break;case Cn.NORTH:g=a.northIndicesWestToEast,m=!0;break;case Cn.EAST:g=a.eastIndicesNorthToSouth,m=!1;break;case Cn.SOUTH:g=a.southIndicesEastToWest,m=!0;break}let A=r,y=e.tile,x=a.encoding,b=a.vertices,T=n.stride,E,S;x.hasWebMercatorT&&(E=di.geodeticLatitudeToMercatorAngle(f.south),S=1/(di.geodeticLatitudeToMercatorAngle(f.north)-E));for(let w=0;w<g.length;++w){let P=g[w],O=x.decodeTextureCoordinates(b,P,vf);nR(A,y,O,O);let B=O.x,L=O.y,_=m?B:L;if(_<0||_>1||Math.abs(B-d)<D.EPSILON5&&Math.abs(L-p)<D.EPSILON5)continue;let C=Math.abs(B)<D.EPSILON5||Math.abs(B-1)<D.EPSILON5,v=Math.abs(L)<D.EPSILON5||Math.abs(L-1)<D.EPSILON5;if(C&&v)continue;let I=x.decodePosition(b,P,vS),M=x.decodeHeight(b,P),N;x.hasVertexNormals?N=x.getOctEncodedNormal(b,P,mee):(N=mee,N.x=0,N.y=0);let j=L;if(x.hasWebMercatorT){let V=D.lerp(f.south,f.north,L);j=(di.geodeticLatitudeToMercatorAngle(V)-E)*S}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(I,_ee)),n.encode(i,o*T,I,O,M,N,j,k),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++o}return o}function eve(e,t,n,i,o,r){let a,s,c;n?(a=0,s=e.length,c=1):(a=e.length-1,s=-1,c=-1);for(let u=a;u!==s;u+=c){let f=e[u],d=t[u];if(!Aee(d,f))continue;let p;switch(i){case Cn.WEST:p=f.westIndicesSouthToNorth;break;case Cn.SOUTH:p=f.southIndicesEastToWest;break;case Cn.EAST:p=f.eastIndicesNorthToSouth;break;case Cn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function Aee(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function tve(e,t,n,i,o,r,a,s){let c,u,f,d,p,g=i[o?0:n.length-1],m=n[o?0:n.length-1];if(Aee(g,m)&&(r===0?a===0?(c=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(c=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):a===0?(c=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(c=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){d=o?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,vf);let A=nR(g,e.tile,vf,vf);if(A.x===r&&A.y===a)return gee(m,p,r,a,s),!0;if(d=Ao(c,u?r:a,function(y,x){m.encoding.decodeTextureCoordinates(m.vertices,y,vf);let b=nR(g,e.tile,vf,vf);return f?u?b.x-r:b.y-a:u?r-b.x:a-b.y}),d<0){if(d=~d,d>0&&d<c.length)return $At(t,g,e.tile,m,c[d-1],c[d],r,a,u,s),!0}else return gee(m,c[d],r,a,s),!0}return!1}var ZAt=[new h,new h,new h,new h];function eyt(e,t,n,i,o,r){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=ZAt;return h.fromRadians(n.west,n.south,o,s,c[0]),h.fromRadians(n.east,n.south,o,s,c[1]),h.fromRadians(n.west,n.north,o,s,c[2]),h.fromRadians(n.east,n.north,o,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var iR=SS;function xr(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=vn.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 ye,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(xr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(xr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(xr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(xr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new ye,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 U(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=oe.clone(oe.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=ie.SCENE3D}Object.defineProperties(xr.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){ba.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){qm.setOwner(e,this,"_clippingPolygons")}}});function tyt(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}xr.prototype.update=function(e){this._imageryLayers._update()};function nyt(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,a=o.length;r<a;++r){let s=o.get(r);s.ready&&s.show&&l(s.imageryProvider.credit)&&n.addCreditToNextFrame(s.imageryProvider.credit)}}xr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(tyt)})),nyt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)Zh._freeVertexArray(t[i]);t.length=0};xr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let a=t[o];l(a)&&(a.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};xr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:hc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},blending:Jt.ALPHA_BLEND});let s=qe(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=qe(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&iR.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._oldSceneMode!==e.mode;this._oldSceneMode=e.mode,r&&t.forEachLoadedTile(function(s){s.data.updateSceneMode(e.mode)});let a=this._tilesToRenderByTextureCount;for(let s=0,c=a.length;s<c;++s){let u=a[s];if(l(u))for(let f=0,d=u.length;f<d;++f){let p=u[f],g=p.data.tileBoundingRegion;Syt(this,p,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,g.minimumHeight)}}};function cve(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)}xr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)cve(t[n],e)};xr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};xr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};xr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===ri.CULLED_BUT_NEEDED,o=n.terrainState),Zh.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)!==Qr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,Zh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var iyt=new ce,lve=new oe,oyt=new oe,ryt=new de;function rj(e,t){if(t.west<t.east)return t;let n=oe.clone(t,oyt);return oe.center(e,ryt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function uve(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||!oe.equals(e.cartographicLimitRectangle,oe.MAX_VALUE))}xr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=uve(this,t);if(t.fog.enabled&&!o&&D.fog(i,t.fog.density)>=1)return Qr.NONE;let r=e.data,a=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return Qr.PARTIAL;let s=t.cullingVolume,c=a.boundingVolume;l(c)||(c=a.boundingSphere),r.clippedByBoundaries=!1;let u=rj(e.rectangle,this.cartographicLimitRectangle),f=oe.simpleIntersection(u,e.rectangle,lve);if(!l(f))return Qr.NONE;if(oe.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ie.SCENE3D&&(c=iyt,ce.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,a.minimumHeight,a.maximumHeight,c),h.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ie.MORPHING&&l(r.renderedMesh)&&(c=ce.union(a.boundingSphere,c,c))),!l(c))return Qr.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let y=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=y!==qt.INSIDE,y===qt.OUTSIDE)return Qr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let y=p.computeIntersectionWithBoundingVolume(a);e.isClipped=y!==qt.OUTSIDE}let g,m=s.computeVisibility(c);if(m===qt.OUTSIDE?g=Qr.NONE:m===qt.INTERSECTING?g=Qr.PARTIAL:m===qt.INSIDE&&(g=Qr.FULL),g===Qr.NONE)return g;let A=t.mode===ie.SCENE3D&&t.camera.frustum instanceof fn;if(t.mode===ie.SCENE3D&&!A&&l(n)&&!o){let y=r.occludeePointInScaledSpace;return!l(y)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(y,a.minimumHeight)?g:Qr.NONE}return g};xr.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 ayt=[],syt=[];xr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=ayt;i.length=this._imageryLayers.length;let o=!1,r=!1,a;l(n)&&(o=n.terrainState===Po.READY,r=!0,a=n.imagery);let s,c;for(s=0,c=i.length;s<c;++s)i[s]=r;if(l(a))for(s=0,c=a.length;s<c;++s){let d=a[s],p=d.loadingImagery,g=!l(p)||p.state===Vn.FAILED||p.state===Vn.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=syt;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:ri.NONE;if(p===ri.RENDERED){let g=d.data;if(!l(g))continue;if(!o&&d.data.terrainState===Po.READY)return!1;let m=d.data.imagery;for(s=0,c=m.length;s<c;++s){let A=m[s],y=A.loadingImagery,x=!l(y)||y.state===Vn.FAILED||y.state===Vn.INVALID,b=(A.loadingImagery||A.readyImagery).imageryLayer._layerIndex;if(x&&!i[b])return!1}}else p===ri.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var cyt=new h;xr.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,a=h.subtract(i.center,o,cyt),s=h.magnitude(a);return s<D.EPSILON5?0:(h.divideByScalar(a,s,a),(1-h.dot(a,r))*e._distance)};var ove=new R,oj=new R,lyt=new se,uyt=new se,fyt=new se,dyt=new h,rve=new h,hyt=new h,myt=new h;xr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let s=0,c=i.length;s<c;++s){let u=i[s];l(u.readyImagery)&&u.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 a=this._debug;++a.tilesRendered,a.texturesRendered+=n};var pyt=[new h,new h,new h,new h];function ave(e,t,n,i,o,r){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=pyt;return h.fromRadians(n.west,n.south,o,s,c[0]),h.fromRadians(n.east,n.south,o,s,c[1]),h.fromRadians(n.west,n.north,o,s,c[2]),h.fromRadians(n.east,n.north,o,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}xr.prototype.computeDistanceToTile=function(e,t){gyt(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,a=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-a);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=a,o.maximumHeight=a)}let s=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=a,s};function gyt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Zh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new yd({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,a=r.minimumHeight,s=r.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)r.minimumHeight=d._minimumHeight,r.maximumHeight=d._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 m=g.mesh,A=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(A!==void 0&&A._minimumHeight!==void 0&&A._maximumHeight!==void 0){r.minimumHeight=A._minimumHeight,r.maximumHeight=A._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=ho.getHeight(r.minimumHeight,p,g),r.maximumHeight=ho.getHeight(r.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=$t.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ce.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=ave(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let A=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==a||r.maximumHeight!==s||A)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=ave(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}xr.prototype.isDestroyed=function(){return!1};xr.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(),fe(this)};function _yt(e,t,n){return function(i){let o,r,a=-1,s=i.data.imagery,c=s.length,u;for(u=0;u<c;++u)if(o=s[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){a=u;break}if(a!==-1){let f=a+e;if(o=s[f],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=a;u<f;++u)s[u].freeResources();s.splice(a,e)}return!0}}xr.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(a){if(l(a._loadedCallbacks[e._layerIndex]))return;let s,c=a.data.imagery,u=c.length,f=-1,d=0;for(s=0;s<u;++s){let g=c[s];if((g.readyImagery??g.loadingImagery).imageryLayer===e)f===-1&&(f=s),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(a,n,p)&&(a._loadedCallbacks[e._layerIndex]=_yt(d,e,n),a.state=ac.LOADING)})};if(e.ready){let a=e.imageryProvider;a._reload=r}this._quadtree.forEachLoadedTile(function(a){e._createTileImagerySkeletons(a,n)&&(a.state=ac.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==ri.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};xr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let a=0,s=i.length;a<s;++a){let c=i[a],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=a),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()};xr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};xr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Ayt=new R,yyt=new R;function sve(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=R.multiplyByPoint(i,this.properties.rtc,rve);return R.setTranslation(i,o,ove),ove},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=R.multiplyByPoint(i,this.properties.rtc,rve);return R.setTranslation(i,r,oj),R.multiply(o,oj,oj),oj},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)?R.multiply(e.context.uniformState.view,i.modelMatrix,Ayt):R.IDENTITY;return R.inverseTranspose(o,yyt)},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 U(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new z(65e5,9e6),nightFadeDistance:new z(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 R,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new z(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new z,southMercatorYAndOneOverHeight:new z,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new z,scaleAndBias:new R,clippingPlanesEdgeColor:U.clone(U.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:U.clone(U.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?It(n,t.materialUniformMap):n}function xyt(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=byt(e,r,o),i.wireframeVertexArray.mesh=o}}function byt(e,t,n){let o={indices:n.indices,primitiveType:Re.TRIANGLES};kn.toWireframe(o);let r=o.indices,a=Ke.createIndexBuffer({context:e,typedArray:r,usage:Oe.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new Fn({context:e,attributes:t._attributes,indexBuffer:a})}var fve,dve,aj;(function(){let e=new Bt({geometry:Sm.fromDimensions({dimensions:new h(2,2,2)})}),t=new Bt({geometry:new fA({radius:1})}),n=new R,i,o;function r(a){return new Pn({geometryInstances:a,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})}fve=function(a,s){return a===i||(aj(),i=a,n=R.fromRotationTranslation(a.halfAxes,a.center,n),e.modelMatrix=n,e.attributes.color=Yt.fromColor(s),o=r(e)),o},dve=function(a,s){return a===i||(aj(),i=a,n=R.fromTranslation(a.center,n),n=R.multiplyByUniformScale(n,a.radius,n),t.modelMatrix=n,t.attributes.color=Yt.fromColor(s),o=r(t)),o},aj=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Tyt=new se(0,0,0,0),Cyt={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},Eyt=U.TRANSPARENT,vyt=new Ut;function Syt(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new iR(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let yt=r.credits;for(let wt=0,xn=yt.length;wt<xn;++wt)o.addCreditToNextFrame(yt[wt])}let a=Mt.maximumTextureImageUnits,s=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(s)&&l(i.fill)&&(s=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,A=e.undergroundColor??Eyt,y=e.undergroundColorAlphaByDistance??vyt,x=uve(e,n)&&n.mode===ie.SCENE3D&&A.alpha>0&&(y.nearValue>0||y.farValue>0),b=e.lambertDiffuseMultiplier,T=e.vertexShadowDarkness,E=e.hasWaterMask&&l(s),S=E&&e.showWaterEffect,w=e.oceanNormalMap,P=S&&l(w),O=e.terrainProvider,B=l(O)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===ie.SCENE3D,C=vn.castShadows(e.shadows)&&!d,v=vn.receiveShadows(e.shadows)&&!d,I=e.hueShift,M=e.saturationShift,N=e.brightnessShift,j=!(D.equalsEpsilon(I,0,D.EPSILON7)&&D.equalsEpsilon(M,0,D.EPSILON7)&&D.equalsEpsilon(N,0,D.EPSILON7)),k=!1;if(_){let yt=h.magnitude(n.camera.positionWC),wt=e.nightFadeOutDistance;k=yt>wt}E&&--a,P&&--a,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--a,--a),a-=f.numberOfTextureUniforms;let V=i.renderedMesh,F=V.center,W=V.encoding,q=i.tileBoundingRegion,J=n.verticalExaggeration,H=n.verticalExaggerationRelativeHeight,Z=J!==1,K=W.hasGeodeticSurfaceNormals,le=lyt,me=0,ae=0,be=0,ge=0,we=!1;if(n.mode!==ie.SCENE3D){let yt=n.mapProjection,wt=yt.project(oe.southwest(t.rectangle),hyt),xn=yt.project(oe.northeast(t.rectangle),myt);if(le.x=wt.x,le.y=wt.y,le.z=xn.x,le.w=xn.y,n.mode!==ie.MORPHING&&(F=dyt,F.x=0,F.y=(le.z+le.x)*.5,F.z=(le.w+le.y)*.5,le.x-=F.y,le.y-=F.z,le.z-=F.y,le.w-=F.z),n.mode===ie.SCENE2D&&W.quantization===rc.BITS12){let at=1/(Math.pow(2,12)-1)*.5,st=(le.z-le.x)*at,Ln=(le.w-le.y)*at;le.x-=st,le.y-=Ln,le.z+=st,le.w+=Ln}yt instanceof di&&(me=t.rectangle.south,ae=t.rectangle.north,be=di.geodeticLatitudeToMercatorAngle(me),ge=1/(di.geodeticLatitudeToMercatorAngle(ae)-be),we=!0)}let Ee=Cyt;Ee.frameState=n,Ee.surfaceTile=i,Ee.hasWaterMask=E,Ee.showReflectiveOcean=S,Ee.showOceanWaves=P,Ee.enableLighting=e.enableLighting,Ee.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ee.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ee.showGroundAtmosphere=_,Ee.atmosphereLightIntensity=e.atmosphereLightIntensity,Ee.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ee.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ee.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ee.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ee.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ee.perFragmentGroundAtmosphere=k,Ee.hasVertexNormals=B,Ee.useWebMercatorProjection=we,Ee.clippedByBoundaries=i.clippedByBoundaries,Ee.hasGeodeticSurfaceNormals=K,Ee.hasExaggeration=Z;let Be=i.imagery,ke=0,Ge=Be.length,rt=e.showSkirts&&!u&&!d,et=e.backFaceCulling&&!u&&!d,Pe=et?e._renderState:e._disableCullingRenderState,Ye=et?e._blendRenderState:e._disableCullingBlendRenderState,ut=Pe,Ct=e._firstPassInitialColor,en=n.context;if(l(e._debug.boundingSphereTile)||aj(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let yt=e._drawCommands.length;for(let wt=0;wt<yt;++wt)e._uniformMaps[wt]=sve(n,e)}do{let yt=0,wt,xn;if(e._drawCommands.length<=e._usedDrawCommands?(wt=new tt,wt.owner=t,wt.cull=!1,wt.boundingVolume=new ce,wt.orientedBoundingBox=void 0,xn=sve(n,e),e._drawCommands.push(wt),e._uniformMaps.push(xn)):(wt=e._drawCommands[e._usedDrawCommands],xn=e._uniformMaps[e._usedDrawCommands]),wt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Go=q.boundingVolume,ur=q.boundingSphere;l(Go)?fve(Go,U.RED).update(n):l(ur)&&dve(ur,U.RED).update(n)}let at=xn.properties;se.clone(Ct,at.initialColor),at.oceanNormalMap=w,at.lightingFadeDistance.x=e.lightingFadeOutDistance,at.lightingFadeDistance.y=e.lightingFadeInDistance,at.nightFadeDistance.x=e.nightFadeOutDistance,at.nightFadeDistance.y=e.nightFadeInDistance,at.atmosphereLightIntensity=e.atmosphereLightIntensity,at.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,at.atmosphereMieCoefficient=e.atmosphereMieCoefficient,at.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,at.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,at.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,at.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let st=u?g:p,Ln=u?p:g;l(st)&&(se.fromElements(st.near,st.nearValue,st.far,st.farValue,at.frontFaceAlphaByDistance),se.fromElements(Ln.near,Ln.nearValue,Ln.far,Ln.farValue,at.backFaceAlphaByDistance)),se.fromElements(y.near,y.nearValue,y.far,y.farValue,at.undergroundColorAlphaByDistance),U.clone(A,at.undergroundColor),at.lambertDiffuseMultiplier=b,at.vertexShadowDarkness=T;let Nn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Nn&&U.clone(e.fillHighlightColor,at.fillHighlightColor),at.verticalExaggerationAndRelativeHeight.x=J,at.verticalExaggerationAndRelativeHeight.y=H,at.center3D=V.center,h.clone(F,at.rtc),se.clone(le,at.tileRectangle),at.southAndNorthLatitude.x=me,at.southAndNorthLatitude.y=ae,at.southMercatorYAndOneOverHeight.x=be,at.southMercatorYAndOneOverHeight.y=ge;let so=uyt,jo=rj(t.rectangle,e.cartographicLimitRectangle),to=fyt,no=rj(t.rectangle,m);h.fromElements(I,M,N,at.hsbShift);let jn=t.rectangle,Gn=1/jn.width,sn=1/jn.height;so.x=(jo.west-jn.west)*Gn,so.y=(jo.south-jn.south)*sn,so.z=(jo.east-jn.west)*Gn,so.w=(jo.north-jn.south)*sn,se.clone(so,at.localizedCartographicLimitRectangle),to.x=(no.west-jn.west)*Gn,to.y=(no.south-jn.south)*sn,to.z=(no.east-jn.west)*Gn,to.w=(no.north-jn.south)*sn,se.clone(to,at.localizedTranslucencyRectangle);let Qn=L&&D.fog(t._distance,n.fog.density)>D.EPSILON3;j=j&&(Qn||_);let Tr=!1,ma=!1,Qa=!1,Ba=!1,$a=!1,lr=!1,ii=!1,Lr=!1,So=!1,Di=!1;for(;yt<a&&ke<Ge;){let Go=Be[ke],ur=Go.readyImagery;if(++ke,!l(ur)||ur.imageryLayer.alpha===0)continue;let Qd=Go.useWebMercatorT?ur.textureWebMercator:ur.texture,Nr=ur.imageryLayer;l(Go.textureTranslationAndScale)||(Go.textureTranslationAndScale=Nr._calculateTextureTranslationAndScale(t,Go)),at.dayTextures[yt]=Qd,at.dayTextureTranslationAndScale[yt]=Go.textureTranslationAndScale,at.dayTextureTexCoordsRectangle[yt]=Go.textureCoordinateRectangle,at.dayTextureUseWebMercatorT[yt]=Go.useWebMercatorT,at.dayTextureAlpha[yt]=Nr.alpha,lr=lr||at.dayTextureAlpha[yt]!==1,at.dayTextureNightAlpha[yt]=Nr.nightAlpha,ii=ii||at.dayTextureNightAlpha[yt]!==1,at.dayTextureDayAlpha[yt]=Nr.dayAlpha,ii=ii||at.dayTextureDayAlpha[yt]!==1,at.dayTextureBrightness[yt]=Nr.brightness,Tr=Tr||at.dayTextureBrightness[yt]!==va.DEFAULT_BRIGHTNESS,at.dayTextureContrast[yt]=Nr.contrast,ma=ma||at.dayTextureContrast[yt]!==va.DEFAULT_CONTRAST,at.dayTextureHue[yt]=Nr.hue,Qa=Qa||at.dayTextureHue[yt]!==va.DEFAULT_HUE,at.dayTextureSaturation[yt]=Nr.saturation,Ba=Ba||at.dayTextureSaturation[yt]!==va.DEFAULT_SATURATION,at.dayTextureOneOverGamma[yt]=1/Nr.gamma,$a=$a||at.dayTextureOneOverGamma[yt]!==1/va.DEFAULT_GAMMA,at.dayTextureSplit[yt]=Nr.splitDirection,Lr=Lr||at.dayTextureSplit[yt]!==0;let Pc=at.dayTextureCutoutRectangles[yt];if(l(Pc)||(Pc=at.dayTextureCutoutRectangles[yt]=new se),se.clone(se.ZERO,Pc),l(Nr.cutoutRectangle)){let _o=rj(jn,Nr.cutoutRectangle),La=oe.simpleIntersection(_o,jn,lve);So=l(La)||So,Pc.x=(_o.west-jn.west)*Gn,Pc.y=(_o.south-jn.south)*sn,Pc.z=(_o.east-jn.west)*Gn,Pc.w=(_o.north-jn.south)*sn}let Rc=at.colorsToAlpha[yt];l(Rc)||(Rc=at.colorsToAlpha[yt]=new se);let fc=l(Nr.colorToAlpha)&&Nr.colorToAlphaThreshold>0;if(Di=Di||fc,fc){let _o=Nr.colorToAlpha;Rc.x=_o.red,Rc.y=_o.green,Rc.z=_o.blue,Rc.w=Nr.colorToAlphaThreshold}else Rc.w=-1;if(l(ur.credits)){let _o=ur.credits;for(let La=0,Vg=_o.length;La<Vg;++La)o.addCreditToNextFrame(_o[La])}++yt}at.dayTextures.length=yt,at.waterMask=s,se.clone(c,at.waterMaskTranslationAndScale),at.minMaxHeight.x=W.minimumHeight,at.minMaxHeight.y=W.maximumHeight,R.clone(W.matrix,at.scaleAndBias);let ai=e._clippingPlanes,Oo=l(ai)&&ai.enabled&&t.isClipped;Oo&&(at.clippingPlanesEdgeColor=U.clone(ai.edgeColor,at.clippingPlanesEdgeColor),at.clippingPlanesEdgeWidth=ai.edgeWidth);let uc=e._clippingPolygons,Jr=l(uc)&&uc.enabled&&t.isClipped;Ee.numberOfDayTextures=yt,Ee.applyBrightness=Tr,Ee.applyContrast=ma,Ee.applyHue=Qa,Ee.applySaturation=Ba,Ee.applyGamma=$a,Ee.applyAlpha=lr,Ee.applyDayNightAlpha=ii,Ee.applySplit=Lr,Ee.enableFog=Qn,Ee.enableClippingPlanes=Oo,Ee.clippingPlanes=ai,Ee.enableClippingPolygons=Jr,Ee.clippingPolygons=uc,Ee.hasImageryLayerCutout=So,Ee.colorCorrect=j,Ee.highlightFillTile=Nn,Ee.colorToAlpha=Di,Ee.showUndergroundColor=x,Ee.translucent=d;let Uu=i.renderedMesh.indices.length;rt||(Uu=i.renderedMesh.indexCountWithoutSkirts),wt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ee),wt.castShadows=C,wt.receiveShadows=v,wt.renderState=ut,wt.primitiveType=Re.TRIANGLES,wt.vertexArray=i.vertexArray||i.fill.vertexArray,wt.count=Uu,wt.uniformMap=xn,wt.pass=Ie.GLOBE,e._debug.wireframe&&(xyt(en,e,t),l(i.wireframeVertexArray)&&(wt.vertexArray=i.wireframeVertexArray,wt.primitiveType=Re.LINES,wt.count=Uu*2));let ks=wt.boundingVolume,Ug=wt.orientedBoundingBox;n.mode!==ie.SCENE3D?(ce.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,ks),h.fromElements(ks.center.z,ks.center.x,ks.center.y,ks.center),n.mode===ie.MORPHING&&(ks=ce.union(q.boundingSphere,ks,ks))):(wt.boundingVolume=ce.clone(q.boundingSphere,ks),wt.orientedBoundingBox=$t.clone(q.boundingVolume,Ug)),wt.dirty=!0,d&&f.updateDerivedCommands(wt,n),cve(wt,n),ut=Ye,Ct=Tyt}while(ke<Ge)}var sj=xr;function hve(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=oe.clone(oe.MAX_VALUE)}Object.defineProperties(hve.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=oe.clone(oe.MAX_VALUE)),oe.clone(e,this._rectangle)}}});var cj=hve;var yee=class{constructor(t){this._ellipsoid=new mp(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},lj=yee;var xee=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},wyt=1e3,bee=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.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=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=ri.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new xee(wyt),this.state=ac.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),o=new Array(n*i),r=0;for(let a=0;a<i;++a)for(let s=0;s<n;++s)o[r++]=new e({tilingScheme:t,x:s,y:a,level:0});return o}_getCacheKey(t,n){return Dyt(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let o=0;o<t.length;++o){let r=t[o];i.add(r),mve(this,r.positionCartographic)._addedCustomData.push(r)}this._addedCustomData.length=0;for(let o=0;o<n.length;++o){let r=n[o];i.has(r)&&i.delete(r),mve(this,r.positionCartographic)._removedCustomData.push(r)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<ac.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let o=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=o:n>=o&&(n-=o),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(r){return r.x===n&&r.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=ac.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),uj(this._southwestChild),this._southwestChild=void 0,uj(this._southeastChild),this._southeastChild=void 0,uj(this._northwestChild),this._northwestChild=void 0,uj(this._northeastChild),this._northeastChild=void 0}},Iyt=256;function Dyt(e,t,n,i){let o=n.width/Iyt*i,r=Math.floor(e/o)*o,a=Math.floor(t/o)*o;return`${r.toFixed(10)},${a.toFixed(10)}`}var Pyt=new de;function mve(e,t){let n=e.northwestChild.rectangle,i=oe.southeast(n,Pyt),o=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+o){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function uj(e){l(e)&&e.freeResources()}var fj=bee;function dj(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}dj.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};dj.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(),pve(this,t)),t=i}};function pve(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}dj.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))&&pve(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var hj=dj;function Ld(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._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new hj,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new lj({ellipsoid:n}),this._tileLoadProgressEvent=new ye,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Ld.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Ld.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Ryt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,_ve(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData;for(let a of r)a.level=0,e._addHeightCallbacks.push(a);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Ld.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==ac.START&&e(t),t=t.replacementNext};Ld.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Ld.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 a=0;a<r;++a)if(o[a]===i){o.splice(a,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Ld.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function _ve(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}Ld.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Ryt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),_ve(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Ld.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Lyt(this,e),Wyt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Oyt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=ye.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))}Ld.prototype.endFrame=function(e){!e.passes.render||e.mode===ie.MORPHING||(Vyt(this,e),Hyt(this,e),Oyt(this,e))};Ld.prototype.isDestroyed=function(){return!1};Ld.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var rR,gve=new de;function Myt(e,t){let n=oe.center(e.rectangle,gve),i=n.longitude-rR.longitude,o=n.latitude-rR.latitude;n=oe.center(t.rectangle,gve);let r=n.longitude-rR.longitude,a=n.latitude-rR.latitude;return i*i+o*o-(r*r+a*a)}var Byt=new h,oR=[];function Lyt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o=e._tileProvider;if(!l(e._levelZeroTiles)){let d=o.tilingScheme;if(l(d)){let p=o.tilingScheme;e._levelZeroTiles=fj.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(oR.length<g){oR=new Array(g);for(let m=0;m<g;++m)oR[m]===void 0&&(oR[m]=new aR)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,a=r.length>1?e._occluders:void 0;rR=t.camera.positionCartographic,r.sort(Myt);let s=e._addHeightCallbacks,c=e._removeHeightCallbacks;s.forEach(d=>{let p=r.find(g=>oe.contains(g.rectangle,d.positionCartographic));p&&p._addedCustomData.push(d)}),c.forEach(d=>{let p=r.find(g=>oe.contains(g.rectangle,d.positionCartographic));p&&p._removedCustomData.push(d)}),r.forEach(d=>d.updateCustomData()),s.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=R.getTranslation(u.transform,Byt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let d=0;d<r.length;++d){let p=r[d];e._tileReplacementQueue.markTileRendered(p),p.renderable?Sc(e,p,o,t,a,!1,oR[d]):(yg(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function yg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function aR(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Ave(){this.southwest=new aR,this.southeast=new aR,this.northwest=new aR,this.northeast=new aR}Ave.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 Cee=new Array(31);for(let e=0;e<Cee.length;++e)Cee[e]=new Ave;function Nyt(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let a=zyt(e,t,n)<e.maximumScreenSpaceError,s=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:ri.NONE,g=e.tileProvider;if(a||i){let m=ri.originalResult(p)===ri.RENDERED,A=ri.originalResult(p)===ri.CULLED||p===ri.NONE,y=n.state===ac.DONE,x=m||A||y;if(x||l(g.canRenderWithoutLosingDetail)&&(x=g.canRenderWithoutLosingDetail(n)),x){a&&yg(e,e._tileLoadQueueMedium,n,t),mj(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===ri.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ri.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,a&&yg(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(s.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){mj(e,n),yg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(s),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===ri.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ri.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ri.REFINED;let A=e._tilesToRender.length,y=e._tileLoadQueueLow.length,x=e._tileLoadQueueMedium.length,b=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(Fyt(e,s,c,u,f,t,i,o),A!==e._tilesToRender.length){let E=o.allAreRenderable,S=o.anyWereRenderedLastFrame,w=o.notYetRenderableCount,P=!1;if(!E&&!S){let O=e._tilesToRender;for(let L=A;L<O.length;++L){let _=O[L];for(;_!==void 0&&_._lastSelectionResult!==ri.KICKED&&_!==n;)_._lastSelectionResult=ri.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=A,e._tileToUpdateHeights.length=T,mj(e,n),n._lastSelectionResult=ri.RENDERED;let B=p===ri.RENDERED;!B&&w>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=y,e._tileLoadQueueMedium.length=x,e._tileLoadQueueHigh.length=b,yg(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,P=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=B,B||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!P&&yg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ri.RENDERED,mj(e,n),yg(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===ri.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Fyt(e,t,n,i,o,r,a,s){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=Cee[t.level],p=d.southwest,g=d.southeast,m=d.northwest,A=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Sc(e,t,u,r,f,a,p),Sc(e,n,u,r,f,a,g),Sc(e,i,u,r,f,a,m),Sc(e,o,u,r,f,a,A)):(Sc(e,i,u,r,f,a,m),Sc(e,t,u,r,f,a,p),Sc(e,o,u,r,f,a,A),Sc(e,n,u,r,f,a,g)):c.latitude<t.rectangle.north?(Sc(e,n,u,r,f,a,g),Sc(e,t,u,r,f,a,p),Sc(e,o,u,r,f,a,A),Sc(e,i,u,r,f,a,m)):(Sc(e,o,u,r,f,a,A),Sc(e,i,u,r,f,a,m),Sc(e,n,u,r,f,a,g),Sc(e,t,u,r,f,a,p)),d.combine(s)}function kyt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&oe.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&oe.contains(n,e._cameraReferenceFrameOriginCartographic)}function Sc(e,t,n,i,o,r,a){if(n.computeTileVisibility(t,i,o)!==Qr.NONE)return Nyt(e,i,t,r,a);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),a.allAreRenderable=!0,a.anyWereRenderedLastFrame=!1,a.notYetRenderableCount=0,kyt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&yg(e,e._tileLoadQueueMedium,t,i);let s=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===s?t._lastSelectionResult:ri.NONE;c!==ri.CULLED_BUT_NEEDED&&c!==ri.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=ri.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(yg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=ri.CULLED):t._lastSelectionResult=ri.CULLED;t._lastSelectionResultFrame=i.frameNumber}function zyt(e,t,n){if(t.mode===ie.SCENE2D||t.camera.frustum instanceof fn||t.camera.frustum instanceof ga)return Uyt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=i*r/(o*a);return t.fog.enabled&&(s-=D.fog(o,t.fog.density)*t.fog.sse),s/=t.pixelRatio,s}function Uyt(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let a=t.context,s=a.drawingBufferWidth,c=a.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(s,c),d=u/f;return t.fog.enabled&&t.mode!==ie.SCENE2D&&(d-=D.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function mj(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function Vyt(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=zi()+e._loadQueueTimeSlice,a=e._tileProvider,s=Tee(e,t,a,r,n,!1);s=Tee(e,t,a,r,i,s),Tee(e,t,a,r,o,s)}function jyt(e,t){return e._loadPriority-t._loadPriority}function Tee(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(jyt);for(let a=0,s=o.length;a<s&&(zi()<i||!r);++a){let c=o[a];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var wS=new An,pj=new de,JA=new h,Gyt=[];function Hyt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Gyt;n.length=0;let i=e._tileToUpdateHeights,o=zi(),r=e._updateHeightsTimeSlice,a=o+r,s=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let y=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:ri.NONE;(y===ri.RENDERED||y===ri.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift();continue}let p=d.customData;l(d._customDataIterator)||(d._customDataIterator=p.values());let g=d._customDataIterator,m=!1,A;for(;!(A=g.next()).done;){let y=A.value,x=d.data.terrainData,b=l(x)&&x.wasCreatedByUpsampling();if(d.level>y.level&&!b){let T,E=d.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(l(E))T=E;else{if(l(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=h.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,u)),s===ie.SCENE3D){let S=u.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,wS.direction),w=u.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,wS.origin);if(!l(w)){let P=0;l(d.data.tileBoundingRegion)&&(P=d.data.tileBoundingRegion.minimumHeight);let O=Math.min(P,-11500),B=h.multiplyByScalar(S,Math.abs(O)+1,JA);h.subtract(y.positionOnEllipsoidSurface,B,wS.origin)}}else de.clone(y.positionCartographic,pj),pj.height=-11500,c.project(pj,JA),h.fromElements(JA.z,JA.x,JA.y,JA),h.clone(JA,wS.origin),h.clone(h.UNIT_X,wS.direction);T=d.data.pick(wS,s,c,!1,JA),l(T)&&d.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,T)}if(l(T)){if(l(y.callback)){let S=u.cartesianToCartographic(T,pj);y.callback(S)}y.level=d.level}}if(zi()>=a){m=!0;break}}if(m){d._customDataIterator=g;break}else d._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Wyt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let a=i[o];n.showTileThisFrame(a,t)}}var gj=Ld;function em(e){e=e??te.default;let t=new Ag({ellipsoid:e}),n=new sv;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Q8,this._material=void 0,this._surface=new gj({tileProvider:new sj({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new ye,this._undergroundColor=U.clone(U.BLACK),this._undergroundColorAlphaByDistance=new Ut(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new cj,vee(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Xt("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=te.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=D.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=D.PI*e.minimumRadius,this.nightFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*D.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=vn.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(em.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=oe.clone(oe.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)&&vee(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,vee(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=U.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 vee(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Ym,tR];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(X8),e._surfaceShaderSet.baseVertexShaderSource=new He({sources:[Ym,tR,K8],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new He({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function qyt(e){return function(t,n){let i=ce.distanceSquaredTo(t.pickBoundingSphere,e),o=ce.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var Yyt=[],Xyt={start:0,stop:0};em.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,a=Yyt;a.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let d=f.pickBoundingSphere;if(o!==ie.SCENE3D)f.pickBoundingSphere=d=ce.fromRectangleWithHeights2D(u.rectangle,r,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center);else if(l(f.renderedMesh))ce.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=ui.raySphere(e,d,Xyt);l(p)&&a.push(f)}a.sort(qyt(e.origin));let s,c=a.length;for(let u=0;u<c&&(s=a[u].pick(e,t.mode,t.mapProjection,n,i),!l(s));++u);return s};var Kyt=new de;em.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ie.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Kyt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var Qyt=new h,yve=new h,$yt=new de,Jyt=new An;function Eee(e,t){return l(e)&&oe.contains(e.rectangle,t)?e:void 0}em.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],!oe.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=Eee(n._southwestChild,e)||Eee(n._southeastChild,e)||Eee(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 a=this._surface._tileProvider.tilingScheme.projection,s=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,s,Qyt),u=Jyt,f=s.geodeticSurfaceNormal(c,u.direction),d=s.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),A=h.multiplyByScalar(f,Math.abs(m)+1,yve);h.subtract(c,A,u.origin)}let p=n.data.pick(u,ie.SCENE3D,a,!1,yve);if(l(p))return s.cartesianToCartographic(p,$yt).height};em.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};em.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 s=this._oceanNormalMapResource,c=s.url;if(l(c)){let u=this;s.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,a=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=a===ie.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))};em.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};em.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};em.prototype.isDestroyed=function(){return!1};em.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(),fe(this)};var _j=em;function Zyt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Aj=Zyt;var Mve={},ext=32.184,txt=2451545,xve=-.0529921,bve=-.1059842,Tve=13.0120009,Cve=13.3407154,Eve=.9856003,vve=26.4057084,Sve=13.064993,wve=.3287146,Ive=1.7484877,Dve=-.1589763,Pve=.0036096,Rve=.1643573,Ove=12.9590088,See=new Q;Mve.ComputeMoon=function(e,t){l(e)||(e=Q.now()),See=Q.addSeconds(e,ext,See);let n=Q.totalDays(See)-txt,i=n/oi.DAYS_PER_JULIAN_CENTURY,o=(125.045+xve*n)*D.RADIANS_PER_DEGREE,r=(250.089+bve*n)*D.RADIANS_PER_DEGREE,a=(260.008+Tve*n)*D.RADIANS_PER_DEGREE,s=(176.625+Cve*n)*D.RADIANS_PER_DEGREE,c=(357.529+Eve*n)*D.RADIANS_PER_DEGREE,u=(311.589+vve*n)*D.RADIANS_PER_DEGREE,f=(134.963+Sve*n)*D.RADIANS_PER_DEGREE,d=(276.617+wve*n)*D.RADIANS_PER_DEGREE,p=(34.226+Ive*n)*D.RADIANS_PER_DEGREE,g=(15.134+Dve*n)*D.RADIANS_PER_DEGREE,m=(119.743+Pve*n)*D.RADIANS_PER_DEGREE,A=(239.961+Rve*n)*D.RADIANS_PER_DEGREE,y=(25.053+Ove*n)*D.RADIANS_PER_DEGREE,x=Math.sin(o),b=Math.sin(r),T=Math.sin(a),E=Math.sin(s),S=Math.sin(c),w=Math.sin(u),P=Math.sin(f),O=Math.sin(d),B=Math.sin(p),L=Math.sin(g),_=Math.sin(m),C=Math.sin(A),v=Math.sin(y),I=Math.cos(o),M=Math.cos(r),N=Math.cos(a),j=Math.cos(s),k=Math.cos(c),V=Math.cos(u),F=Math.cos(f),W=Math.cos(d),q=Math.cos(p),J=Math.cos(g),H=Math.cos(m),Z=Math.cos(A),K=Math.cos(y),le=(269.9949+.0031*i-3.8787*x-.1204*b+.07*T-.0172*E+.0072*w-.0052*L+.0043*v)*D.RADIANS_PER_DEGREE,me=(66.5392+.013*i+1.5419*I+.0239*M-.0278*N+.0068*j-.0029*V+9e-4*F+8e-4*J-9e-4*K)*D.RADIANS_PER_DEGREE,ae=(38.3213+13.17635815*n-14e-13*n*n+3.561*x+.1208*b-.0642*T+.0158*E+.0252*S-.0066*w-.0047*P-.0046*O+.0028*B+.0052*L+.004*_+.0019*C-.0044*v)*D.RADIANS_PER_DEGREE,be=(13.17635815-14e-13*(2*n)+3.561*I*xve+.1208*M*bve-.0642*N*Tve+.0158*j*Cve+.0252*k*Eve-.0066*V*vve-.0047*F*Sve-.0046*W*wve+.0028*q*Ive+.0052*J*Dve+.004*H*Pve+.0019*Z*Rve-.0044*K*Ove)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new Aj),t.rightAscension=le,t.declination=me,t.rotation=ae,t.rotationRate=be,t};var yj=Mve;function Bve(e){(!l(e)||typeof e!="function")&&(e=yj.ComputeMoon),this._computeFunction=e}var nxt=new h,ixt=new h,oxt=new h;function rxt(e,t,n){let i=nxt;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=oxt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let a=h.cross(r,i,ixt);return l(n)||(n=new $),n[0]=i.x,n[1]=a.x,n[2]=r.x,n[3]=i.y,n[4]=a.y,n[5]=r.y,n[6]=i.z,n[7]=a.z,n[8]=r.z,n}var axt=new $,sxt=new Le;Bve.prototype.evaluate=function(e,t){l(e)||(e=Q.now());let n=this._computeFunction(e),i=rxt(n.rightAscension,n.declination,t),o=D.zeroToTwoPi(n.rotation),r=Le.fromAxisAngle(h.UNIT_Z,o,sxt),a=$.fromQuaternion(Le.conjugate(r,r),axt);return $.multiply(a,i,i)};var xj=Bve;var sR=`uniform vec3 u_radii;
  11278. uniform vec3 u_oneOverEllipsoidRadiiSquared;
  11279. in vec3 v_positionEC;
  11280. vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)
  11281. {
  11282. vec3 positionEC = czm_pointAlongRay(ray, intersection);
  11283. vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;
  11284. vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));
  11285. vec3 sphericalNormal = normalize(positionMC / u_radii);
  11286. vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates
  11287. vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates
  11288. vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal);
  11289. vec3 positionToEyeEC = -positionEC;
  11290. czm_materialInput materialInput;
  11291. materialInput.s = st.s;
  11292. materialInput.st = st;
  11293. materialInput.str = (positionMC + u_radii) / u_radii;
  11294. materialInput.normalEC = normalEC;
  11295. materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
  11296. materialInput.positionToEyeEC = positionToEyeEC;
  11297. czm_material material = czm_getMaterial(materialInput);
  11298. #ifdef ONLY_SUN_LIGHTING
  11299. return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);
  11300. #else
  11301. return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  11302. #endif
  11303. }
  11304. void main()
  11305. {
  11306. // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii
  11307. // in the vertex shader. Only when it is larger than some constant, march along the ray.
  11308. // Otherwise perform one intersection test which will be the common case.
  11309. // Test if the ray intersects a sphere with the ellipsoid's maximum radius.
  11310. // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test
  11311. // may cause false negatives. This will discard fragments before marching the ray forward.
  11312. float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;
  11313. vec3 direction = normalize(v_positionEC);
  11314. vec3 ellipsoidCenter = czm_modelView[3].xyz;
  11315. float t1 = -1.0;
  11316. float t2 = -1.0;
  11317. float b = -2.0 * dot(direction, ellipsoidCenter);
  11318. float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;
  11319. float discriminant = b * b - 4.0 * c;
  11320. if (discriminant >= 0.0) {
  11321. t1 = (-b - sqrt(discriminant)) * 0.5;
  11322. t2 = (-b + sqrt(discriminant)) * 0.5;
  11323. }
  11324. if (t1 < 0.0 && t2 < 0.0) {
  11325. discard;
  11326. }
  11327. float t = min(t1, t2);
  11328. if (t < 0.0) {
  11329. t = 0.0;
  11330. }
  11331. // March ray forward to intersection with larger sphere and find
  11332. czm_ray ray = czm_ray(t * direction, direction);
  11333. vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);
  11334. czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
  11335. if (czm_isEmpty(intersection))
  11336. {
  11337. discard;
  11338. }
  11339. // If the viewer is outside, compute outsideFaceColor, with normals facing outward.
  11340. vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);
  11341. // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.
  11342. vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);
  11343. out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);
  11344. out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);
  11345. #if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
  11346. t = (intersection.start != 0.0) ? intersection.start : intersection.stop;
  11347. vec3 positionEC = czm_pointAlongRay(ray, t);
  11348. vec4 positionCC = czm_projection * vec4(positionEC, 1.0);
  11349. #ifdef LOG_DEPTH
  11350. czm_writeLogDepth(1.0 + positionCC.w);
  11351. #else
  11352. float z = positionCC.z / positionCC.w;
  11353. float n = czm_depthRange.near;
  11354. float f = czm_depthRange.far;
  11355. gl_FragDepth = (z * (f - n) + f + n) * 0.5;
  11356. #endif
  11357. #endif
  11358. }
  11359. `;var cR=`in vec3 position;
  11360. uniform vec3 u_radii;
  11361. out vec3 v_positionEC;
  11362. void main()
  11363. {
  11364. // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.
  11365. // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry,
  11366. // but doing it here allows us to change the radii without rewriting the vertex data, and
  11367. // allows all ellipsoids to reuse the same vertex data.
  11368. vec4 p = vec4(u_radii * position, 1.0);
  11369. vec4 pEC = czm_modelView * p;
  11370. v_positionEC = pEC.xyz; // position in eye coordinates
  11371. gl_Position = czm_projection * pEC;
  11372. // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums
  11373. // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the
  11374. // ellipsoid (does not write depth) that was rendered in the farther frustum.
  11375. //
  11376. // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates
  11377. // artifacts since some fragments can be alpha blended twice. This is solved by only rendering
  11378. // the ellipsoid in the closest frustum to the viewer.
  11379. gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);
  11380. czm_vertexLogDepth();
  11381. }
  11382. `;var wee={position:0};function bj(e){e=e??G.EMPTY_OBJECT,this.center=h.clone(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=R.clone(e.modelMatrix??R.IDENTITY),this._modelMatrix=new R,this._computedModelMatrix=new R,this.show=e.show??!0,this.material=e.material??qi.fromType(qi.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=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:e._owner??this}),this._pickCommand=new tt({owner: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 cxt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Uc.createGeometry(Uc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Ne.POSITION_ONLY}));return t=Fn.fromGeometry({context:e,geometry:n,attributeLocations:wee,bufferUsage:Oe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}bj.prototype.update=function(e){if(!this.show||e.mode!==ie.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=Ve.fromCache({cull:{enabled:!0,face:Li.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?Jt.ALPHA_BLEND:void 0})),l(this._va)||(this._va=cxt(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.clone(r,this._radii);let A=this._oneOverEllipsoidRadiiSquared;A.x=1/(r.x*r.x),A.y=1/(r.y*r.y),A.z=1/(r.z*r.z),o=!0}(!R.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(R.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),R.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 a=this._material!==this.material;this._material=this.material,this._material.update(t);let s=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(a||s||i||u)&&(d=new He({sources:[cR]}),p=new He({sources:[this.material.shaderSource,sR]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:wee}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=It(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(f)),m.pick){let A=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})),(a||s||!l(this._pickSP)||u)&&(d=new He({sources:[cR]}),p=new He({sources:[this.material.shaderSource,sR],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:wee}),A.vertexArray=this._va,A.renderState=this._rs,A.shaderProgram=this._pickSP,A.uniformMap=It(It(this._uniforms,this._pickUniforms),this.material._uniforms),A.executeInClosestFrustum=n),A.boundingVolume=this._boundingSphere,A.modelMatrix=this._computedModelMatrix,A.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(A)}};bj.prototype.isDestroyed=function(){return!1};bj.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(),fe(this)};var Tj=bj;function lR(e){e=e??G.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Xt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??te.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new Tj({radii:this.ellipsoid.radii,material:qi.fromType(qi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new xj}Object.defineProperties(lR.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var Cj=new $,lxt=new $,uxt=new h,Ej=[];lR.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(pt.computeIcrfToFixedMatrix(n,Cj))||pt.computeTemeToPseudoFixedMatrix(n,Cj);let i=this._axes.evaluate(n,lxt);$.transpose(i,i),$.multiply(Cj,i,i);let o=Vy.computeMoonPositionInEarthInertialFrame(n,uxt);$.multiplyByVector(Cj,o,o),R.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=Ej,Ej.length=0,t.update(e),e.commandList=r,Ej.length===1?Ej[0]:void 0};lR.prototype.isDestroyed=function(){return!1};lR.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),fe(this)};var vj=lR;var Iee=[],Dee=[];function fxt(e,t,n,i,o,r){let a=o-i+1,s=r-o,c=Iee,u=Dee,f,d;for(f=0;f<a;++f)c[f]=e[i+f];for(d=0;d<s;++d)u[d]=e[o+d+1];f=0,d=0;for(let p=i;p<=r;++p){let g=c[f],m=u[d];f<a&&(d>=s||t(g,m,n)<=0)?(e[p]=g,++f):d<s&&(e[p]=m,++d)}}function Pee(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);Pee(e,t,n,i,r),Pee(e,t,n,r+1,o),fxt(e,t,n,i,r,o)}function dxt(e,t,n){let i=e.length,o=Math.ceil(i*.5);Iee.length=o,Dee.length=o,Pee(e,t,n,0,i-1),Iee.length=0,Dee.length=0}var xg=dxt;function rl(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 Sj=new h;Object.defineProperties(rl.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,Sj),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,a;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,Sj);let s=o*o*n;a=h.add(e,h.multiplyByScalar(r,s,Sj),Sj)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=a,this._cameraPosition=e}}});rl.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new rl(e,t)};var Nve=new h;rl.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,Nve),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 hxt=new h;rl.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,hxt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,Nve),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),a=this._occluderRadius*this._occluderRadius,s=n*n;return(this._horizonDistance*this._horizonDistance+a)*s>r*a?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+s>r)}return!0}return!1};var mxt=new h;rl.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Qr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,mxt),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 a=h.magnitudeSquared(i);return o*o+n*n<a?Qr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,a<o*o+n*n?Qr.FULL:Qr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Qr.PARTIAL:Qr.FULL))}}return Qr.NONE};var wj=new h;rl.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,a=n.length,s=h.normalize(h.subtract(i,o,wj),wj),c=-h.dot(s,o),u=rl._anyRotationVector(o,s,c),f=rl._horizonToPlaneNormalDotProduct(e,s,c,u,n[0]);if(!f)return;let d;for(let g=1;g<a;++g){if(d=rl._horizonToPlaneNormalDotProduct(e,s,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=r/f;return h.add(o,h.multiplyByScalar(s,p,wj),wj)};var pxt=[];rl.computeOccludeePointFromRectangle=function(e,t){t=t??te.default;let n=oe.subsample(e,t,0,pxt),i=ce.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return rl.computeOccludeePoint(new ce(o,t.minimumRadius),i.center,n)};var gxt=new h;rl._anyRotationVector=function(e,t,n){let i=h.abs(t,gxt),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,a;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,a=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,a=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,a=h.UNIT_Z);let s=(h.dot(t,i)+n)/-h.dot(t,a);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(a,s,r),i),e,i),i)};var _xt=new h;rl._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,_xt);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let a=h.cross(t,r,r);if(h.magnitude(a)>D.EPSILON13)return h.normalize(a,new h)}return o};var Ree=new h,Axt=new h,Ij=new h,Lve=new h;rl._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,Ree),a=h.clone(e.center,Axt),s=e.radius,c=h.subtract(a,r,Ij),u=h.magnitudeSquared(c),f=s*s;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),y=p*m*p;c=h.normalize(c,c);let x=h.add(r,h.multiplyByScalar(c,y,Lve),Lve),b=Math.sqrt(d-y*y),T=this._rotationVector(a,t,n,r,i),E=h.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,Ree);E=h.normalize(E,E);let S=h.multiplyByScalar(E,b,Ree);T=h.normalize(h.subtract(h.add(x,S,Ij),a,Ij),Ij);let w=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(x,S,T),a,T),T);let P=h.dot(t,T);return w<P?w:P};var Dj=rl;function Up(e){e=e??G.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new is,this._perspectiveMatrix=new R,this._infinitePerspective=new R}function Oee(e){let{top:t,bottom:n,right:i,left:o,near:r,far:a}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||a!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=a,e._perspectiveMatrix=R.computePerspectiveOffCenter(o,i,n,t,r,a,e._perspectiveMatrix),e._infinitePerspective=R.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Up.prototype,{projectionMatrix:{get:function(){return Oee(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return Oee(this),this._infinitePerspective}}});var yxt=new h,xxt=new h,bxt=new h,Txt=new h;Up.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,a=this.right,s=this.left,c=this.near,u=this.far,f=h.cross(t,n,yxt),d=xxt;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=bxt;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=Txt;h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};Up.prototype.getPixelDimensions=function(e,t,n,i,o){Oee(this);let r=1/this.near,a=this.top*r,s=2*i*n*a/t;a=this.right*r;let c=2*i*n*a/e;return o.x=c,o.y=s,o};Up.prototype.clone=function(e){return l(e)||(e=new Up),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};Up.prototype.equals=function(e){return l(e)&&e instanceof Up&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Up.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Up&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var Ru=Up;function Ou(e){e=e??G.EMPTY_OBJECT,this._offCenterFrustum=new Ru,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}Ou.packedLength=6;Ou.pack=function(e,t,n){return n=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};Ou.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ou),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 tm(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(Ou.prototype,{projectionMatrix:{get:function(){return tm(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return tm(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return tm(this),this._fovy}},sseDenominator:{get:function(){return tm(this),this._sseDenominator}},offCenterFrustum:{get:function(){return tm(this),this._offCenterFrustum}}});Ou.prototype.computeCullingVolume=function(e,t,n){return tm(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Ou.prototype.getPixelDimensions=function(e,t,n,i,o){return tm(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Ou.prototype.clone=function(e){return l(e)||(e=new Ou),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};Ou.prototype.equals=function(e){return!l(e)||!(e instanceof Ou)?!1:(tm(this),tm(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Ou.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Ou)?!1:(tm(this),tm(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Gi=Ou;var Pj=`in vec2 v_textureCoordinates;
  11383. const float M_PI = 3.141592653589793;
  11384. float vdcRadicalInverse(int i)
  11385. {
  11386. float r;
  11387. float base = 2.0;
  11388. float value = 0.0;
  11389. float invBase = 1.0 / base;
  11390. float invBi = invBase;
  11391. for (int x = 0; x < 100; x++)
  11392. {
  11393. if (i <= 0)
  11394. {
  11395. break;
  11396. }
  11397. r = mod(float(i), base);
  11398. value += r * invBi;
  11399. invBi *= invBase;
  11400. i = int(float(i) * invBase);
  11401. }
  11402. return value;
  11403. }
  11404. vec2 hammersley2D(int i, int N)
  11405. {
  11406. return vec2(float(i) / float(N), vdcRadicalInverse(i));
  11407. }
  11408. vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
  11409. {
  11410. float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
  11411. float phi = 2.0 * M_PI * xi.x;
  11412. float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
  11413. float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
  11414. vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
  11415. vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
  11416. vec3 tangentX = normalize(cross(upVector, N));
  11417. vec3 tangentY = cross(N, tangentX);
  11418. return tangentX * H.x + tangentY * H.y + N * H.z;
  11419. }
  11420. /**
  11421. * Estimate the geometric self-shadowing of the microfacets in a surface,
  11422. * using the Smith Joint GGX visibility function.
  11423. * Note: Vis = G / (4 * NdotL * NdotV)
  11424. * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
  11425. * see Real-Time Rendering. Page 331 to 336.
  11426. * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
  11427. *
  11428. * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
  11429. * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
  11430. * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
  11431. */
  11432. float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
  11433. {
  11434. float alphaRoughnessSq = alphaRoughness * alphaRoughness;
  11435. float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
  11436. float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
  11437. float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0
  11438. if (GGX > 0.0)
  11439. {
  11440. return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0
  11441. }
  11442. return 0.0;
  11443. }
  11444. vec2 integrateBrdf(float roughness, float NdotV)
  11445. {
  11446. vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
  11447. float A = 0.0;
  11448. float B = 0.0;
  11449. const int NumSamples = 1024;
  11450. float alphaRoughness = roughness * roughness;
  11451. for (int i = 0; i < NumSamples; i++)
  11452. {
  11453. vec2 xi = hammersley2D(i, NumSamples);
  11454. vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0));
  11455. vec3 L = 2.0 * dot(V, H) * H - V;
  11456. float NdotL = clamp(L.z, 0.0, 1.0);
  11457. float NdotH = clamp(H.z, 0.0, 1.0);
  11458. float VdotH = clamp(dot(V, H), 0.0, 1.0);
  11459. if (NdotL > 0.0)
  11460. {
  11461. float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
  11462. float G_Vis = 4.0 * G * VdotH * NdotL / NdotH;
  11463. float Fc = pow(1.0 - VdotH, 5.0);
  11464. A += (1.0 - Fc) * G_Vis;
  11465. B += Fc * G_Vis;
  11466. }
  11467. }
  11468. return vec2(A, B) / float(NumSamples);
  11469. }
  11470. void main()
  11471. {
  11472. out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
  11473. }
  11474. `;function uR(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(uR.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Cxt(e,t,n){let i=t.createViewportQuadCommand(Pj,{framebuffer:n,renderState:Ve.fromCache({viewport:new Je(0,0,256,256)})});e._drawCommand=i}uR.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Dt({context:t,width:256,height:256,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:jt.NEAREST});this._colorTexture=n;let i=new pa({context:t,colorTextures:[n],destroyAttachments:!1});Cxt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};uR.prototype.isDestroyed=function(){return!1};uR.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),fe(this)};var Rj=uR;var Uve={};function Ext(e,t,n){let i,o,r;if(e instanceof Gi){let a=Math.tan(.5*e.fovy);return i=e.near,o=e.near*a,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof Ru)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var vxt=new h,Fve=new h;function Vve(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),a=n(.5),s=a-o,c=a-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/s;return D.lerp(e,-D.PI_OVER_TWO,p)}let d=(f-r)/c;return D.lerp(-D.PI_OVER_TWO,t,1-d)}}return function(o){return D.lerp(e,t,o)}}function Bee(e,t,n,i,o){let r=o,a=Math.max(n,i);if(!l(r)){let s=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(s,c,vxt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),Fve)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),Fve));r=Math.min(Ext(d,g,m)*.2,1e9)}if(a<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(s){return D.lerp(n,i,s)}}function fR(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var jve=new h;function Sxt(e,t,n,i,o,r,a,s){let c=e.camera,u=h.clone(c.position,jve),f=c.pitch,d=fR(c.heading,i),p=fR(c.roll,r),g=Bee(c,n,u.z,n.z,a),m=Vve(f,o,g,s);function A(y){let x=y.time/t;c.setView({orientation:{heading:D.lerp(d,i,x),pitch:m(x),roll:D.lerp(p,r,x)}}),z.lerp(u,n,x,c.position),c.position.z=g(x)}return A}function wxt(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function Ixt(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var Dxt=new de,Pxt=new de;function Rxt(e,t,n,i,o,r,a,s,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=de.clone(f.positionCartographic,Dxt),m=f.pitch,A=fR(f.heading,i),y=fR(f.roll,r),x=p.cartesianToCartographic(n,Pxt);g.longitude=D.zeroToTwoPi(g.longitude),x.longitude=D.zeroToTwoPi(x.longitude);let b=!1;if(l(s)){let w=D.zeroToTwoPi(s),P=Math.min(g.longitude,x.longitude),O=Math.max(g.longitude,x.longitude),B=w>=P&&w<=O;if(l(c)){let L=Math.abs(g.longitude-x.longitude),_=D.TWO_PI-L;(B?L:_)<(B?_:L)*c&&!B&&(b=!0)}else B||(b=!0)}b?wxt(g,x):Ixt(g,x);let T=Bee(f,n,g.height,x.height,a),E=Vve(m,o,T,u);function S(){let w=g.longitude,P=x.longitude,O=g.latitude,B=x.latitude;return function(_){let C=_.time/t,v=h.fromRadians(D.lerp(w,P,C),D.lerp(O,B,C),T(C),p);f.setView({destination:v,orientation:{heading:D.lerp(A,i,C),pitch:E(C),roll:D.lerp(y,r,C)}})}}return S()}function Oxt(e,t,n,i,o,r,a){let s=e.camera,c=h.clone(s.position,jve),u=fR(s.heading,i),f=s.frustum.right-s.frustum.left,d=Bee(s,n,f,n.z,a);function p(g){let m=g.time/t;s.setView({orientation:{heading:D.lerp(u,i,m)}}),z.lerp(c,n,m,s.position);let A=d(m),y=s.frustum,x=y.top/y.right,b=(A-(y.right-y.left))*.5;y.right+=b,y.left-=b,y.top=x*y.right,y.bottom=-y.top}return p}var kve=new de,Mxt=new h;function Mee(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function zve(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Uve.createTween=function(e,t){t=t??G.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===ie.MORPHING)return Mee();let o=t.convert??!0,r=e.mapProjection,a=r.ellipsoid,s=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;o&&i!==ie.SCENE3D&&(a.cartesianToCartographic(n,kve),n=r.project(kve,Mxt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let A=t.heading??0,y=t.pitch??-D.PI_OVER_TWO,x=t.roll??0,b=e.screenSpaceCameraController;b.enableInputs=!1;let T=zve(b,t.complete),E=zve(b,t.cancel),S=p.frustum,w=e.mode===ie.SCENE2D;if(w=w&&z.equalsEpsilon(p.position,n,D.EPSILON6),w=w&&D.equalsEpsilon(Math.max(S.right-S.left,S.top-S.bottom),n.z,D.EPSILON6),w=w||e.mode!==ie.SCENE2D&&h.equalsEpsilon(n,p.position,D.EPSILON10),w=w&&D.equalsEpsilon(D.negativePiToPi(A),D.negativePiToPi(p.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(y),D.negativePiToPi(p.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(x),D.negativePiToPi(p.roll),D.EPSILON10),w)return Mee(T,E);let P=new Array(4);if(P[ie.SCENE2D]=Oxt,P[ie.SCENE3D]=Rxt,P[ie.COLUMBUS_VIEW]=Sxt,m<=0)return Mee(function(){P[i](e,1,n,A,y,x,s,c,u,f)({time:1}),typeof T=="function"&&T()},E);let O=P[i](e,m,n,A,y,x,s,c,u,f);if(!l(d)){let B=p.positionCartographic.height,L=i===ie.SCENE3D?a.cartesianToCartographic(n).height:n.z;B>L&&B>11500?d=Oa.CUBIC_OUT:d=Oa.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:O,complete:T,cancel:E}};var Oj=Uve;var Gve={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(Gve);var Mu=Gve;function nn(e){this._scene=e,this._transform=R.clone(R.IDENTITY),this._invTransform=R.clone(R.IDENTITY),this._actualTransform=R.clone(R.IDENTITY),this._actualInvTransform=R.clone(R.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new de,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 Gi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.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 ye,this._moveEnd=new ye,this._changed=new ye,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 R,this._invViewMatrix=new R,$ve(this),this._mode=ie.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new de(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,lSe(this,nn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*nn.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}nn.TRANSFORM_2D=new R(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);nn.TRANSFORM_2D_INVERSE=R.inverseTransformation(nn.TRANSFORM_2D,new R);nn.DEFAULT_VIEW_RECTANGLE=oe.fromDegrees(-95,-20,-70,90);nn.DEFAULT_VIEW_FACTOR=.5;nn.DEFAULT_OFFSET=new Hh(0,-D.PI_OVER_FOUR,0);function $ve(e){R.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),R.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),R.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Bxt(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=zi()):e.timeSinceMoved=Math.max(zi()-e._lastMovedTimestamp,0)/1e3}}nn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ie.SCENE2D};nn.prototype._updateCameraChanged=function(){let e=this;if(Bxt(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)%D.TWO_PI;i=i>D.PI?D.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 a=Math.abs(e._changedRoll-r)%D.TWO_PI;a=a>D.PI?D.TWO_PI-a:a;let s=a/Math.PI;if(s>t&&(e._changedRoll=r),(s>t||o>t)&&e._changed.raiseEvent(Math.max(s,o)),e._mode===ie.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,m=e.frustum,A=e._changedFrustum,y=p.x+m.left,x=p.x+m.right,b=g.x+A.left,T=g.x+A.right,E=p.y+m.bottom,S=p.y+m.top,w=g.y+A.bottom,P=g.y+A.top,O=Math.max(y,b),B=Math.min(x,T),L=Math.max(E,w),_=Math.min(S,P),C;if(O>=B||L>=S)C=1;else{let v=A;y<b&&x>T&&E<w&&S>P&&(v=m),C=1-(B-O)*(_-L)/((v.right-v.left)*(v.top-v.bottom))}C>t&&(e._changed.raiseEvent(C),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=D.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function Lxt(e){pt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Nxt=new de,Fxt=new h,Mj=new h,kxt=new se,zxt=new se,Uxt=new se,Vxt=new se,jxt=new se;function Gxt(e){let t=e._projection,n=t.ellipsoid,i=R.getColumn(e._transform,3,kxt),o=n.cartesianToCartographic(i,Nxt),r=t.project(o,Fxt),a=zxt;a.x=r.z,a.y=r.x,a.z=r.y,a.w=1;let s=se.clone(se.UNIT_X,jxt),c=se.add(R.getColumn(e._transform,0,Mj),i,Mj);n.cartesianToCartographic(c,o),t.project(o,r);let u=Uxt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,a,u),u.x=0;let f=Vxt;if(h.magnitudeSquared(u)>D.EPSILON10)h.cross(s,u,f);else{let d=se.add(R.getColumn(e._transform,1,Mj),i,Mj);n.cartesianToCartographic(d,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,h.subtract(f,a,f),f.x=0,h.magnitudeSquared(f)<D.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}h.cross(f,s,u),h.normalize(u,u),h.cross(s,u,f),h.normalize(f,f),R.setColumn(e._actualTransform,0,u,e._actualTransform),R.setColumn(e._actualTransform,1,f,e._actualTransform),R.setColumn(e._actualTransform,2,s,e._actualTransform),R.setColumn(e._actualTransform,3,a,e._actualTransform)}var Lee=new h;function sl(e){let t=e._mode,n=!1,i=0;t===ie.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 a=e._direction,s=!h.equals(a,e.direction);s&&(h.normalize(e.direction,e.direction),a=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(R.inverseTransformation(e._transform,e._invTransform),e._mode===ie.COLUMBUS_VIEW||e._mode===ie.SCENE2D?R.equals(R.IDENTITY,e._transform)?R.clone(nn.TRANSFORM_2D,e._actualTransform):e._mode===ie.COLUMBUS_VIEW?Lxt(e):Gxt(e):R.clone(e._transform,e._actualTransform),R.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=R.multiplyByPoint(g,o,e._positionWC),t===ie.SCENE3D||t===ie.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=Lee;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===ie.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(s||u||d){let m=h.dot(a,h.cross(c,f,Lee));if(Math.abs(1-m)>D.EPSILON2){let A=1/h.magnitudeSquared(c),y=h.dot(c,a)*A,x=h.multiplyByScalar(a,y,Lee);c=h.normalize(h.subtract(c,x,e._up),e._up),h.clone(c,e.up),f=h.cross(a,c,e._right),h.clone(f,e.right)}}(s||p)&&(e._directionWC=R.multiplyByPointAsVector(g,a,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=R.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=R.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||s||u||d||p)&&$ve(e)}function Jve(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function Zve(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function eSe(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var Nj=new R,Fj=new R;Object.defineProperties(nn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return sl(this),this._invTransform}},viewMatrix:{get:function(){return sl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return sl(this),this._invViewMatrix}},positionCartographic:{get:function(){return sl(this),this._positionCartographic}},positionWC:{get:function(){return sl(this),this._positionWC}},directionWC:{get:function(){return sl(this),this._directionWC}},upWC:{get:function(){return sl(this),this._upWC}},rightWC:{get:function(){return sl(this),this._rightWC}},heading:{get:function(){if(this._mode!==ie.MORPHING){let e=this._projection.ellipsoid,t=R.clone(this._transform,Nj),n=pt.eastNorthUpToFixedFrame(this.positionWC,e,Fj);this._setTransform(n);let i=Jve(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ie.MORPHING){let e=this._projection.ellipsoid,t=R.clone(this._transform,Nj),n=pt.eastNorthUpToFixedFrame(this.positionWC,e,Fj);this._setTransform(n);let i=Zve(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ie.MORPHING){let e=this._projection.ellipsoid,t=R.clone(this._transform,Nj),n=pt.eastNorthUpToFixedFrame(this.positionWC,e,Fj);this._setTransform(n);let i=eSe(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}}});nn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ie.MORPHING,t=this._mode===ie.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===ie.SCENE2D&&oSe(this,this.position)};var Hxt=new h,Wxt=new h,qxt=new h;nn.prototype._setTransform=function(e){let t=h.clone(this.positionWC,Hxt),n=h.clone(this.upWC,Wxt),i=h.clone(this.directionWC,qxt);R.clone(e,this._transform),this._transformChanged=!0,sl(this);let o=this._actualInvTransform;R.multiplyByPoint(o,t,this.position),R.multiplyByPointAsVector(o,i,this.direction),R.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),sl(this)};var Yxt=new z,Xxt=new An,Kxt=new h,Qxt=new h;function tSe(e){if(!R.equals(R.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=Yxt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let s=e.getPickRay(i,Xxt);o=n.pickWorldCoordinates(s,t,!0,Kxt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Qxt));let a;if(l(o)||l(r)){let s=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;a=Math.min(s,c)}else a=Math.max(e.positionCartographic.height,0);return a}nn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof fn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=tSe(this)))};var kj=new h,Uee=new R,$xt=new R,Vee=new Le,jee=new $,nSe=new de;function Jxt(e,t,n){let i=R.clone(e.transform,Uee),o=pt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,$xt);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,Vee),a=$.fromQuaternion(r,jee);$.getColumn(a,0,e.direction),$.getColumn(a,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Zxt(e,t,n,i){let o=R.clone(e.transform,Uee);if(e._setTransform(R.IDENTITY),!h.equals(t,e.positionWC)){if(i){let s=e._projection,c=s.ellipsoid.cartesianToCartographic(t,nSe);t=s.project(c,kj)}h.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,Vee),a=$.fromQuaternion(r,jee);$.getColumn(a,0,e.direction),$.getColumn(a,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function ebt(e,t,n,i){let o=R.clone(e.transform,Uee);if(e._setTransform(R.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,nSe);t=c.project(u,kj)}z.clone(t,e.position);let r=-t.z*.5,a=-r,s=e.frustum;if(a>r){let c=s.top/s.right;s.right=a,s.left=r,s.top=s.right*c,s.bottom=-s.top}}if(e._scene.mapMode2D===Mu.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let r=Le.fromHeadingPitchRoll(n,Vee),a=$.fromQuaternion(r,jee);$.getColumn(a,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var tbt=new h,nbt=new h,ibt=new h;function iSe(e,t,n,i){let o=h.clone(n.direction,tbt),r=h.clone(n.up,nbt);if(e._scene.mode===ie.SCENE3D){let s=e._projection.ellipsoid,c=pt.eastNorthUpToFixedFrame(t,s,Nj),u=R.inverseTransformation(c,Fj);R.multiplyByPointAsVector(u,o,o),R.multiplyByPointAsVector(u,r,r)}let a=h.cross(o,r,ibt);return i.heading=Jve(o,r),i.pitch=Zve(o),i.roll=eSe(o,r,a),i}var zee={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},IS=new kc;nn.prototype.setView=function(e){e=e??G.EMPTY_OBJECT;let t=e.orientation??G.EMPTY_OBJECT,n=this._mode;if(n===ie.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??h.clone(this.positionWC,kj);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,kj),i=!1),l(t.direction)&&(t=iSe(this,o,t,zee.orientation)),IS.heading=t.heading??0,IS.pitch=t.pitch??-D.PI_OVER_TWO,IS.roll=t.roll??0,n===ie.SCENE3D?Jxt(this,o,IS):n===ie.SCENE2D?ebt(this,o,IS,i):Zxt(this,o,IS,i)};var obt=new h;nn.prototype.flyHome=function(e){let t=this._mode;if(t===ie.MORPHING&&this._scene.completeMorph(),t===ie.SCENE2D)this.flyTo({destination:nn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:R.IDENTITY});else if(t===ie.SCENE3D){let n=this.getRectangleCameraCoordinates(nn.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*nn.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:R.IDENTITY})}else if(t===ie.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,obt).z),roll:0},endTransform:R.IDENTITY,convert:!1})}};nn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),sl(this),R.multiplyByVector(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),sl(this),R.multiplyByPoint(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),sl(this),R.multiplyByPointAsVector(this._actualInvTransform,e,t)};nn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),sl(this),R.multiplyByVector(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),sl(this),R.multiplyByPoint(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),sl(this),R.multiplyByPointAsVector(this._actualTransform,e,t)};function oSe(e,t){let n=e._scene.mapMode2D===Mu.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,a;n?(a=i,r=-a):(a=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=a),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var Hve=new h;nn.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,Hve),h.add(n,Hve,n),this._mode===ie.SCENE2D&&oSe(this,n),this._adjustOrthographicFrustum(!0)};nn.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===ie.SCENE2D?zj(this,e):this.move(this.direction,e)};nn.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===ie.SCENE2D?zj(this,-e):this.move(this.direction,-e)};nn.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};nn.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};nn.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};nn.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};nn.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==ie.SCENE2D&&this.look(this.up,-e)};nn.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==ie.SCENE2D&&this.look(this.up,e)};nn.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==ie.SCENE2D&&this.look(this.right,-e)};nn.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==ie.SCENE2D&&this.look(this.right,e)};var rbt=new Le,abt=new $;nn.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,rbt),o=$.fromQuaternion(i,abt),r=this.direction,a=this.up,s=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,a,a),$.multiplyByVector(o,s,s)};nn.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};nn.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var sbt=new Le,cbt=new $;nn.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,sbt),o=$.fromQuaternion(i,cbt);$.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)};nn.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,rSe(this,e)};nn.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,rSe(this,-e)};var lbt=new h,ubt=new h,fbt=new h,Wve=new h;function rSe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,D.EPSILON2)){let i=h.normalize(n,lbt),o=h.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,Wve),D.EPSILON2);if(!o&&!r){let a=h.normalize(e.constrainedAxis,ubt),s=h.dot(i,a),c=D.acosClamped(s);t>0&&t>c&&(t=c-D.EPSILON4),s=h.dot(i,h.negate(a,Wve)),c=D.acosClamped(s),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=h.cross(a,i,fbt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}nn.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,aSe(this,-e)};nn.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,aSe(this,e)};function aSe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function zj(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,a=e._maxCoord.y;e._scene.mapMode2D===Mu.ROTATE&&(a*=e.maximumZoomFactor),r>a&&(r=a,o=-a),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,a=e._maxCoord.x;e._scene.mapMode2D===Mu.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,r=-a),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 sSe(e,t){e.move(e.direction,t)}nn.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===ie.SCENE2D?zj(this,e):sSe(this,e)};nn.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===ie.SCENE2D?zj(this,-e):sSe(this,-e)};nn.prototype.getMagnitude=function(){if(this._mode===ie.SCENE3D)return h.magnitude(this.position);if(this._mode===ie.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ie.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var dbt=new R;nn.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??te.default,o=pt.eastNorthUpToFixedFrame(e,i,dbt);this.lookAtTransform(o,t)};var hbt=new h,mbt=new Le,pbt=new Le,gbt=new $;function cSe(e,t,n){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let i=Le.fromAxisAngle(h.UNIT_Y,-t,mbt),o=Le.fromAxisAngle(h.UNIT_Z,-e,pbt),r=Le.multiply(o,i,o),a=$.fromQuaternion(r,gbt),s=h.clone(h.UNIT_X,hbt);return $.multiplyByVector(a,s,s),h.negate(s,s),h.multiplyByScalar(s,n,s),s}nn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=cSe(t.heading,t.pitch,t.range):n=t,this._mode===ie.SCENE2D){z.clone(z.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<D.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(R.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)<D.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 dR=new de,_bt=new de,Abt=new h,ybt=new h,xbt=new h,bbt=new h,Tbt=new h,Cbt=new h,Ebt=new h,Nee=new h,vbt={direction:new h,right:new h,up:new h},qve;function al(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function lSe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:vbt,{north:a,south:s,west:c}=t,{east:u}=t;c>u&&(u+=D.TWO_PI);let f=(c+u)*.5,d;if(s<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&a>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)d=0;else{let B=dR;B.longitude=f,B.latitude=a,B.height=0;let L=_bt;L.longitude=f,L.latitude=s,L.height=0;let _=qve;(!l(_)||_.ellipsoid!==o)&&(qve=_=new u_(void 0,void 0,o)),_.setEndPoints(B,L),d=_.interpolateUsingFraction(.5,dR).latitude}let p=dR;p.longitude=f,p.latitude=d,p.height=0;let g=o.cartographicToCartesian(p,Ebt),m=dR;m.longitude=u,m.latitude=a;let A=o.cartographicToCartesian(m,Abt);m.longitude=c;let y=o.cartographicToCartesian(m,xbt);m.longitude=f;let x=o.cartographicToCartesian(m,Tbt);m.latitude=s;let b=o.cartographicToCartesian(m,Cbt);m.longitude=u;let T=o.cartographicToCartesian(m,bbt);m.longitude=c;let E=o.cartographicToCartesian(m,ybt);h.subtract(y,g,y),h.subtract(T,g,T),h.subtract(A,g,A),h.subtract(E,g,E),h.subtract(x,g,x),h.subtract(b,g,b);let S=o.geodeticSurfaceNormal(g,r.direction);h.negate(S,S);let w=h.cross(S,h.UNIT_Z,r.right);h.normalize(w,w);let P=h.cross(w,S,r.up),O;if(e.frustum instanceof fn){let B=Math.max(h.distance(A,y),h.distance(T,E)),L=Math.max(h.distance(A,T),h.distance(y,E)),_,C,v=e.frustum._offCenterFrustum,I=v.right/v.top,M=L*I;B>M?(_=B,C=_/I):(C=L,_=M),O=Math.max(_,C)}else{let B=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*B;if(O=Math.max(al(S,P,y,B),al(S,P,T,B),al(S,P,A,B),al(S,P,E,B),al(S,P,x,B),al(S,P,b,B),al(S,w,y,L),al(S,w,T,L),al(S,w,A,L),al(S,w,E,L),al(S,w,x,L),al(S,w,b,L)),s<0&&a>0){let _=dR;_.longitude=c,_.latitude=0,_.height=0;let C=o.cartographicToCartesian(_,Nee);h.subtract(C,g,C),O=Math.max(O,al(S,P,C,B),al(S,w,C,L)),_.longitude=u,C=o.cartographicToCartesian(_,Nee),h.subtract(C,g,C),O=Math.max(O,al(S,P,C,B),al(S,w,C,L))}}return h.add(g,h.multiplyByScalar(S,-O,Nee),n)}var Sbt=new de,wbt=new h,Ibt=new h;function Dbt(e,t,n){let i=e._projection;t.west>t.east&&(t=oe.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,a=Sbt;a.longitude=t.east,a.latitude=t.north;let s=i.project(a,wbt);R.multiplyByPoint(o,s,s),R.multiplyByPoint(r,s,s),a.longitude=t.west,a.latitude=t.south;let c=i.project(a,Ibt);if(R.multiplyByPoint(o,c,c),R.multiplyByPoint(r,c,c),n.x=(s.x-c.x)*.5+c.x,n.y=(s.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((s.x-c.x)/f,(s.y-c.y)/u)*.5}else{let u=s.x-c.x,f=s.y-c.y;n.z=Math.max(u,f)}return n}var Pbt=new de,Rbt=new h,Obt=new h;function Mbt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Mu.INFINITE_SCROLL?o+=D.TWO_PI:(t=oe.MAX_VALUE,o=t.east));let r=Pbt;r.longitude=o,r.latitude=t.north;let a=i.project(r,Rbt);r.longitude=t.west,r.latitude=t.south;let s=i.project(r,Obt),c=Math.abs(a.x-s.x)*.5,u=Math.abs(a.y-s.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(a.x-s.x)*.5+s.x,n.y=(a.y-s.y)*.5+s.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}nn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===ie.SCENE3D)return lSe(this,e,t);if(n===ie.COLUMBUS_VIEW)return Dbt(this,e,t);if(n===ie.SCENE2D)return Mbt(this,e,t)};var Bbt=new An;function Lbt(e,t,n,i){n=n??te.default;let o=e.getPickRay(t,Bbt),r=ui.rayEllipsoid(o,n);if(!r)return;let a=r.start>0?r.start:r.stop;return An.getPoint(o,a,i)}var Nbt=new An;function Fbt(e,t,n,i){let r=e.getPickRay(t,Nbt).origin;r=h.fromElements(r.y,r.z,0,r);let a=n.unproject(r);if(!(a.latitude<-D.PI_OVER_TWO||a.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(a,i)}var kbt=new An;function zbt(e,t,n,i){let o=e.getPickRay(t,kbt),r=-o.origin.x/o.direction.x;An.getPoint(o,r,i);let a=n.unproject(new h(i.y,i.z,0));if(!(a.latitude<-D.PI_OVER_TWO||a.latitude>D.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(a,i)}nn.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=t??te.default,this._mode===ie.SCENE3D)n=Lbt(this,e,t,n);else if(this._mode===ie.SCENE2D)n=Fbt(this,e,this._projection,n);else if(this._mode===ie.COLUMBUS_VIEW)n=zbt(this,e,this._projection,n);else return;return n}};var Ubt=new h,Vbt=new h,jbt=new h;function Gbt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,a=Math.tan(e.frustum.fovy*.5),s=e.frustum.aspectRatio*a,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,Ubt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*s,Vbt),m=h.multiplyByScalar(e.upWC,f*c*a,jbt),A=h.add(p,g,n.direction);return h.add(A,m,A),h.subtract(A,d,A),h.normalize(A,A),n}var Bj=new h;function Hbt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,a=e.frustum,s=a.offCenterFrustum;l(s)&&(a=s);let c=2/o*t.x-1;c*=(a.right-a.left)*.5;let u=2/r*(r-t.y)-1;u*=(a.top-a.bottom)*.5;let f=n.origin;if(h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,Bj),h.add(Bj,f,f),h.multiplyByScalar(e.upWC,u,Bj),h.add(Bj,f,f),h.clone(e.directionWC,n.direction),e._mode===ie.SCENE2D&&e._scene.mapMode2D===Mu.INFINITE_SCROLL){let d=e._maxCoord.x;f.y=D.mod(f.y+d,2*d)-d}return n}nn.prototype.getPickRay=function(e,t){l(t)||(t=new An);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)?Gbt(this,e,t):Hbt(this,e,t)};var Wbt=new h,qbt=new h;nn.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,Wbt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),qbt);return Math.max(0,h.magnitude(n)-e.radius)};var Ybt=new z;nn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Ybt);return Math.max(o.x,o.y)};function Xbt(e,t,n,i,o,r){let a=h.clone(t);n.y>i?a.y-=n.y-i:n.y<-i&&(a.y+=-i-n.y),n.z>o?a.z-=n.z-o:n.z<-o&&(a.z+=-o-n.z);function s(c){let u=h.lerp(t,a,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Oa.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:s}}var Kbt=new h,Yve=new h,Qbt=new h,$bt=new h;function Jbt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,Kbt),r=-h.dot(o,n)/h.dot(o,i),a=h.add(n,h.multiplyByScalar(i,r,Yve),Yve);e.cameraToWorldCoordinatesPoint(a,a),n=e.cameraToWorldCoordinatesPoint(e.position,Qbt);let s=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*s,u=h.magnitude(h.subtract(n,a,$bt)),f=c*u,d=s*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),A=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-A||n.y>A){let y=a.y<-m||a.y>m,x=a.z<-A||a.z>A;if(y||x)return Xbt(e,n,a,m,A,t)}}nn.prototype.createCorrectPositionTween=function(e){if(this._mode===ie.COLUMBUS_VIEW)return Jbt(this,e)};var Zbt=new h,Ns={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};nn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};nn.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=Ns.destination,e.orientation.heading=Ns.heading,e.orientation.pitch=Ns.pitch,e.orientation.roll=Ns.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};nn.prototype.flyTo=function(e){e=e??G.EMPTY_OBJECT;let t=e.destination;if(this._mode===ie.MORPHING)return;this.cancelFlight();let i=t instanceof oe;i&&(t=this.getRectangleCameraCoordinates(t,Zbt));let o=e.orientation??G.EMPTY_OBJECT;if(l(o.direction)&&(o=iSe(this,t,o,zee.orientation)),l(e.duration)&&e.duration<=0){let f=zee;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,a;Ns.destination=t,Ns.heading=o.heading,Ns.pitch=o.pitch,Ns.roll=o.roll,Ns.duration=e.duration,Ns.complete=function(){a===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Ns.cancel=e.cancel,Ns.endTransform=e.endTransform,Ns.convert=i?!1:e.convert,Ns.maximumHeight=e.maximumHeight,Ns.pitchAdjustHeight=e.pitchAdjustHeight,Ns.flyOverLongitude=e.flyOverLongitude,Ns.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ns.easingFunction=e.easingFunction;let s=this._scene,c=Oj.createTween(s,Ns);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}a=s.tweens.add(c),this._currentFlight=a;let u=this._scene.preloadFlightCamera;this._mode!==ie.SCENE2D&&(l(u)||(u=nn.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function eTt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function tTt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,a=n.right/n.top,s=t*a;return t>s?(o=t,r=o/a):(r=t,o=s),Math.max(o,r)*1.5}var nTt=100;function uSe(e,t,n){n=Hh.clone(l(n)?n:nn.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let a=t.radius;a===0?n.range=nTt:e.frustum instanceof fn||e._mode===ie.SCENE2D?n.range=tTt(e,a):n.range=eTt(e,a),n.range=D.clamp(n.range,i,o)}return n}nn.prototype.viewBoundingSphere=function(e,t){t=uSe(this,e,t),this.lookAt(e.center,t)};var iTt=new R,oTt=new h,rTt=new h,aTt=new h,sTt=new h,cTt=new se,lTt=new Le,uTt=new $;nn.prototype.flyToBoundingSphere=function(e,t){t=t??G.EMPTY_OBJECT;let n=this._mode===ie.SCENE2D||this._mode===ie.COLUMBUS_VIEW;this._setTransform(R.IDENTITY);let i=uSe(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,oTt):o=cSe(i.heading,i.pitch,i.range);let a=this._scene.ellipsoid??te.default,s=pt.eastNorthUpToFixedFrame(e.center,a,iTt);R.multiplyByPoint(s,o,o);let c,u;if(!n){if(c=h.subtract(e.center,o,rTt),h.normalize(c,c),u=R.multiplyByPointAsVector(s,h.UNIT_Z,aTt),1-Math.abs(h.dot(c,u))<D.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,lTt),p=$.fromQuaternion(d,uTt);h.fromCartesian4(R.getColumn(s,1,cTt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,sTt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},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 Xve=new h,Kve=new h,Fee=new h,Qve=new h,hR=[new h,new h,new h,new h];function fTt(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,Xve),r=h.magnitude(o),a=h.normalize(o,Kve),s,c;h.equalsEpsilon(a,h.UNIT_Z,D.EPSILON10)?(s=new h(0,1,0),c=new h(0,0,1)):(s=h.normalize(h.cross(h.UNIT_Z,a,Fee),Fee),c=h.normalize(h.cross(a,s,Qve),Qve));let u=Math.sqrt(h.magnitudeSquared(o)-1),f=h.multiplyByScalar(a,1/r,Xve),d=u/r,p=h.multiplyByScalar(s,d,Kve),g=h.multiplyByScalar(c,d,Fee),m=h.add(f,g,hR[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let A=h.subtract(f,g,hR[1]);h.subtract(A,p,A),h.multiplyComponents(n,A,A);let y=h.subtract(f,g,hR[2]);h.add(y,p,y),h.multiplyComponents(n,y,y);let x=h.add(f,g,hR[3]);return h.add(x,p,x),h.multiplyComponents(n,x,x),hR}var kee=new z,dTt=new h,ZA=[new de,new de,new de,new de];function Lj(e,t,n,i,o,r){kee.x=e,kee.y=t;let a=i.pickEllipsoid(kee,o,dTt);return l(a)?(ZA[n]=o.cartesianToCartographic(a,ZA[n]),1):(ZA[n]=o.cartesianToCartographic(r[n],ZA[n]),0)}nn.prototype.computeViewRectangle=function(e,t){e=e??te.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ce(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===qt.OUTSIDE)return;let r=this._scene.canvas,a=r.clientWidth,s=r.clientHeight,c=0,u=fTt(this,e);if(c+=Lj(0,0,0,this,e,u),c+=Lj(0,s,1,this,e,u),c+=Lj(a,s,2,this,e,u),c+=Lj(a,0,3,this,e,u),c<2)return oe.MAX_VALUE;t=oe.fromCartographicArray(ZA,t);let f=0,d=ZA[3].longitude;for(let p=0;p<4;++p){let g=ZA[p].longitude,m=Math.abs(g-d);m>D.PI?f+=D.TWO_PI-m:f+=m,d=g}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,ZA[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};nn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ie.SCENE2D||this.frustum instanceof Gi)return;let e=this._scene;this.frustum=new Gi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60)};nn.prototype.switchToOrthographicFrustum=function(){if(this._mode===ie.SCENE2D||this.frustum instanceof fn)return;let e=tSe(this),t=this._scene;this.frustum=new fn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};nn.clone=function(e,t){return l(t)||(t=new nn(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),R.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var vo=nn;function hTt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var nm=hTt;var pSe=Na(ju(),1),fSe=576,mTt=100,mR="#ffffff",Uj="#48b";function gSe(e,t){this.credit=e,this.count=t??1}function pTt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(xt.equals(o,t))return!0}return!1}function gTt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;xt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var _Se="cesium-credit-delimiter";function dSe(e){let t=document.createElement("span");return t.textContent=e,t.className=_Se,t}function hSe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function mSe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(a,s){return s.count-a.count});for(let a=0;a<t.length;++a){let s=t[a].credit;if(l(s)){if(r=a,l(n)&&(r*=2,a>0)){let u=r-1;if(o.length<=u)e.appendChild(dSe(n));else{let f=o[u];f.className!==_Se&&e.replaceChild(dSe(n),f)}}let c=s.element;if(o.length<=r)e.appendChild(hSe(c,i));else{let u=o[r];u._creditId!==s._id&&e.replaceChild(hSe(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function _Tt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<fSe?(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>=fSe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function ATt(e){let t=`
  11475. .cesium-credit-lightbox-overlay {
  11476. display: none;
  11477. z-index: 1;
  11478. position: absolute;
  11479. top: 0;
  11480. left: 0;
  11481. width: 100%;
  11482. height: 100%;
  11483. background-color: rgba(80, 80, 80, 0.8);
  11484. }
  11485. .cesium-credit-lightbox {
  11486. background-color: #303336;
  11487. color: ${mR};
  11488. position: relative;
  11489. min-height: ${mTt}px;
  11490. margin: auto;
  11491. }
  11492. .cesium-credit-lightbox > ul > li a,
  11493. .cesium-credit-lightbox > ul > li a:visited,
  11494. .cesium-credit-wrapper a,
  11495. .cesium-credit-wrapper a:visited {
  11496. color: ${mR};
  11497. }
  11498. .cesium-credit-lightbox > ul > li a:hover {
  11499. color: ${Uj};
  11500. }
  11501. .cesium-credit-lightbox.cesium-credit-lightbox-expanded {
  11502. border: 1px solid #444;
  11503. border-radius: 5px;
  11504. max-width: 470px;
  11505. }
  11506. .cesium-credit-lightbox.cesium-credit-lightbox-mobile {
  11507. height: 100%;
  11508. width: 100%;
  11509. }
  11510. .cesium-credit-lightbox-title {
  11511. padding: 20px 20px 0 20px;
  11512. }
  11513. .cesium-credit-lightbox-close {
  11514. font-size: 18pt;
  11515. cursor: pointer;
  11516. position: absolute;
  11517. top: 0;
  11518. right: 6px;
  11519. color: ${mR};
  11520. }
  11521. .cesium-credit-lightbox-close:hover {
  11522. color: ${Uj};
  11523. }
  11524. .cesium-credit-lightbox > ul {
  11525. margin: 0;
  11526. padding: 12px 20px 12px 40px;
  11527. font-size: 13px;
  11528. }
  11529. .cesium-credit-lightbox > ul > li {
  11530. padding-bottom: 6px;
  11531. }
  11532. .cesium-credit-lightbox > ul > li * {
  11533. padding: 0;
  11534. margin: 0;
  11535. }
  11536. .cesium-credit-expand-link {
  11537. padding-left: 5px;
  11538. cursor: pointer;
  11539. text-decoration: underline;
  11540. color: ${mR};
  11541. }
  11542. .cesium-credit-expand-link:hover {
  11543. color: ${Uj};
  11544. }
  11545. .cesium-credit-text {
  11546. color: ${mR};
  11547. }
  11548. .cesium-credit-delimiter {
  11549. padding: 0 5px;
  11550. }
  11551. .cesium-credit-textContainer *,
  11552. .cesium-credit-logoContainer * {
  11553. display: inline;
  11554. }
  11555. .cesium-credit-textContainer a:hover {
  11556. color: ${Uj}
  11557. }
  11558. .cesium-credit-textContainer .cesium-credit-wrapper:first-of-type {
  11559. padding-left: 5px;
  11560. }
  11561. `;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let a=r.getRootNode();if(a instanceof ShadowRoot)return a}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function Br(e,t,n){let i=this;n=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 a(m){r.contains(m.target)||i.hideLightbox()}o.addEventListener("click",a,!1);let s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",r.appendChild(s);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="&times;",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),ATt(e);let g=xt.clone(Br.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=a,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 Nt,lightboxCredits:new Nt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function ASe(e,t,n,i){i=i??1;let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,a=e._creditDisplayElementPoolIndex;a<r.length?(o=r[a],o.credit=n,o.count=i):(o=new gSe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Br.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=xt.clone(ySe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,ASe(this,t,e)};Br.prototype.addStaticCredit=function(e){let t=this._staticCredits;pTt(t,e)||t.push(e)};Br.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Br.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Br.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Br.prototype.update=function(){this._expanded&&_Tt(this)};Br.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],a=r.showOnScreen?t:n;r.isIon()&&xt.equals(Br.cesiumCredit,this._cesiumCredit)||ASe(this,a,r,Number.MAX_VALUE)}xt.equals(Br.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=xt.clone(Br.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Br.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;mSe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",mSe(this._creditList,t,void 0,"li"),gTt(this)};Br.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),fe(this)};Br.prototype.isDestroyed=function(){return!1};Br._cesiumCredit=void 0;Br._cesiumCreditInitialized=!1;var Vj;function ySe(){if(!l(Vj)){let e=Xt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new pSe.default(e).path()),Vj=new xt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Br._cesiumCreditInitialized||(Br._cesiumCredit=Vj,Br._cesiumCreditInitialized=!0),Vj}Object.defineProperties(Br,{cesiumCredit:{get:function(){return ySe(),Br._cesiumCredit},set:function(e){Br._cesiumCredit=e,Br._cesiumCreditInitialized=!0}}});Br.CreditDisplayElement=gSe;var jj=Br;var Gj=0,yTt=1;function Bb(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Ne.DEFAULT,r=e._drawNearPlane??!0,a,s;t instanceof Gi?(a=Gj,s=Gi.packedLength):t instanceof fn&&(a=yTt,s=fn.packedLength),this._frustumType=a,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+s+h.packedLength+Le.packedLength+Ne.packedLength}Bb.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Gj?(Gi.pack(o,t,n),n+=Gi.packedLength):(fn.pack(o,t,n),n+=fn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Ne.pack(e._vertexFormat,t,n),n+=Ne.packedLength,t[n]=e._drawNearPlane?1:0,t};var xTt=new Gi,bTt=new fn,TTt=new Le,CTt=new h,ETt=new Ne;Bb.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===Gj?(o=Gi.unpack(e,t,xTt),t+=Gi.packedLength):(o=fn.unpack(e,t,bTt),t+=fn.packedLength);let r=h.unpack(e,t,CTt);t+=h.packedLength;let a=Le.unpack(e,t,TTt);t+=Le.packedLength;let s=Ne.unpack(e,t,ETt);t+=Ne.packedLength;let c=e[t]===1;if(!l(n))return new Bb({frustum:o,origin:r,orientation:a,vertexFormat:s,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Le.clone(a,n._orientation),n._vertexFormat=Ne.clone(s,n._vertexFormat),n._drawNearPlane=c,n};function DS(e,t,n,i,o,r,a,s){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=a.x,n[e+1]=a.y,n[e+2]=a.z),l(i)&&(i[e]=s.x,i[e+1]=s.y,i[e+2]=s.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 vTt=new $,STt=new R,Gee=new R,xSe=new h,bSe=new h,TSe=new h,wTt=new h,ITt=new h,DTt=new h,ey=new Array(3),pR=new Array(4);pR[0]=new se(-1,-1,1,1);pR[1]=new se(1,-1,1,1);pR[2]=new se(1,1,1,1);pR[3]=new se(-1,1,1,1);var CSe=new Array(4);for(let e=0;e<4;++e)CSe[e]=new se;Bb._computeNearFarPlanes=function(e,t,n,i,o,r,a,s){let c=$.fromQuaternion(t,vTt),u=r??xSe,f=a??bSe,d=s??TSe;u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=R.computeView(e,d,f,u,STt),g,m,A=i.projectionMatrix;if(n===Gj){let y=R.multiply(A,p,Gee);m=R.inverse(y,Gee)}else g=R.inverseTransformation(p,Gee);l(m)?(ey[0]=i.near,ey[1]=i.far):(ey[0]=0,ey[1]=i.near,ey[2]=i.far);for(let y=0;y<2;++y)for(let x=0;x<4;++x){let b=se.clone(pR[x],CSe[x]);if(l(m)){b=R.multiplyByVector(m,b,b);let T=1/b.w;h.multiplyByScalar(b,T,b),h.subtract(b,e,b),h.normalize(b,b);let E=h.dot(d,b);h.multiplyByScalar(b,ey[y]/E,b),h.add(b,e,b)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=ey[y],S=ey[y+1];b.x=(b.x*(i.right-i.left)+i.left+i.right)*.5,b.y=(b.y*(i.top-i.bottom)+i.bottom+i.top)*.5,b.z=(b.z*(E-S)-E-S)*.5,b.w=1,R.multiplyByVector(g,b,b)}o[12*y+x*3]=b.x,o[12*y+x*3+1]=b.y,o[12*y+x*3+2]=b.z}};Bb.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,a=e._vertexFormat,s=r?6:5,c=new Float64Array(72);Bb._computeNearFarPlanes(i,o,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],r||(c=c.subarray(12));let f=new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})});if(l(a.normal)||l(a.tangent)||l(a.bitangent)||l(a.st)){let p=l(a.normal)?new Float32Array(12*s):void 0,g=l(a.tangent)?new Float32Array(12*s):void 0,m=l(a.bitangent)?new Float32Array(12*s):void 0,A=l(a.st)?new Float32Array(8*s):void 0,y=xSe,x=bSe,b=TSe,T=h.negate(y,wTt),E=h.negate(x,ITt),S=h.negate(b,DTt);u=0,r&&(DS(u,p,g,m,A,S,y,x),u+=12),DS(u,p,g,m,A,b,T,x),u+=12,DS(u,p,g,m,A,T,S,x),u+=12,DS(u,p,g,m,A,E,S,T),u+=12,DS(u,p,g,m,A,y,b,x),u+=12,DS(u,p,g,m,A,x,b,T),l(p)&&(f.normal=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),l(A)&&(f.st=new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:A}))}let d=new Uint16Array(6*s);for(let p=0;p<s;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new At({attributes:f,indices:d,primitiveType:Re.TRIANGLES,boundingSphere:ce.fromVertices(c)})};var PS=Bb;var Hee=0,PTt=1;function gR(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,a;t instanceof Gi?(r=Hee,a=Gi.packedLength):t instanceof fn&&(r=PTt,a=fn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+a+h.packedLength+Le.packedLength}gR.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Hee?(Gi.pack(o,t,n),n+=Gi.packedLength):(fn.pack(o,t,n),n+=fn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var RTt=new Gi,OTt=new fn,MTt=new Le,BTt=new h;gR.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===Hee?(o=Gi.unpack(e,t,RTt),t+=Gi.packedLength):(o=fn.unpack(e,t,OTt),t+=fn.packedLength);let r=h.unpack(e,t,BTt);t+=h.packedLength;let a=Le.unpack(e,t,MTt);t+=Le.packedLength;let s=e[t]===1;if(!l(n))return new gR({frustum:o,origin:r,orientation:a,_drawNearPlane:s});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=Le.clone(a,n._orientation),n._drawNearPlane=s,n};gR.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,a=new Float64Array(24);PS._computeNearFarPlanes(i,o,t,n,a);let s=new _n({position:new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a})}),c,u,f=r?2:1,d=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new At({attributes:s,indices:d,primitiveType:Re.LINES,boundingSphere:ce.fromVertices(a)})};var Hj=gR;function Wj(e){e=e??G.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??U.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var LTt=new h,NTt=new $,FTt=new Le,kTt=new Gi,zTt=new Ru,UTt=new fn,VTt=new ga,jTt=new U,GTt=[1,1e5];Wj.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,a=r.frustum,s;a instanceof Gi?s=kTt:a instanceof Ru?s=zTt:a instanceof fn?s=UTt:s=VTt,s=a.clone(s);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=GTt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,d=r.directionWC,p=r.upWC,g=r.rightWC;g=h.negate(g,LTt);let m=NTt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let A=Le.fromRotationMatrix(m,FTt);for(t.length=n.length=c,i=0;i<c;++i)s.near=u[i],s.far=u[i+1],t[i]=new Pn({geometryInstances:new Bt({geometry:new PS({origin:f,orientation:A,frustum:s,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(U.fromAlpha(this._color,.1,jTt))},id:this.id,pickPrimitive:this}),appearance:new hn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Pn({geometryInstances:new Bt({geometry:new Hj({origin:f,orientation:A,frustum:s,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};Wj.prototype.isDestroyed=function(){return!1};Wj.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 fe(this)};var bg=Wj;var qj=`in vec4 positionEC;
  11562. void main()
  11563. {
  11564. vec3 position;
  11565. vec3 direction;
  11566. if (czm_orthographicIn3D == 1.0)
  11567. {
  11568. vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw;
  11569. vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom
  11570. vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top
  11571. position = vec3(mix(minPlane, maxPlane, uv), 0.0);
  11572. direction = vec3(0.0, 0.0, -1.0);
  11573. }
  11574. else
  11575. {
  11576. position = vec3(0.0);
  11577. direction = normalize(positionEC.xyz);
  11578. }
  11579. czm_ray ray = czm_ray(position, direction);
  11580. vec3 ellipsoid_center = czm_view[3].xyz;
  11581. czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
  11582. if (!czm_isEmpty(intersection))
  11583. {
  11584. out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
  11585. }
  11586. else
  11587. {
  11588. discard;
  11589. }
  11590. czm_writeLogDepth();
  11591. }
  11592. `;var Yj=`in vec4 position;
  11593. out vec4 positionEC;
  11594. void main()
  11595. {
  11596. positionEC = czm_modelView * position;
  11597. gl_Position = czm_projection * positionEC;
  11598. czm_vertexLogDepth();
  11599. }
  11600. `;function AR(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=e??0}var _R=cn.supportsTypedArrays()?new Float32Array(12):[],ESe=new h,vSe=new h,Wee=new h,SSe=new h,Xj=new h;function HTt(e,t){let n=e.radii,i=t.camera,o,r,a;if(i.frustum instanceof fn)o=h.ZERO,r=i.rightWC,a=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,ESe),g=h.normalize(p,vSe),m=h.normalize(h.cross(h.UNIT_Z,p,Wee),Wee),A=h.normalize(h.cross(g,m,SSe),SSe),y=h.magnitude(p),x=Math.sqrt(y*y-1);o=h.multiplyByScalar(g,1/y,ESe);let b=x/y;r=h.multiplyByScalar(m,b,vSe),a=h.multiplyByScalar(A,b,Wee)}let s=h.add(o,a,Xj);h.subtract(s,r,s),h.multiplyComponents(n,s,s),h.pack(s,_R,0);let c=h.subtract(o,a,Xj);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,_R,3);let u=h.add(o,a,Xj);h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,_R,6);let f=h.subtract(o,a,Xj);return h.add(f,r,f),h.multiplyComponents(n,f,f),h.pack(f,_R,9),_R}AR.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ie.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new te(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ve.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:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let a=new He({sources:[Yj]}),s=new He({sources:[qj]});o&&(s.defines.push("LOG_DEPTH"),a.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=HTt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let a=new At({attributes:{position:new Me({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Re.TRIANGLES});this._va=Fn.fromGeometry({context:t,geometry:a,attributeLocations:{position:0},bufferUsage:Oe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};AR.prototype.execute=function(e,t){this._mode===ie.SCENE3D&&this._command.execute(e,t)};AR.prototype.isDestroyed=function(){return!1};AR.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Kj=AR;function OS(){}var WTt=/\bgl_FragDepth\b/,qTt=/\bdiscard\b/;function YTt(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 s=0;s<r.length;++s)if(WTt.test(r[s])||qTt.test(r[s])){o=!0;break}let a=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!a){let s=`void main()
  11601. {
  11602. out_FragColor = vec4(1.0);
  11603. }
  11604. `;i=new He({sources:[s]})}else if(!o&&a){let s=`void main()
  11605. {
  11606. out_FragColor = vec4(1.0);
  11607. czm_writeLogDepth();
  11608. }
  11609. `;i=new He({defines:["LOG_DEPTH"],sources:[s]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function XTt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ve.fromCache(o);return n[t.id]=r,r}OS.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=YTt(n,t.shaderProgram),i.depthOnlyCommand.renderState=XTt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var KTt=/\s+czm_writeLogDepth\(/,QTt=/\s+czm_vertexLogDepth\(/;function $Tt(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(),a=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),a.defines=l(a.defines)?a.defines.slice(0):[],a.defines.push("LOG_DEPTH");let s=!1,c=r.sources;for(let f=0;f<c.length;++f)if(QTt.test(c[f])){s=!0;break}if(!s){for(let d=0;d<c.length;++d)c[d]=He.replaceMain(c[d],"czm_log_depth_main");c.push(`
  11610. void main()
  11611. {
  11612. czm_log_depth_main();
  11613. czm_vertexLogDepth();
  11614. }
  11615. `)}c=a.sources,s=!1;for(let f=0;f<c.length;++f)KTt.test(c[f])&&(s=!0);a.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(s=!0);let u="";if(!s){for(let f=0;f<c.length;f++)c[f]=He.replaceMain(c[f],"czm_log_depth_main");u=`
  11616. void main()
  11617. {
  11618. czm_log_depth_main();
  11619. czm_writeLogDepth();
  11620. }
  11621. `}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:o})}OS.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=$Tt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function JTt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:a}=t.fragmentShaderSource,c=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main ()
  11622. {
  11623. czm_non_pick_main();
  11624. if (${c}.a == 0.0) {
  11625. discard;
  11626. }
  11627. ${c} = ${n};
  11628. } `,f=r.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=He.replaceMain(r[g],"czm_non_pick_main");d[f]=u;let p=new He({sources:d,defines:a});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function wSe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ve.fromCache(o);return n[t.id]=r,r}OS.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=JTt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=wSe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function RS(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 ZTt(e){return e.isArray?e.arrayLength:ht.getComponentCount(e.type)}function ISe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function DSe(e,t){let n=Rt.getMaximum(t);return`(${e}) / float(${n})`}function eCt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=ISe(n,i,o)}return e.normalized||(n=DSe(n,e.componentType)),n}function tCt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],a=t.scale[n];o=ISe(o,r,a)}return e.normalized||(o=DSe(o,e.componentType)),o}function nCt(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,a=`pickMetadata-${i}-${o}-${r}`,s=e.shaderCache.getDerivedShaderProgram(t,a);if(l(s))return s;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),d=["0.0","0.0","0.0","0.0"],p=ZTt(u);if(p===1)d[0]=eCt(u,c);else{let y=["x","y","z","w"];for(let x=0;x<p;x++)d[x]=tCt(u,c,y[x])}let g=t.fragmentShaderSource.defines.slice();g.push(sd.METADATA_PICKING_ENABLED),RS(g,sd.METADATA_PICKING_VALUE_TYPE,f),RS(g,sd.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),RS(g,sd.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),RS(g,sd.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),RS(g,sd.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),RS(g,sd.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new He({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,a,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}OS.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=tt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=nCt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=wSe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function iCt(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})}OS.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=iCt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Tg=OS;function Qj(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=D.toRadians(o),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var oCt=new Le,PSe=new Le,rCt=new $;function aCt(e,t,n,i){let o=e.direction,r=e.right,a=e.up,s=Le.fromAxisAngle(o,n,PSe),c=Le.fromAxisAngle(r,i,oCt),u=Le.multiply(c,s,c),f=Le.fromAxisAngle(a,t,PSe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,rCt);$.multiplyByVector(d,r,r),$.multiplyByVector(d,a,a),$.multiplyByVector(d,o,o)}Qj.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;aCt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};Qj.prototype.isDestroyed=function(){return!1};Qj.prototype.destroy=function(){return this._removeListener(),fe(this)};var $j=Qj;function qee(){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(qee.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var sCt=new h;qee.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!==ie.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,D.EPSILON4),-Math.max(this._heightFalloff,0)),a=h.normalize(n.positionWC,sCt),s=Math.abs(h.dot(n.directionWC,a));r*=1-s,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Jj=qee;function cCt(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ie.SCENE3D,this.morphTime=ie.getMorphTime(ie.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,this.edgeVisibilityRequested=!1}var Zj=cCt;var sc={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},Lb=sc.DERIVED_COMMANDS_MAXIMUM_LENGTH,USe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function Nb(){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=oe.clone(oe.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(Lb),this._derivedBlendCommandTypes=new Array(Lb),this._derivedPickCommandTypes=new Array(Lb),this._derivedCommandTypesToUpdate=new Array(Lb),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(Nb.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}}});Nb.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=RSe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=RSe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=OSe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=OSe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=dCt(this,e,t),this._sunVisibleThroughGlobe=lCt(this,e),this._environmentVisible=uCt(this,e),this._useDepthPlane=fCt(this,e),this._numberOfTextureUniforms=hCt(this),this._rectangle=oe.clone(t.translucency.rectangle,this._rectangle),mCt(this,e)};function RSe(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 OSe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function lCt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function uCt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function fCt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function dCt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ie.SCENE2D&&t.context.depthTexture}function hCt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function mCt(e,t){e._derivedCommandsLength=Yee(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Yee(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Yee(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<Lb;++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=DCt())}function Yee(e,t,n,i,o){let r=0,a=e._frontFaceTranslucent,s=e._backFaceTranslucent;if(!a)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?sc.PICK_FRONT_FACE:u?sc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:sc.TRANSLUCENT_FRONT_FACE,d=i?sc.PICK_BACK_FACE:u?sc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:sc.TRANSLUCENT_BACK_FACE;return t.mode===ie.SCENE2D?(o[r++]=sc.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(s?(n||(o[r++]=sc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=d):(o[r++]=d,o[r++]=f)):c?(n||(o[r++]=sc.DEPTH_ONLY_BACK_FACE),o[r++]=sc.OPAQUE_FRONT_FACE,o[r++]=d):(n||(o[r++]=sc.DEPTH_ONLY_FRONT_FACE),o[r++]=sc.OPAQUE_BACK_FACE,o[r++]=f),r)}function Nd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function MSe(e,t){return e.indexOf(t)>-1}function pCt(e,t){Nd(e.defines,"TRANSLUCENT"),Nd(t.defines,"TRANSLUCENT")}function gCt(e,t){Nd(e.defines,"GROUND_ATMOSPHERE"),Nd(t.defines,"GROUND_ATMOSPHERE"),Nd(e.defines,"FOG"),Nd(t.defines,"FOG"),Nd(e.defines,"TRANSLUCENT"),Nd(t.defines,"TRANSLUCENT")}function Xee(e,t){if(MSe(t.defines,"TILE_LIMIT_RECTANGLE")||MSe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
  11629. {
  11630. out_FragColor = vec4(1.0);
  11631. }
  11632. `;t.sources=[n]}function Kee(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=He.replaceMain(n[r],"czm_globe_translucency_main");n.push(`
  11633. uniform sampler2D u_classificationTexture;
  11634. void main()
  11635. {
  11636. vec2 st = gl_FragCoord.xy / czm_viewport.zw;
  11637. #ifdef MANUAL_DEPTH_TEST
  11638. float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
  11639. if (logDepthOrDepth != 0.0)
  11640. {
  11641. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  11642. float depthEC = eyeCoordinate.z / eyeCoordinate.w;
  11643. if (v_positionEC.z < depthEC)
  11644. {
  11645. discard;
  11646. }
  11647. }
  11648. #endif
  11649. czm_globe_translucency_main();
  11650. vec4 classificationColor = texture(u_classificationTexture, st);
  11651. if (classificationColor.a > 0.0)
  11652. {
  11653. // Reverse premultiplication process to get the correct composited result of the classification primitives
  11654. classificationColor.rgb /= classificationColor.a;
  11655. }
  11656. out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a);
  11657. }
  11658. `)}function VSe(e,t){Kee(e,t),Nd(e.defines,"GROUND_ATMOSPHERE"),Nd(t.defines,"GROUND_ATMOSPHERE"),Nd(e.defines,"FOG"),Nd(t.defines,"FOG")}function _Ct(e,t){Kee(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function ACt(e,t){VSe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function BSe(e,t){let n=`uniform sampler2D u_classificationTexture;
  11659. void main()
  11660. {
  11661. vec2 st = gl_FragCoord.xy / czm_viewport.zw;
  11662. vec4 pickColor = texture(u_classificationTexture, st);
  11663. if (pickColor == vec4(0.0))
  11664. {
  11665. discard;
  11666. }
  11667. out_FragColor = pickColor;
  11668. }
  11669. `;t.sources=[n]}function yCt(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let a=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(a)){let s=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),a=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:s})}return a}function xCt(e){e.cull.face=Li.BACK,e.cull.enabled=!0}function bCt(e){e.cull.face=Li.FRONT,e.cull.enabled=!0}function TCt(e){e.cull.face=Li.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function CCt(e){e.cull.face=Li.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function ECt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function LSe(e){e.cull.face=Li.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=Jt.ALPHA_BLEND}function NSe(e){e.cull.face=Li.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=Jt.ALPHA_BLEND}function vCt(e){e.cull.face=Li.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function SCt(e){e.cull.face=Li.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function wCt(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 a=Ve.getState(e);i(a),r=Ve.fromCache(a),o[e.id]=r}return r}function MS(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function ICt(e,t,n,i,o){return l(o)?!i&&l(n)?n:It(t,o(e),!1):t}function im(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function DCt(){return[new im({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:pCt,getRenderStateFunction:xCt,getUniformMapFunction:void 0}),new im({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:gCt,getRenderStateFunction:bCt,getUniformMapFunction:void 0}),new im({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Xee,getRenderStateFunction:TCt,getUniformMapFunction:void 0}),new im({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Xee,getRenderStateFunction:CCt,getUniformMapFunction:void 0}),new im({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Xee,getRenderStateFunction:ECt,getUniformMapFunction:void 0}),new im({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Kee,getRenderStateFunction:LSe,getUniformMapFunction:MS}),new im({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:VSe,getRenderStateFunction:NSe,getUniformMapFunction:MS}),new im({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:_Ct,getRenderStateFunction:LSe,getUniformMapFunction:MS}),new im({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ACt,getRenderStateFunction:NSe,getUniformMapFunction:MS}),new im({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:BSe,getRenderStateFunction:vCt,getUniformMapFunction:MS}),new im({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:BSe,getRenderStateFunction:SCt,getUniformMapFunction:MS})]}var FSe=new Array(Lb),kSe=new Array(Lb);Nb.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)kSe[o]=this._derivedCommandPacks[n[o]],FSe[o]=USe[n[o]];PCt(this,e,i,n,FSe,kSe,t)}};function PCt(e,t,n,i,o,r,a){let s=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(s)||c){t.dirty=!1,l(s)||(s={},t.derivedCommands.globeTranslucency=s);let u=a.frameNumber,f=s.uniformMapDirtyFrame??0,d=s.shaderProgramDirtyFrame??0,p=s.renderStateDirtyFrame??0,g=s.uniformMap!==t.uniformMap,m=s.shaderProgramId!==t.shaderProgram.id,A=s.renderStateId!==t.renderState.id;g&&(s.uniformMapDirtyFrame=u),m&&(s.shaderProgramDirtyFrame=u),A&&(s.renderStateDirtyFrame=u),s.uniformMap=t.uniformMap,s.shaderProgramId=t.shaderProgram.id,s.renderStateId=t.renderState.id;for(let y=0;y<n;++y){let x=r[y],b=i[y],T=o[y],E=s[T],S,w,P;l(E)?(S=E.uniformMap,w=E.shaderProgram,P=E.renderState):(S=void 0,w=void 0,P=void 0),E=tt.shallowClone(t,E),s[T]=E;let O=E.derivedCommands.uniformMapDirtyFrame??0,B=E.derivedCommands.shaderProgramDirtyFrame??0,L=E.derivedCommands.renderStateDirtyFrame??0,_=g||O<f,C=m||B<d,v=A||L<p;_&&(E.derivedCommands.uniformMapDirtyFrame=u),C&&(E.derivedCommands.shaderProgramDirtyFrame=u),v&&(E.derivedCommands.renderStateDirtyFrame=u),E.derivedCommands.type=b,E.pass=x.pass,E.pickOnly=x.pickOnly,E.uniformMap=ICt(e,t.uniformMap,S,_,x.getUniformMapFunction),E.shaderProgram=yCt(a.context,t.shaderProgram,w,C,x.getShaderProgramFunction,T),E.renderState=wCt(t.renderState,P,v,x.getRenderStateFunction,x.renderStateCache)}}}Nb.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 a=e.derivedCommands.globeTranslucency;for(let s=0;s<r;++s){let c=USe[o[s]];n.commandList.push(a[c])}};function jSe(e,t,n,i,o,r){for(let a=0;a<t;++a){let s=e[a],c=s.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(s,i,o)}}function zSe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var RCt=[sc.OPAQUE_FRONT_FACE,sc.OPAQUE_BACK_FACE],OCt=[sc.DEPTH_ONLY_FRONT_FACE,sc.DEPTH_ONLY_BACK_FACE,sc.DEPTH_ONLY_FRONT_AND_BACK_FACE];Nb.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,a=e.commands[Ie.GLOBE],s=e.indices[Ie.GLOBE];s!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),jSe(a,s,t,i,o,RCt))};Nb.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:a}=r,s=e.commands[Ie.GLOBE],c=e.indices[Ie.GLOBE],u=e.commands[Ie.TERRAIN_CLASSIFICATION],f=e.indices[Ie.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&zSe(u,f,t,i,o),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=a.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,jSe(s,c,t,i,o,OCt),r.depthTexture){let A=n.packDepth(r,o);a.globeDepthTexture=A}zSe(u,f,t,i,o),a.globeDepthTexture=g,o.framebuffer=m};var eG=Nb;var Sf=`uniform sampler2D colorTexture;
  11670. in vec2 v_textureCoordinates;
  11671. void main()
  11672. {
  11673. out_FragColor = texture(colorTexture, v_textureCoordinates);
  11674. }
  11675. `;function Vp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new bi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new bi({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 si({color:new U(0,0,0,0),owner:this}),this._clearCommand=new si({color:new U(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(Vp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Vp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var MCt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Xn.EQUAL,frontOperation:{fail:vt.KEEP,zFail:vt.KEEP,zPass:vt.KEEP},backFunction:Xn.NEVER,reference:0,mask:Ht.CLASSIFICATION_MASK},blending:Jt.ALPHA_BLEND},BCt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Xn.NOT_EQUAL,frontOperation:{fail:vt.KEEP,zFail:vt.KEEP,zPass:vt.KEEP},backFunction:Xn.NEVER,reference:0,mask:Ht.CLASSIFICATION_MASK},blending:Jt.ALPHA_BLEND},LCt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ht.setCesium3DTileBit(),stencilMask:Ht.CESIUM_3D_TILE_MASK,blending:Jt.ALPHA_BLEND},NCt=`uniform sampler2D colorTexture;
  11676. uniform sampler2D depthTexture;
  11677. uniform sampler2D classifiedTexture;
  11678. in vec2 v_textureCoordinates;
  11679. void main()
  11680. {
  11681. vec4 color = texture(colorTexture, v_textureCoordinates);
  11682. if (color.a == 0.0)
  11683. {
  11684. discard;
  11685. }
  11686. bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0)));
  11687. #ifdef UNCLASSIFIED
  11688. vec4 highlightColor = czm_invertClassificationColor;
  11689. if (isClassified)
  11690. {
  11691. discard;
  11692. }
  11693. #else
  11694. vec4 highlightColor = vec4(1.0);
  11695. if (!isClassified)
  11696. {
  11697. discard;
  11698. }
  11699. #endif
  11700. out_FragColor = color * highlightColor;
  11701. gl_FragDepth = texture(depthTexture, v_textureCoordinates).r;
  11702. }
  11703. `,FCt=`uniform sampler2D colorTexture;
  11704. in vec2 v_textureCoordinates;
  11705. void main()
  11706. {
  11707. vec4 color = texture(colorTexture, v_textureCoordinates);
  11708. if (color.a == 0.0)
  11709. {
  11710. discard;
  11711. }
  11712. #ifdef UNCLASSIFIED
  11713. out_FragColor = color * czm_invertClassificationColor;
  11714. #else
  11715. out_FragColor = color;
  11716. #endif
  11717. }
  11718. `;Vp.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,a=e.drawingBufferWidth,s=e.drawingBufferHeight,c=!l(i)||i.width!==a||i.height!==s;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 Dt({context:e,width:a,height:s,pixelFormat:Xe.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Wf({context:e,width:a,height:s,format:tu.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,a,s,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,a,s))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(MCt),this._rsClassified=Ve.fromCache(BCt),this._rsDefault=Ve.fromCache(LCt)),!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 u=l(this._previousFramebuffer)?FCt:NCt,f=new He({defines:["UNCLASSIFIED"],sources:[u]}),d=new He({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{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(Sf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Vp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Vp.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))};Vp.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)};Vp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Vp.prototype.isDestroyed=function(){return!1};Vp.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()),fe(this)};var yR=Vp;function tG(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(tG.prototype,{total:{get:function(){return this._total}}});function ty(e){let t=new Array(Yc.NUMBER_OF_JOB_TYPES);t[Yc.TEXTURE]=new tG(l(e)?e[Yc.TEXTURE]:10),t[Yc.PROGRAM]=new tG(l(e)?e[Yc.PROGRAM]:10),t[Yc.BUFFER]=new tG(l(e)?e[Yc.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=zi;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,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let a=ty.getTimestamp();e.execute();let s=ty.getTimestamp()-a;return this._totalUsedThisFrame+=s,r?r.stolenFromMeThisFrame+=s:i.usedThisFrame+=s,this._executedThisFrame[t]=!0,!0};var nG=ty;function iG(e){e=e??G.EMPTY_OBJECT;let t=Bn(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=zi(),this._lastMsSampleTime=zi(),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(iG.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});iG.prototype.update=function(e){let t=zi(),n=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}};iG.prototype.destroy=function(){return fe(this)};var ny=iG;var cc={};cc.decodeRawMetadataValue=function(e,t,n){switch(e){case Rt.INT8:return t.getInt8(n);case Rt.UINT8:return t.getUint8(n);case Rt.INT16:return t.getInt16(n,!0);case Rt.UINT16:return t.getUint16(n,!0);case Rt.INT32:return t.getInt32(n,!0);case Rt.UINT32:return t.getUint32(n,!0);case Rt.INT64:return t.getBigInt64(n,!0);case Rt.UINT64:return t.getBigUint64(n,!0);case Rt.FLOAT32:return t.getFloat32(n,!0);case Rt.FLOAT64:return t.getFloat64(n,!0)}throw new re(`Invalid component type: ${e}`)};cc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=cc.decodeRawMetadataValue(i,t,n);return e.normalized?Rt.normalize(o,i):o};cc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Rt.getSizeInBytes(i),r=e.type,a=ht.getComponentCount(r),s=o*a;if(a>1){let f=Array(a);for(let d=0;d<a;d++){let p=n*s+d*o,g=cc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*s;return cc.decodeRawMetadataValueComponent(e,t,c)};cc.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 a=0;a<o;a++){let s=cc.decodeRawMetadataValueElement(e,n,a);r[a]=s}return r}return cc.decodeRawMetadataValueElement(e,n,0)};cc.convertToObjectType=function(e,t){if(!l(t)||e===ht.SCALAR||e===ht.STRING||e===ht.BOOLEAN||e===ht.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case ht.VEC2:return z.unpack(n,0,new z);case ht.VEC3:return h.unpack(n,0,new h);case ht.VEC4:return se.unpack(n,0,new se);case ht.MAT2:return Wi.unpack(n,0,new Wi);case ht.MAT3:return $.unpack(n,0,new $);case ht.MAT4:return R.unpack(n,0,new R)}throw new re(`Invalid metadata object type: ${e}`)};cc.convertFromObjectType=function(e,t){if(!l(t)||e===ht.SCALAR||e===ht.STRING||e===ht.BOOLEAN||e===ht.ENUM)return t;switch(e){case ht.VEC2:return z.pack(t,Array(2));case ht.VEC3:return h.pack(t,Array(3));case ht.VEC4:return se.pack(t,Array(4));case ht.MAT2:return Wi.pack(t,Array(4));case ht.MAT3:return $.pack(t,Array(9));case ht.MAT4:return R.pack(t,Array(16))}throw new re(`Invalid metadata object type: ${e}`)};cc.decodeMetadataValues=function(e,t,n){let i=cc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=cc.convertFromObjectType(e.type,t.offset),a=cc.convertFromObjectType(e.type,t.scale);i=v0.valueTransformInPlace(i,r,a,Rt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,a=Array(r);for(let s=0;s<r;s++){let c=i[s],u=cc.convertToObjectType(e.type,c);a[s]=u}return a}return cc.convertToObjectType(e.type,i)};var oG=Object.freeze(cc);function Fb(){this._framebuffer=new bi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(Fb.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function kCt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function zCt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture;
  11719. in vec2 v_textureCoordinates;
  11720. void main()
  11721. {
  11722. vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates);
  11723. float globeDepth = czm_unpackDepth(globeDepthPacked);
  11724. float depth = texture(colorTexture, v_textureCoordinates).r;
  11725. out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0,
  11726. czm_packDepth(depth), globeDepthPacked);
  11727. }
  11728. `,{renderState:Ve.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}Fb.prototype.update=function(e,t){kCt(this,e,t),zCt(this,e,t)};var UCt=new se,VCt=new se(1,1/255,1/65025,1/16581375);Fb.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,UCt);return se.divideByScalar(o,255,o),se.dot(o,VCt)};Fb.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};Fb.prototype.isDestroyed=function(){return!1};Fb.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),fe(this)};var rG=Fb;function iy(e){e=e||{},this._framebufferManager=new bi({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new si({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(iy.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});iy.prototype.update=function(e,t,n,i,o){let r=t.width,a=t.height,s=n?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE,c=this._framebufferManager.update(e,r,a,1,s,Xe.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(o)?o:this._framebufferManager.getDepthStencilTexture()),c};iy.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};iy.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};iy.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};iy.prototype.isDestroyed=function(){return!1};iy.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,fe(this)};var aG=iy;function jCt(e,t){this.near=e??0,this.far=t??0;let n=Ie.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 sG=jCt;var kb=`uniform highp sampler2D u_depthTexture;
  11729. in vec2 v_textureCoordinates;
  11730. void main()
  11731. {
  11732. out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
  11733. }
  11734. `;function jp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new bi,this._tempCopyDepthFramebuffer=new bi,this._updateDepthFramebuffer=new bi({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 Je,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(jp.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 GSe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let a=!Je.equals(r,o.viewport),s=a!==e._useScissorTest;e._useScissorTest=a,Je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Je.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!Je.equals(r,e._rs.viewport)||s)&&(e._rs=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:Jt.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Xn.EQUAL,frontOperation:{fail:vt.KEEP,zFail:vt.KEEP,zPass:vt.KEEP},backFunction:Xn.NEVER,reference:Ht.CESIUM_3D_TILE_MASK,mask:Ht.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(kb,{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(Sf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(kb,{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(Sf,{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 si({color:new U(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}jp.prototype.update=function(e,t,n,i,o,r){let{width:a,height:s}=n,c=o?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,a,s):this._outputFramebuffer.update(e,a,s,i,c),this._copyDepthFramebuffer.update(e,a,s),GSe(this,e,a,s,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};jp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};jp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};jp.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:a,height:s}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,a,s),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,a,s),GSe(this,e,a,s,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};jp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};jp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(U.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};jp.prototype.isDestroyed=function(){return!1};jp.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()),fe(this)};var cG=jp;function zb(){this._framebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new bi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Je,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(zb.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 GCt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function HCt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function WCt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Je.equals(e._viewport,o.viewport),a=r!==e._useScissorTest;e._useScissorTest=r,Je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Je.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._renderState)||!Je.equals(e._viewport,e._renderState.viewport)||a)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(kb,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new si({color:new U(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}zb.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;HCt(this,n,o,r,e),WCt(this,n,o,r,i),this._useHdr=e};zb.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};zb.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};zb.prototype.isDestroyed=function(){return!1};zb.prototype.destroy=function(){return GCt(this),fe(this)};var lG=zb;var xR=`#ifdef MRT
  11735. layout (location = 0) out vec4 out_FragData_0;
  11736. layout (location = 1) out vec4 out_FragData_1;
  11737. #else
  11738. layout (location = 0) out vec4 out_FragColor;
  11739. #endif
  11740. uniform vec4 u_bgColor;
  11741. uniform sampler2D u_depthTexture;
  11742. in vec2 v_textureCoordinates;
  11743. void main()
  11744. {
  11745. if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)
  11746. {
  11747. #ifdef MRT
  11748. out_FragData_0 = u_bgColor;
  11749. out_FragData_1 = vec4(u_bgColor.a);
  11750. #else
  11751. out_FragColor = u_bgColor;
  11752. #endif
  11753. return;
  11754. }
  11755. discard;
  11756. }
  11757. `;var uG=`/**
  11758. * Compositing for Weighted Blended Order-Independent Transparency. See:
  11759. * - http://jcgt.org/published/0002/02/09/
  11760. * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
  11761. */
  11762. uniform sampler2D u_opaque;
  11763. uniform sampler2D u_accumulation;
  11764. uniform sampler2D u_revealage;
  11765. in vec2 v_textureCoordinates;
  11766. void main()
  11767. {
  11768. vec4 opaque = texture(u_opaque, v_textureCoordinates);
  11769. vec4 accum = texture(u_accumulation, v_textureCoordinates);
  11770. float r = texture(u_revealage, v_textureCoordinates).r;
  11771. #ifdef MRT
  11772. vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
  11773. #else
  11774. vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
  11775. #endif
  11776. out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;
  11777. if (opaque != czm_backgroundColor)
  11778. {
  11779. out_FragColor.a = 1.0;
  11780. }
  11781. }
  11782. `;function Cg(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 bi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new bi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new bi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new bi({createColorAttachments:!1}),this._opaqueClearCommand=new si({color:new U(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new si({color:new U(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new si({color:new U(0,0,0,0),owner:this}),this._alphaClearCommand=new si({color:new U(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 Je,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function HSe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Qee(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function WSe(e){HSe(e),Qee(e)}function qCt(e,t,n,i){HSe(e),e._accumulationTexture=new Dt({context:t,width:n,height:i,pixelFormat:Xe.RGBA,pixelDatatype:je.FLOAT}),e._revealageTexture=new Dt({context:t,pixelFormat:Xe.RGBA,pixelDatatype:je.FLOAT,width:n,height:i,flipY:!1})}function YCt(e,t){Qee(e);let n=ee.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)&&(Qee(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 a=e._translucentFBO.status===n,s=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!a||!s||!c||!u)&&(WSe(e),e._translucentMultipassSupport=!1,i=!1)}return i}Cg.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:a}=this._opaqueTexture,s=this._accumulationTexture,c=!l(s)||s.width!==r||s.height!==a||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,qCt(this,e,r,a)),(!l(this._translucentFBO.framebuffer)||c||u)&&!YCt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new He({sources:[uG]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new He({defines:["MRT"],sources:[xR]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new He({sources:[xR]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=a;let g=!Je.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,Je.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Je.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!Je.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.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 XCt={enabled:!0,color:new U(0,0,0,0),equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:qo.ONE,functionDestinationRgb:qo.ONE,functionSourceAlpha:qo.ZERO,functionDestinationAlpha:qo.ONE_MINUS_SOURCE_ALPHA},KCt={enabled:!0,color:new U(0,0,0,0),equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:qo.ONE,functionDestinationRgb:qo.ONE,functionSourceAlpha:qo.ONE,functionDestinationAlpha:qo.ONE},QCt={enabled:!0,color:new U(0,0,0,0),equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:qo.ZERO,functionDestinationRgb:qo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:qo.ZERO,functionDestinationAlpha:qo.ONE_MINUS_SOURCE_ALPHA};function $ee(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function $Ct(e,t,n){return $ee(t,XCt,e._translucentRenderStateCache,n)}function JCt(e,t,n){return $ee(t,KCt,e._translucentRenderStateCache,n)}function ZCt(e,t,n){return $ee(t,QCt,e._alphaRenderStateCache,n)}var eEt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
  11783. float ai = czm_out_FragColor.a;
  11784. float wzi = czm_alphaWeight(ai);
  11785. out_FragData_0 = vec4(Ci * wzi, ai);
  11786. out_FragData_1 = vec4(ai * wzi);
  11787. `,tEt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
  11788. float ai = czm_out_FragColor.a;
  11789. float wzi = czm_alphaWeight(ai);
  11790. out_FragColor = vec4(Ci, ai) * wzi;
  11791. `,nEt=` float ai = czm_out_FragColor.a;
  11792. out_FragColor = vec4(ai);
  11793. `;function Jee(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(f){return He.replaceMain(f,"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")}),s.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT
  11794. vec4 czm_out_FragColor;
  11795. bool czm_discard = false;
  11796. `);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]};
  11797. ${u}`}return s.sources.push(u),s.sources.push(`void main()
  11798. {
  11799. czm_translucent_main();
  11800. if (czm_discard)
  11801. {
  11802. discard;
  11803. }
  11804. ${i}}
  11805. `),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}function iEt(e,t){return Jee(e,t,"translucentMRT",eEt)}function oEt(e,t){return Jee(e,t,"translucentMultipass",tEt)}function rEt(e,t){return Jee(e,t,"alphaMultipass",nEt)}Cg.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let s,c;return l(n.translucentCommand)&&(s=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=tt.shallowClone(e,n.translucentCommand),!l(s)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=iEt(t,e.shaderProgram),n.translucentCommand.renderState=$Ct(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=s,n.translucentCommand.renderState=c),n}let i,o,r,a;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,a=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=oEt(t,e.shaderProgram),n.translucentCommand.renderState=JCt(this,t,e.renderState),n.alphaCommand.shaderProgram=rEt(t,e.shaderProgram),n.alphaCommand.renderState=ZCt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=a),n};function aEt(e,t,n,i,o,r){let{context:a,frameState:s}=t,{useLogDepth:c,shadowState:u}=s,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(a,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(a,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let A=o[m];A=c?A.derivedCommands.logDepth.command:A,A=f?A.derivedCommands.hdr.command:A;let y=p&&A.receiveShadows?A.derivedCommands.oit.shadows.translucentCommand:A.derivedCommands.oit.translucentCommand;n(y,t,i,g)}if(l(r)){let m=r.unclassifiedCommand,A=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(A,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let A=o[m];A=c?A.derivedCommands.logDepth.command:A,A=f?A.derivedCommands.hdr.command:A;let y=p&&A.receiveShadows?A.derivedCommands.oit.shadows.alphaCommand:A.derivedCommands.oit.alphaCommand;n(y,t,i,g)}if(l(r)){let m=r.unclassifiedCommand,A=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(A,t,i,g)}i.framebuffer=d}function sEt(e,t,n,i,o,r){let{context:a,frameState:s}=t,{useLogDepth:c,shadowState:u}=s,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(a,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let A=o[m];A=c?A.derivedCommands.logDepth.command:A,A=f?A.derivedCommands.hdr.command:A;let y=p&&A.receiveShadows?A.derivedCommands.oit.shadows.translucentCommand:A.derivedCommands.oit.translucentCommand;n(y,t,i,g)}if(l(r)){let m=r.unclassifiedCommand,A=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(A,t,i,g)}i.framebuffer=d}Cg.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){sEt(this,e,t,n,i,o);return}aEt(this,e,t,n,i,o)};Cg.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};Cg.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,U.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};Cg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};Cg.prototype.isDestroyed=function(){return!1};Cg.prototype.destroy=function(){return WSe(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()),fe(this)};var fG=Cg;function bR(){this._framebuffer=new bi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(bR.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function cEt(e){e._framebuffer.destroy()}function lEt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new _l(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Je},o.viewport=new Je,e._passState=o}bR.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&lEt(this,e);let r=this.framebuffer,a=this._passState;return a.framebuffer=r,a.viewport.width=i,a.viewport.height=o,a.scissorTest.rectangle.x=t.x,a.scissorTest.rectangle.y=o-t.y,a.scissorTest.rectangle.width=1,a.scissorTest.rectangle.height=1,a};bR.prototype.isDestroyed=function(){return!1};bR.prototype.destroy=function(){return cEt(this),fe(this)};var dG=bR;function Ub(e){let t=new _l(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Je},t.viewport=new Je,this._context=e,this._fb=new bi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function qSe(e,t,n,i,o=1){let r=Math.max(n,i),a=r*r,s=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,d=0,p=-1,g=new Set;for(let m=0;m<a;++m){if(-s<=u&&u<=s&&-c<=f&&f<=c){let A=4*((c-f)*n+u+s),y=U.bytesToRgba(t[A],t[A+1],t[A+2],t[A+3]),x=e.getObjectByPickColor(y);if(l(x)&&(g.add(x),g.size>=o))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let A=d;d=-p,p=A}u+=d,f+=p}return[...g]}Ub.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Je.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};Ub.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,o=e.height??1,r=this._context,a=this._fb.framebuffer,s=je.UNSIGNED_BYTE,c=Xe.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=r.readPixelsToPBO({x:e.x,y:e.y,width:i,height:o,framebuffer:a}),f=ON.create({context:r});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=Xe.createTypedArray(c,s,i,o);return u.getBufferData(d),qSe(r,d,i,o,n)}catch{throw new re("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};Ub.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,o=this._context,r=o.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return qSe(o,r,n,i,t)};Ub.prototype.readCenterPixel=function(e){let t=e.width??1,n=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),s=4*(Math.floor(n*.5)*t+r);return o.slice(s,s+4)};Ub.prototype.isDestroyed=function(){return!1};Ub.prototype.destroy=function(){return this._fb.destroy(),fe(this)};var hG=Ub;function Eg(){this._numSamples=1,this._colorFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new U(0,0,0,0),this._clearCommand=new si({color:new U(0,0,0,0),depth:1,owner:this})}function uEt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(Eg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});Eg.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,a=n?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,a),this._idFramebuffer.update(e,o,r)};Eg.prototype.clear=function(e,t,n){U.clone(n,this._clearCommand.color),U.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};Eg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};Eg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};Eg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};Eg.prototype.isDestroyed=function(){return!1};Eg.prototype.destroy=function(){return uEt(this),fe(this)};var BS=Eg;function Vb(){}Vb.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};Vb.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=He.findPositionVarying(e),a=l(r);if(t&&!a){let s=o.length;for(let u=0;u<s;++u)o[u]=He.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC;
  11806. void main()
  11807. {
  11808. czm_shadow_cast_main();
  11809. v_positionEC = (czm_inverseProjection * gl_Position).xyz;
  11810. }`)}return new He({defines:i,sources:o})};Vb.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let a=He.findPositionVarying(e),s=l(a);s||(a="v_positionEC");let c=r.length;for(let f=0;f<c;++f)r[f]=He.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(s||(u+=`in vec3 v_positionEC;
  11811. `),u+=`uniform vec4 shadowMap_lightPositionEC;
  11812. `),i?u+=`void main()
  11813. {
  11814. `:u+=`void main()
  11815. {
  11816. czm_shadow_cast_main();
  11817. if (out_FragColor.a == 0.0)
  11818. {
  11819. discard;
  11820. }
  11821. `,t?u+=` float distance = length(${a});
  11822. if (distance >= shadowMap_lightPositionEC.w)
  11823. {
  11824. discard;
  11825. }
  11826. distance /= shadowMap_lightPositionEC.w; // radius
  11827. out_FragColor = czm_packDepth(distance);
  11828. `:n?u+=` out_FragColor = vec4(1.0);
  11829. `:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z);
  11830. `,u+=`}
  11831. `,r.push(u),new He({defines:o,sources:r})};Vb.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,a=e._isPointLight,s=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${a}${s}${c}${u}${f}${t}${n}${i}`};Vb.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 He({defines:i,sources:o})};Vb.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=He.findNormalVarying(e),a=!i&&l(r)||i&&o,s=He.findPositionVarying(e),c=l(s),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,A=t.softShadows,y=d?t._pointBias:i?t._terrainBias:t._primitiveBias,x=e.defines.slice(0),b=e.sources.slice(0),T=b.length;for(let w=0;w<T;++w)b[w]=He.replaceMain(b[w],"czm_shadow_receive_main");d?x.push("USE_CUBE_MAP_SHADOW"):u&&x.push("USE_SHADOW_DEPTH_TEXTURE"),A&&!d&&x.push("USE_SOFT_SHADOWS"),g&&n&&i&&(a?x.push("ENABLE_VERTEX_LIGHTING"):x.push("ENABLE_DAYNIGHT_SHADING")),n&&y.normalShading&&a&&(x.push("USE_NORMAL_SHADING"),y.normalShadingSmooth>0&&x.push("USE_NORMAL_SHADING_SMOOTH"));let E="";d?E+=`uniform samplerCube shadowMap_textureCube;
  11832. `:E+=`uniform sampler2D shadowMap_texture;
  11833. `;let S;return c?S=` return vec4(${s}, 1.0);
  11834. `:S=`#ifndef LOG_DEPTH
  11835. return czm_windowToEyeCoordinates(gl_FragCoord);
  11836. #else
  11837. return vec4(v_logPositionEC, 1.0);
  11838. #endif
  11839. `,E+=`uniform mat4 shadowMap_matrix;
  11840. uniform vec3 shadowMap_lightDirectionEC;
  11841. uniform vec4 shadowMap_lightPositionEC;
  11842. uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;
  11843. uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;
  11844. #ifdef LOG_DEPTH
  11845. in vec3 v_logPositionEC;
  11846. #endif
  11847. vec4 getPositionEC()
  11848. {
  11849. ${S}}
  11850. vec3 getNormalEC()
  11851. {
  11852. ${a?` return normalize(${r});
  11853. `:` return vec3(1.0);
  11854. `}}
  11855. void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
  11856. {
  11857. ${y.normalOffset&&a?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x;
  11858. float normalOffsetScale = 1.0 - nDotL;
  11859. vec3 offset = normalOffset * normalOffsetScale * normalEC;
  11860. positionEC.xyz += offset;
  11861. `:""}}
  11862. `,E+=`void main()
  11863. {
  11864. czm_shadow_receive_main();
  11865. vec4 positionEC = getPositionEC();
  11866. vec3 normalEC = getNormalEC();
  11867. float depth = -positionEC.z;
  11868. `,E+=` czm_shadowParameters shadowParameters;
  11869. shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
  11870. shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
  11871. shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
  11872. shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
  11873. `,i?E+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
  11874. `:f||(E+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
  11875. `),d?E+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz;
  11876. float distance = length(directionEC);
  11877. directionEC = normalize(directionEC);
  11878. float radius = shadowMap_lightPositionEC.w;
  11879. // Stop early if the fragment is beyond the point light radius
  11880. if (distance > radius)
  11881. {
  11882. return;
  11883. }
  11884. vec3 directionWC = czm_inverseViewRotation * directionEC;
  11885. shadowParameters.depth = distance / radius;
  11886. shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
  11887. shadowParameters.texCoords = directionWC;
  11888. float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters);
  11889. `:p?E+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);
  11890. float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
  11891. applyNormalOffset(positionEC, normalEC, nDotL);
  11892. vec4 shadowPosition = shadowMap_matrix * positionEC;
  11893. // Spot light uses a perspective projection, so perform the perspective divide
  11894. shadowPosition /= shadowPosition.w;
  11895. // Stop early if the fragment is not in the shadow bounds
  11896. if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
  11897. {
  11898. return;
  11899. }
  11900. shadowParameters.texCoords = shadowPosition.xy;
  11901. shadowParameters.depth = shadowPosition.z;
  11902. shadowParameters.nDotL = nDotL;
  11903. float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
  11904. `:g?E+=` float maxDepth = shadowMap_cascadeSplits[1].w;
  11905. // Stop early if the eye depth exceeds the last cascade
  11906. if (depth > maxDepth)
  11907. {
  11908. return;
  11909. }
  11910. // Get the cascade based on the eye-space depth
  11911. vec4 weights = czm_cascadeWeights(depth);
  11912. // Apply normal offset
  11913. float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
  11914. applyNormalOffset(positionEC, normalEC, nDotL);
  11915. // Transform position into the cascade
  11916. vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC;
  11917. // Get visibility
  11918. shadowParameters.texCoords = shadowPosition.xy;
  11919. shadowParameters.depth = shadowPosition.z;
  11920. shadowParameters.nDotL = nDotL;
  11921. float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
  11922. // Fade out shadows that are far away
  11923. float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z;
  11924. float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0);
  11925. visibility = mix(visibility, 1.0, fade);
  11926. ${m?` // Draw cascade colors for debugging
  11927. out_FragColor *= czm_cascadeColor(weights);
  11928. `:""}`:E+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
  11929. applyNormalOffset(positionEC, normalEC, nDotL);
  11930. vec4 shadowPosition = shadowMap_matrix * positionEC;
  11931. // Stop early if the fragment is not in the shadow bounds
  11932. if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
  11933. {
  11934. return;
  11935. }
  11936. shadowParameters.texCoords = shadowPosition.xy;
  11937. shadowParameters.depth = shadowPosition.z;
  11938. shadowParameters.nDotL = nDotL;
  11939. float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
  11940. `,E+=` out_FragColor.rgb *= visibility;
  11941. }
  11942. `,b.push(E),new He({defines:x,sources:b})};var vg=Vb;function Gp(e){e=e??G.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(cn.isEdge()||(cn.isChrome()||cn.isFirefox())&&cn.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 R,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new mG,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ce,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new z,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new ga:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new R,new R,new R,new R],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 fEt(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,ete(this),this._clearCommand=new si({depth:1,color:new U}),this._clearPassState=new _l(t),this._size=e.size??2048,this.size=this._size}Gp.MAXIMUM_DISTANCE=2e4;function fEt(e){this.camera=new mG,this.passState=new _l(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Zee(e,t){return Ve.fromCache({cull:{enabled:!0,face:Li.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 ete(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Zee(t,e._primitiveBias),e._terrainRenderState=Zee(t,e._terrainBias),e._pointRenderState=Zee(t,e._pointBias)}Gp.prototype.debugCreateRenderStates=function(){ete(this)};Object.defineProperties(Gp.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){_Et(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 tte(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 dEt(e,t){let n=new Wf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:tu.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:jt.NEAREST}),o=new pa({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let a=0;a<r;++a){let s=e._passes[a];s.framebuffer=o,s.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function hEt(e,t){let n=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Xe.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),i=new pa({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let a=e._passes[r];a.framebuffer=i,a.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function mEt(e,t){let n=new Wf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:tu.DEPTH_COMPONENT16}),i=new oa({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:jt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let a=new pa({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),s=e._passes[r];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function KSe(e,t){e._isPointLight?mEt(e,t):e._usesDepthTexture?hEt(e,t):dEt(e,t)}function pEt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ee.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,ete(e),tte(e),KSe(e,t))}function gEt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(tte(e),KSe(e,t),pEt(e,t),QSe(e,t))}function QSe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function _Et(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Mt.maximumCubeMapSize>=t?t:Mt.maximumCubeMapSize,o.x=t,o.y=t;let r=new Je(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=Mt.maximumTextureSize>=t?t:Mt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Je(0,0,t,t)):i===4&&(t=Mt.maximumTextureSize>=t*2?t:Mt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Je(0,0,t,t),n[1].passState.viewport=new Je(t,0,t,t),n[2].passState.viewport=new Je(0,t,t,t),n[3].passState.viewport=new Je(t,t,t,t));e._clearPassState.viewport=new Je(0,0,o.x,o.y);for(let r=0;r<i;++r){let a=n[r],s=a.passState.viewport,c=s.x/o.x,u=s.y/o.y,f=s.width/o.x,d=s.height/o.y;a.textureOffsets=new R(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var AEt=new Je;function yEt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube;
  11943. in vec2 v_textureCoordinates;
  11944. void main()
  11945. {
  11946. vec2 uv = v_textureCoordinates;
  11947. vec3 dir;
  11948. if (uv.y < 0.5)
  11949. {
  11950. if (uv.x < 0.333)
  11951. {
  11952. dir.x = -1.0;
  11953. dir.y = uv.x * 6.0 - 1.0;
  11954. dir.z = uv.y * 4.0 - 1.0;
  11955. }
  11956. else if (uv.x < 0.666)
  11957. {
  11958. dir.y = -1.0;
  11959. dir.x = uv.x * 6.0 - 3.0;
  11960. dir.z = uv.y * 4.0 - 1.0;
  11961. }
  11962. else
  11963. {
  11964. dir.z = -1.0;
  11965. dir.x = uv.x * 6.0 - 5.0;
  11966. dir.y = uv.y * 4.0 - 1.0;
  11967. }
  11968. }
  11969. else
  11970. {
  11971. if (uv.x < 0.333)
  11972. {
  11973. dir.x = 1.0;
  11974. dir.y = uv.x * 6.0 - 1.0;
  11975. dir.z = uv.y * 4.0 - 3.0;
  11976. }
  11977. else if (uv.x < 0.666)
  11978. {
  11979. dir.y = 1.0;
  11980. dir.x = uv.x * 6.0 - 3.0;
  11981. dir.z = uv.y * 4.0 - 3.0;
  11982. }
  11983. else
  11984. {
  11985. dir.z = 1.0;
  11986. dir.x = uv.x * 6.0 - 5.0;
  11987. dir.y = uv.y * 4.0 - 3.0;
  11988. }
  11989. }
  11990. float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir));
  11991. out_FragColor = vec4(vec3(shadow), 1.0);
  11992. }
  11993. `:n=`uniform sampler2D shadowMap_texture;
  11994. in vec2 v_textureCoordinates;
  11995. void main()
  11996. {
  11997. ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r;
  11998. `:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates));
  11999. `} out_FragColor = vec4(vec3(shadow), 1.0);
  12000. }
  12001. `;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ie.OVERLAY,i}function xEt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,a=AEt;a.x=i-r,a.y=0,a.width=r,a.height=r;let s=e._debugShadowViewCommand;l(s)||(s=yEt(e,n),e._debugShadowViewCommand=s),(!l(s.renderState)||!Je.equals(s.renderState.viewport,a))&&(s.renderState=Ve.fromCache({viewport:Je.clone(a)})),t.commandList.push(e._debugShadowViewCommand)}var Hp=new Array(8);Hp[0]=new se(-1,-1,-1,1);Hp[1]=new se(1,-1,-1,1);Hp[2]=new se(1,1,-1,1);Hp[3]=new se(-1,1,-1,1);Hp[4]=new se(-1,-1,1,1);Hp[5]=new se(1,-1,1,1);Hp[6]=new se(1,1,1,1);Hp[7]=new se(-1,1,1,1);var oy=new R,nte=new Array(8);for(let e=0;e<8;++e)nte[e]=new se;function bEt(e,t){let n=new Bt({geometry:new Sm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Yt.fromColor(t)}}),i=new Bt({geometry:new fA({radius:.5}),attributes:{color:Yt.fromColor(t)}});return new Pn({geometryInstances:[n,i],appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var TEt=[U.RED,U.GREEN,U.BLUE,U.MAGENTA],CEt=new h;function EEt(e,t){xEt(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 bg({camera:e._sceneCamera,color:U.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new bg({camera:e._shadowMapCamera,color:U.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 bg({camera:e._passes[i].camera,color:TEt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Le.IDENTITY,r=e._pointLightRadius*2,a=h.fromElements(r,r,r,CEt),s=R.fromTranslationQuaternionRotationScale(i,o,a,oy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=bEt(s,U.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new bg({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function mG(){this.viewMatrix=new R,this.inverseViewMatrix=new R,this.frustum=void 0,this.positionCartographic=new de,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 R}mG.prototype.clone=function(e){R.clone(e.viewMatrix,this.viewMatrix),R.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),de.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 vEt=new R(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);mG.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return R.multiply(t,e,this.viewProjectionMatrix),R.multiply(vEt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var SEt=new Array(5),wEt=new Gi,IEt=new Array(4),$Se=new h,JSe=new h;function DEt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,a=e._numberOfCascades,s,c=r-o,u=r/o,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=IEt,g=SEt;for(g[0]=o,g[a]=r,s=0;s<a;++s){let L=(s+1)/a,_=o*Math.pow(u,L),C=o+c*L,v=D.lerp(C,_,f);g[s+1]=v,p[s]=v-g[s]}if(d){for(s=0;s<a;++s)p[s]=Math.min(p[s],e._maximumCascadeDistances[s]);let L=g[0];for(s=0;s<a-1;++s)L+=p[s],g[s+1]=L}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,A=m.left,y=m.right,x=m.bottom,b=m.top,T=m.near,E=m.far,S=n.positionWC,w=n.directionWC,P=n.upWC,O=i.frustum.clone(wEt),B=n.getViewProjection();for(s=0;s<a;++s){O.near=g[s],O.far=g[s+1];let L=R.multiply(O.projectionMatrix,i.viewMatrix,oy),_=R.inverse(L,oy),C=R.multiply(B,_,oy),v=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,$Se),I=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,JSe);for(let V=0;V<8;++V){let F=se.clone(Hp[V],nte[V]);R.multiplyByVector(C,F,F),h.divideByScalar(F,F.w,F),h.minimumByComponent(F,v,v),h.maximumByComponent(F,I,I)}v.x=Math.max(v.x,0),v.y=Math.max(v.y,0),v.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let M=e._passes[s],N=M.camera;N.clone(n);let j=N.frustum;j.left=A+v.x*(y-A),j.right=A+I.x*(y-A),j.bottom=x+v.y*(b-x),j.top=x+I.y*(b-x),j.near=T+v.z*(E-T),j.far=T+I.z*(E-T),M.cullingVolume=N.frustum.computeCullingVolume(S,w,P);let k=e._cascadeMatrices[s];R.multiply(N.getViewProjection(),i.inverseViewMatrix,k),R.multiply(M.textureOffsets,k,k)}}var PEt=new R,REt=new h,OEt=new h,YSe=new h;function MEt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=R.multiply(i.frustum.projectionMatrix,i.viewMatrix,oy),r=R.inverse(o,oy),a=n.directionWC,s=i.directionWC;h.equalsEpsilon(a,s,D.EPSILON10)&&(s=i.upWC);let c=h.cross(a,s,REt);s=h.cross(c,a,OEt),h.normalize(s,s),h.normalize(c,c);let u=h.fromElements(0,0,0,YSe),f=R.computeView(u,a,s,c,PEt),d=R.multiply(f,r,oy),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,$Se),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,JSe);for(let E=0;E<8;++E){let S=se.clone(Hp[E],nte[E]);R.multiplyByVector(d,S,S),h.divideByScalar(S,S.w,S),h.minimumByComponent(S,p,p),h.maximumByComponent(S,g,g)}g.z+=1e3,p.z-=10;let m=YSe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let A=R.fromTranslation(m,oy);f=R.multiply(A,f,f);let y=.5*(g.x-p.x),x=.5*(g.y-p.y),b=g.z-p.z,T=n.frustum;T.left=-y,T.right=y,T.bottom=-x,T.top=x,T.near=.01,T.far=b,R.clone(f,n.viewMatrix),R.inverse(f,n.inverseViewMatrix),R.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(a,n.directionWC),h.clone(s,n.upWC),h.clone(c,n.rightWC)}var BEt=[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)],LEt=[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)],NEt=[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 FEt(e,t){let n=new Gi;n.fov=D.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=BEt[i],o.upWC=LEt[i],o.rightWC=NEt[i],R.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),R.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var kEt=new h,zEt=new h,ZSe=new ce,XSe=ZSe.center;function UEt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=ZSe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,kEt),a=h.negate(i.directionWC,zEt),s=h.dot(r,a);if(e.fadingEnabled){let c=D.clamp(s/.1,0,1);e._darkness=D.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(s<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)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ce.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,a=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,XSe),XSe);o.center=a,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ce.clone(o,e._boundingSphere)}}function VEt(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 a=e._lightDirectionEC;R.multiplyByPointAsVector(n.viewMatrix,r.directionWC,a),h.normalize(a,a),h.negate(a,a),R.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let s,c;e._fitNearFar?(s=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,s+1)):(s=n.frustum.near,c=e.maximumDistance),e._sceneCamera=vo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=s,e._sceneCamera.frustum.far=c,e._distance=c-s,UEt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Gp.prototype.update=function(e){if(VEt(this,e),this._needsUpdate)if(gEt(this,e.context),this._isPointLight&&FEt(this,e),this._cascadesEnabled&&(MEt(this,e),this._numberOfCascades>1&&DEt(this,e)),this._isPointLight)this._shadowMapCullingVolume=is.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;R.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&EEt(this,e)};Gp.prototype.updatePass=function(e,t){QSe(this,e,t)};var jEt=new z;function ewe(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=jEt;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 It(t,o,!1)}function GEt(e,t,n,i,o,r){let a,s,c;if(l(r)&&(a=r.shaderProgram,s=r.renderState,c=r.uniformMap),r=tt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(a)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ie.GLOBE,d=n.pass!==Ie.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=vg.getShadowCastShaderKeyword(p,f,g,d);if(a=i.shaderCache.getDerivedShaderProgram(u,m),!l(a)){let y=u.vertexShaderSource,x=u.fragmentShaderSource,b=vg.createShadowCastVertexShader(y,p,f),T=vg.createShadowCastFragmentShader(x,p,g,d);a=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:b,fragmentShaderSource:T,attributeLocations:u._attributeLocations})}s=e._primitiveRenderState,p?s=e._pointRenderState:f&&(s=e._terrainRenderState),n.renderState.cull.enabled||(s=qe(s,!1),s.cull=qe(s.cull,!1),s.cull.enabled=!1,s=Ve.fromCache(s)),c=ewe(e,n.uniformMap,f)}return r.shaderProgram=a,r.renderState=s,r.uniformMap=c,r}Gp.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,a=t.shaderProgram,s=a.vertexShaderSource,c=a.fragmentShaderSource,u=t.pass===Ie.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let d,p;l(o.receiveCommand)&&(d=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,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let A=vg.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(a,A),!l(d)){let y=vg.createShadowReceiveVertexShader(s,u,f),x=vg.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(a,A,{vertexShaderSource:y,fragmentShaderSource:x,attributeLocations:a._attributeLocations})}p=ewe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=d,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Gp.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let a=o.castShaderProgramId,s=e.length;r.length=s;for(let c=0;c<s;++c)r[c]=GEt(e[c],n,t,i,a,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Gp.prototype.isDestroyed=function(){return!1};Gp.prototype.destroy=function(){tte(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 fe(this)};var ry=Gp;var pG=`uniform sampler2D u_opaqueDepthTexture;
  12002. uniform sampler2D u_translucentDepthTexture;
  12003. in vec2 v_textureCoordinates;
  12004. void main()
  12005. {
  12006. float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;
  12007. float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;
  12008. translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
  12009. out_FragColor = czm_packDepth(translucentDepth);
  12010. }
  12011. `;var LS=`uniform sampler2D colorTexture;
  12012. #ifdef DEBUG_SHOW_DEPTH
  12013. uniform sampler2D u_packedTranslucentDepth;
  12014. #endif
  12015. in vec2 v_textureCoordinates;
  12016. void main()
  12017. {
  12018. #ifdef DEBUG_SHOW_DEPTH
  12019. if (v_textureCoordinates.x < 0.5)
  12020. {
  12021. out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));
  12022. out_FragColor.a = 1.0;
  12023. }
  12024. #else
  12025. vec4 color = texture(colorTexture, v_textureCoordinates);
  12026. #ifdef PICK
  12027. if (color == vec4(0.0))
  12028. {
  12029. discard;
  12030. }
  12031. #else
  12032. // Reverse premultiplication process to get the correct composited result of the classification primitives
  12033. color.rgb /= color.a;
  12034. #endif
  12035. out_FragColor = color;
  12036. #endif
  12037. }
  12038. `;var HEt=!1;function ay(e){this._drawClassificationFBO=new bi({createDepthAttachments:!1}),this._accumulationFBO=new bi({createDepthAttachments:!1}),this._packFBO=new bi,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 si({color:new U(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new si({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Je,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(ay.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function twe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function nwe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function WEt(e,t,n,i){twe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:Xe.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:jt.NEAREST})}function qEt(e,t,n,i){nwe(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 YEt(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)&&(WEt(e,t,o,r),qEt(e,t,o,r));let a,s;if(l(e._packDepthCommand)||(a=new He({sources:[pG]}),s={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),!l(e._compositeCommand)){a=new He({sources:[LS]}),s={colorTexture:function(){return e._textureToComposite}},HEt&&(a.defines=["DEBUG_SHOW_DEPTH"],s.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new He({sources:a.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=tt.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(a=new He({sources:[LS]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),l(e._accumulateCommand)||(a=new He({sources:[LS]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!Je.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Je.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Je.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Je.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Je.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Xn.EQUAL,reference:Ht.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Je.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:Jt.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}ay.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,a=e.context,s=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){YEt(this,a,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(a,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(a,n)),n.framebuffer=s}};ay.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,a=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(Ie.CESIUM_3D_TILE_CLASSIFICATION);let s=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ie.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=s,n.framebuffer=a,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=a)};ay.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),XEt(this,e,t)};function XEt(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}ay.prototype.isSupported=function(){return this._supported};ay.prototype.isDestroyed=function(){return!1};ay.prototype.destroy=function(){return twe(this),nwe(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()),fe(this)};var gG=ay;function KEt(){this.command=void 0,this.near=void 0,this.far=void 0}function _G(e,t,n){let i=e.context,o;i.depthTexture&&(o=new cG);let r;e._useOIT&&i.depthTexture&&(r=new fG(i));let a=new _l(i);a.viewport=Je.clone(n),this.camera=t,this._cameraClone=vo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=a,this.pickFramebuffer=new hG(i),this.pickDepthFramebuffer=new dG,this.sceneFramebuffer=new BS,this.edgeFramebuffer=new aG,this.globeDepth=o,this.globeTranslucencyFramebuffer=new lG,this.oit=r,this.translucentTileClassification=new gG(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var ite=new h,ote=new h;function QEt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,ite)),h.maximumComponent(h.abs(t.position,ote))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,ite),h.multiplyByScalar(t.position,o,ote),h.equalsEpsilon(ite,ote,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&R.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}_G.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return QEt(t,n,D.EPSILON15)?(this._cameraStartFired&&zi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=zi(),vo.clone(t,n),!0)};function $Et(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:a}=o,s=a?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===ie.SCENE2D,u=t.nearToFarDistance2D;i*=1+D.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(s));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(s,p)*n),m=Math.min(i,s*g));let A=d[p];l(A)?(A.near=g,A.far=m):A=d[p]=new sG(g,m)}}function JEt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:a}=e;for(let s=0;s<a.length;++s){let c=a[s];if(o>c.far)continue;if(r<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<s),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:s}=e,{debugOverlappingFrustums:c}=i,u=s.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++s.totalCommands}t.updateDerivedCommands(i)}var iwe=new is,ZEt=new ia;_G.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:a,frustum:s}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let B=0;B<f.length;++B)for(let L=0;L<Ie.NUMBER_OF_PASSES;++L)f[B].indices[L]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,A=-Number.MAX_VALUE,{shadowsEnabled:y}=o,x=+Number.MAX_VALUE,b=-Number.MAX_VALUE,T=Number.MAX_VALUE,E=t.mode===ie.SCENE3D?t.occluder:void 0,{cullingVolume:S}=t,w=iwe.planes;for(let B=0;B<5;++B)w[B]=S.planes[B];S=iwe;for(let B=0;B<i.length;++B){let L=i[B],{pass:_,boundingVolume:C}=L;if(_===Ie.COMPUTE)c.push(L);else if(_===Ie.OVERLAY)u.push(L);else{let v,I;if(l(C)){if(!e.isVisible(S,L,E))continue;let N=C.computePlaneDistances(r,a,ZEt);if(v=N.start,I=N.stop,m=Math.min(m,v),A=Math.max(A,I),y&&L.receiveShadows&&v<ry.MAXIMUM_DISTANCE&&!(_===Ie.GLOBE&&v<-100&&I>100)){let j=I-v;_!==Ie.GLOBE&&v<100&&(T=Math.min(T,j)),x=Math.min(x,v),b=Math.max(b,I)}}else L instanceof si?(v=s.near,I=s.far):(v=s.near,I=s.far,m=Math.min(m,v),A=Math.max(A,I));let M=d[g];l(M)||(M=d[g]=new KEt),M.command=L,M.near=v,M.far=I,g++}}y&&(x=Math.min(Math.max(x,s.near),s.far),b=Math.max(Math.min(b,s.far),x),o.nearPlane=x,o.farPlane=b,o.closestObjectSize=T),$Et(this,e,m,A);for(let B=0;B<g;B++)JEt(this,e,d[B]);if(g<p)for(let B=g;B<p;B++){let L=d[B];if(!l(L.command))break;L.command=void 0}let P=f.length,{frustumSplits:O}=t;O.length=P+1;for(let B=0;B<P;++B)O[B]=f[B].near,B===P-1&&(O[B+1]=f[B].far)};_G.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.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.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 NS=_G;var rwe=.1,evt=new nm({pass:or.MOST_DETAILED_PRELOAD}),tvt=new nm({pass:or.MOST_DETAILED_PICK}),TR=new nm({pass:or.PICK});function _s(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Je(0,0,1,1),n=new vo(e);n.frustum=new fn({width:rwe,aspectRatio:1,near:.1}),this._pickOffscreenView=new NS(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 rG,n[t]=i),i};var nvt=new ga,ivt=new h,AG=new h,ovt=new z,rvt=new R;function avt(e,t,n,i,o){let r=e.camera,a=r.frustum,s=a.offCenterFrustum;l(s)&&(a=s);let c=2*(t.x-o.x)/o.width-1;c*=(a.right-a.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(a.top-a.bottom)*.5;let f=R.clone(r.transform,rvt);r._setTransform(R.IDENTITY);let d=h.clone(r.position,ivt);h.multiplyByScalar(r.right,c,AG),h.add(AG,d,d),h.multiplyByScalar(r.up,u,AG),h.add(AG,d,d),r._setTransform(f),e.mode===ie.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=a.getPixelDimensions(o.width,o.height,1,1,ovt),g=nvt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=a.near,g.far=a.far,g.computeCullingVolume(d,r.directionWC,r.upWC)}var svt=new Ru,cvt=new z;function lvt(e,t,n,i,o){let r=e.camera,a=r.frustum,s=a.near,c=Math.tan(a.fovy*.5),u=a.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,d=2*(o.height-t.y-o.y)/o.height-1,p=f*s*u,g=d*s*c,m=a.getPixelDimensions(o.width,o.height,1,1,cvt),A=m.x*n*.5,y=m.y*i*.5,x=svt;return x.top=g+y,x.bottom=g-y,x.right=p+A,x.left=p-A,x.near=s,x.far=a.far,x.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function yG(e,t,n,i,o){let r=e.camera.frustum;return r instanceof fn||r instanceof ga?avt(e,t,n,i,o):lvt(e,t,n,i,o)}var CR=new Je(0,0,3,3),xG=new z,ER=new U(0,0,0,0);function rte(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}function awe(e,t,n,i,o){let{context:r,frameState:a,defaultView:s}=e,{viewport:c,pickFramebuffer:u}=s;e.view=s,c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let f=s.passState;f.viewport=Je.clone(c,f.viewport);let d=io.transformWindowToDrawingBuffer(e,t,xG);rte(r.drawingBufferHeight,d,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=yG(e,d,n.width,n.height,c),a.invertClassification=!1,a.passes.pick=!0,a.tilesetPassState=TR,r.uniformState.update(a),e.updateEnvironment(),f=u.begin(n,c),e.updateAndExecuteCommands(f,ER),e.resolveFramebuffers(f)}function swe(e){let{context:t}=e;t.endFrame()}_s.prototype.pickAsync=async function(e,t,n,i,o=1){let{context:r,frameState:a,defaultView:s}=e,{pickFramebuffer:c}=s,u=CR;awe(e,t,u,n,i);let f;return r.webgl2?f=c.endAsync(u,a,o):(f=c.end(u,o),f=Promise.resolve(f),_t("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),swe(e),f};_s.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:a}=r,s=CR;awe(e,t,s,n,i);let c=a.end(s,o);return swe(e),c};_s.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:a}=e,{viewport:s,pickFramebuffer:c}=a;e.view=a,s.x=0,s.y=0,s.width=o.drawingBufferWidth,s.height=o.drawingBufferHeight;let u=a.passState;u.viewport=Je.clone(s,u.viewport);let f=io.transformWindowToDrawingBuffer(e,t,xG),d=rte(o.drawingBufferHeight,f,n,i,CR);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=yG(e,f,d.width,d.height,s),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=TR,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(d,s),e.updateAndExecuteCommands(u,ER),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return o.endFrame(),p};_s.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:a,pickFramebuffer:s}=r;e.view=r,a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;let c=r.passState;c.viewport=Je.clone(a,c.viewport);let u=io.transformWindowToDrawingBuffer(e,t,xG),f=rte(i.drawingBufferHeight,u,1,1,CR);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=yG(e,u,f.width,f.height,a),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=TR,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=s.begin(f,a),e.updateAndExecuteCommands(c,ER);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=s.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,oG.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function uvt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:a,pickDepthFramebuffer:s}=n;e.view=n,a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;let c=n.passState;c.viewport=Je.clone(a,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=yG(e,t,1,1,a),o.tilesetPassState=TR,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=s.update(i,t,a),e.updateAndExecuteCommands(c,ER),e.resolveFramebuffers(c),i.endFrame()}var fvt=new Gi,dvt=new Ru,hvt=new fn,mvt=new ga;_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:a,defaultView:s}=e,{uniformState:c}=o;e.view=s;let u=io.transformWindowToDrawingBuffer(e,t,xG);e.pickTranslucentDepth?uvt(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(a.frustum.fov)?f=a.frustum.clone(fvt):l(a.frustum.infiniteProjectionMatrix)?f=a.frustum.clone(dvt):l(a.frustum.width)?f=a.frustum.clone(hvt):f=a.frustum.clone(mvt);let{frustumCommandsList:d}=s,p=d.length;for(let g=0;g<p;++g){let A=this.getPickDepth(e,g).getDepth(o,u.x,u.y);if(l(A)&&A>0&&A<1){let y=d[g],x;return e.mode===ie.SCENE2D?(x=a.position.z,a.position.z=x-y.near+1,f.far=Math.max(1,y.far-y.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=y.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=y.far,c.updateFrustum(f)),n=io.drawingBufferToWorldCoordinates(e,u,A,n),e.mode===ie.SCENE2D&&(a.position.z=x,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var pvt=new de;_s.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ie.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,pvt);o.cartographicToCartesian(r,n)}return n};function gvt(e,t,n,i,o,r){for(let a of e){let s=a.object,c=a.position,u=a.exclude;if(l(c)&&!l(s))return n.push(a),!0;if(!l(s)||!l(s.primitive)||!u&&(n.push(a),n.length>=t))return!0;let f=s.primitive,d=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(s.id)){let p=f.getGeometryInstanceAttributes(s.id);l(p)&&l(p.show)&&(d=!0,p.show=En.toValue(!1,p.show),o.push(p))}s instanceof as&&(d=!0,s.show=!1,r.push(s)),d||(f.show=!1,i.push(f))}}function cwe(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let a=e(t);for(;l(a)&&a.length>0&&!gvt(a,t,n,i,o,r);)a=e(t-n.length);for(let s=0;s<i.length;++s)i[s].show=!0;for(let s=0;s<o.length;++s){let c=o[s];c.show=En.toValue(!0,c.show)}for(let s=0;s<r.length;++s)r[s].show=!0;return n}_s.prototype.drillPick=function(e,t,n,i,o){return cwe(s=>this.pick(e,t,i,o,s).map(u=>({object:u,position:void 0,exclude:!1})),n).map(s=>s.object)};var owe=new h,_vt=new h;function Avt(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 lwe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,owe),a=h.cross(o,r,owe),s=h.cross(o,a,_vt);return i.position=t.origin,i.direction=o,i.up=s,i.right=a,i.frustum.width=n??rwe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function yvt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:a}=n,s=e._pickOffscreenView.camera,c=lwe(e,o,r,s),u=evt;u.camera=s,u.cullingVolume=c;let f=!0,d=a.length;for(let p=0;p<d;++p){let g=a[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}_s.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)yvt(this,e,t[n])&&t.splice(n--,1)};function uwe(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 Eu&&uwe(o,t,n))}}function bG(e,t,n,i,o,r){let a=[];if(uwe(t.primitives,i,a),a.length===0)return Promise.resolve(r());let s=new Avt(n,o,a);return e._mostDetailedRayPicks.push(s),s.promise.then(function(){return r()})}function xvt(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 bvt(e,t,n,i,o,r,a){let{context:s,frameState:c}=t,u=s.uniformState,f=e._pickOffscreenView;t.view=f,lwe(e,n,o,f.camera);let d=Je.clone(f.viewport,CR),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,a?c.tilesetPassState=tvt:c.tilesetPassState=TR,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,ER),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d,1)[0];if(t.context.depthTexture){let{frustumCommandsList:A}=f,y=A.length;for(let x=0;x<y;++x){let T=e.getPickDepth(t,x).getDepth(s,0,0);if(l(T)&&T>0&&T<1){let E=A[x],S=E.near*(x!==0?t.opaqueFrustumNearOffset:1),w=E.far,P=S+T*(w-S);g=An.getPoint(n,P);break}}}if(t.view=t.defaultView,s.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&r||xvt(m,i)}}function ate(e,t,n,i,o,r,a,s){return cwe(function(){let u=bvt(e,t,n,o,r,a,s);return u?[u]:void 0},i)}function FS(e,t,n,i,o,r,a){let s=ate(e,t,n,1,i,o,r,a);if(s.length>0)return s[0]}function TG(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 FS(this,e,t,n,i,!1,!1)};_s.prototype.drillPickFromRay=function(e,t,n,i,o){return ate(this,e,t,n,i,o,!1,!1)};_s.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=An.clone(t),n=l(n)?n.slice():n,TG(e,bG(o,e,t,n,i,function(){return FS(o,e,t,n,i,!1,!0)}))};_s.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=An.clone(t),i=l(i)?i.slice():i,TG(e,bG(r,e,t,i,o,function(){return ate(r,e,t,n,i,o,!1,!0)}))};var Tvt=new h,Cvt=new h,Evt=new An,fwe=new de;function ste(e,t){let n=e.ellipsoid,i=wi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,Cvt),r=de.toCartesian(t,n,Tvt),a=Evt;a.origin=r,a.direction=o;let s=new An;return An.getPoint(a,i,s.origin),h.negate(o,s.direction),s}function dwe(e,t){let n=e.ellipsoid,i=de.fromCartesian(t,n,fwe);return ste(e,i)}function hwe(e,t){let n=e.ellipsoid;return de.fromCartesian(t,n,fwe).height}function vvt(e,t,n,i,o){let r=ste(t,n);return bG(e,t,r,i,o,function(){let a=FS(e,t,r,i,o,!0,!0);if(l(a))return hwe(t,a.position)})}function Svt(e,t,n,i,o,r){let a=dwe(t,n);return bG(e,t,a,i,o,function(){let s=FS(e,t,a,i,o,!0,!0);if(l(s))return h.clone(s.position,r)})}_s.prototype.sampleHeight=function(e,t,n,i){let o=ste(e,t),r=FS(this,e,o,n,i,!0,!1);if(l(r))return hwe(e,r.position)};_s.prototype.clampToHeight=function(e,t,n,i,o){let r=dwe(e,t),a=FS(this,e,r,n,i,!0,!1);if(l(a))return h.clone(a.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 a=0;a<o;++a)r[a]=vvt(this,e,t[a],n,i);return TG(e,Promise.all(r).then(function(a){let s=a.length;for(let c=0;c<s;++c)t[c].height=a[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 a=0;a<o;++a)r[a]=Svt(this,e,t[a],n,i,t[a]);return TG(e,Promise.all(r).then(function(a){let s=a.length;for(let c=0;c<s;++c)t[c]=a[c];return t}))};_s.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var CG=_s;var EG=`uniform sampler2D colorTexture;
  12039. in vec2 v_textureCoordinates;
  12040. #ifdef AUTO_EXPOSURE
  12041. uniform sampler2D autoExposure;
  12042. #else
  12043. uniform float exposure;
  12044. #endif
  12045. void main()
  12046. {
  12047. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  12048. vec3 color = fragmentColor.rgb;
  12049. #ifdef AUTO_EXPOSURE
  12050. color /= texture(autoExposure, vec2(0.5)).r;
  12051. #else
  12052. color *= vec3(exposure);
  12053. #endif
  12054. color = czm_acesTonemapping(color);
  12055. color = czm_inverseGamma(color);
  12056. out_FragColor = vec4(color, fragmentColor.a);
  12057. }
  12058. `;var vG=`precision highp float;
  12059. uniform sampler2D randomTexture;
  12060. uniform sampler2D depthTexture;
  12061. uniform float intensity;
  12062. uniform float bias;
  12063. uniform float lengthCap;
  12064. uniform int stepCount;
  12065. uniform int directionCount;
  12066. vec4 pixelToEye(vec2 screenCoordinate)
  12067. {
  12068. vec2 uv = screenCoordinate / czm_viewport.zw;
  12069. float depth = czm_readDepth(depthTexture, uv);
  12070. vec2 xy = 2.0 * uv - vec2(1.0);
  12071. vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
  12072. posEC = posEC / posEC.w;
  12073. // Avoid numerical error at far plane
  12074. if (depth >= 1.0) {
  12075. posEC.z = czm_currentFrustum.y;
  12076. }
  12077. return posEC;
  12078. }
  12079. // Reconstruct surface normal in eye coordinates, avoiding edges
  12080. vec3 getNormalXEdge(vec3 positionEC)
  12081. {
  12082. // Find the 3D surface positions at adjacent screen pixels
  12083. vec2 centerCoord = gl_FragCoord.xy;
  12084. vec3 positionLeft = pixelToEye(centerCoord + vec2(-1.0, 0.0)).xyz;
  12085. vec3 positionRight = pixelToEye(centerCoord + vec2(1.0, 0.0)).xyz;
  12086. vec3 positionUp = pixelToEye(centerCoord + vec2(0.0, 1.0)).xyz;
  12087. vec3 positionDown = pixelToEye(centerCoord + vec2(0.0, -1.0)).xyz;
  12088. // Compute potential tangent vectors
  12089. vec3 dx0 = positionEC - positionLeft;
  12090. vec3 dx1 = positionRight - positionEC;
  12091. vec3 dy0 = positionEC - positionDown;
  12092. vec3 dy1 = positionUp - positionEC;
  12093. // The shorter tangent is more likely to be on the same surface
  12094. vec3 dx = length(dx0) < length(dx1) ? dx0 : dx1;
  12095. vec3 dy = length(dy0) < length(dy1) ? dy0 : dy1;
  12096. return normalize(cross(dx, dy));
  12097. }
  12098. const float sqrtTwoPi = sqrt(czm_twoPi);
  12099. float gaussian(float x, float standardDeviation) {
  12100. float argument = x / standardDeviation;
  12101. return exp(-0.5 * argument * argument) / (sqrtTwoPi * standardDeviation);
  12102. }
  12103. void main(void)
  12104. {
  12105. vec4 positionEC = pixelToEye(gl_FragCoord.xy);
  12106. // Exit if we are too close to the back of the frustum, where the depth value is invalid.
  12107. float maxValidDepth = czm_currentFrustum.y - lengthCap;
  12108. if (-positionEC.z > maxValidDepth)
  12109. {
  12110. out_FragColor = vec4(1.0);
  12111. return;
  12112. }
  12113. vec3 normalEC = getNormalXEdge(positionEC.xyz);
  12114. float gaussianVariance = lengthCap * sqrt(-positionEC.z);
  12115. // Choose a step length such that the marching stops just before 3 * variance.
  12116. float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0);
  12117. float metersPerPixel = czm_metersPerPixel(positionEC, 1.0);
  12118. // Minimum step is 1 pixel to avoid double sampling
  12119. float pixelsPerStep = max(stepLength / metersPerPixel, 1.0);
  12120. stepLength = pixelsPerStep * metersPerPixel;
  12121. float angleStepScale = 1.0 / float(directionCount);
  12122. float angleStep = angleStepScale * czm_twoPi;
  12123. float cosStep = cos(angleStep);
  12124. float sinStep = sin(angleStep);
  12125. mat2 rotateStep = mat2(cosStep, sinStep, -sinStep, cosStep);
  12126. // Initial sampling direction (different for each pixel)
  12127. const float randomTextureSize = 255.0;
  12128. vec2 randomTexCoord = fract(gl_FragCoord.xy / randomTextureSize);
  12129. float randomVal = texture(randomTexture, randomTexCoord).x;
  12130. vec2 sampleDirection = vec2(cos(angleStep * randomVal), sin(angleStep * randomVal));
  12131. float ao = 0.0;
  12132. // Loop over sampling directions
  12133. #if __VERSION__ == 300
  12134. for (int i = 0; i < directionCount; i++)
  12135. {
  12136. #else
  12137. for (int i = 0; i < 16; i++)
  12138. {
  12139. if (i >= directionCount) {
  12140. break;
  12141. }
  12142. #endif
  12143. sampleDirection = rotateStep * sampleDirection;
  12144. float localAO = 0.0;
  12145. vec2 radialStep = pixelsPerStep * sampleDirection;
  12146. #if __VERSION__ == 300
  12147. for (int j = 0; j < stepCount; j++)
  12148. {
  12149. #else
  12150. for (int j = 0; j < 64; j++)
  12151. {
  12152. if (j >= stepCount) {
  12153. break;
  12154. }
  12155. #endif
  12156. // Step along sampling direction, away from output pixel
  12157. vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5);
  12158. // Exit if we stepped off the screen
  12159. if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) {
  12160. break;
  12161. }
  12162. // Compute step vector from output point to sampled point
  12163. vec4 samplePositionEC = pixelToEye(samplePixel);
  12164. vec3 stepVector = samplePositionEC.xyz - positionEC.xyz;
  12165. // Estimate the angle from the surface normal.
  12166. float dotVal = clamp(dot(normalEC, normalize(stepVector)), 0.0, 1.0);
  12167. dotVal = czm_branchFreeTernary(dotVal > bias, dotVal, 0.0);
  12168. dotVal = czm_branchFreeTernary(-samplePositionEC.z <= maxValidDepth, dotVal, 0.0);
  12169. // Weight contribution based on the distance from the output point
  12170. float sampleDistance = length(stepVector);
  12171. float weight = gaussian(sampleDistance, gaussianVariance);
  12172. localAO += weight * dotVal;
  12173. }
  12174. ao += localAO;
  12175. }
  12176. ao *= angleStepScale * stepLength;
  12177. ao = 1.0 - clamp(ao, 0.0, 1.0);
  12178. ao = pow(ao, intensity);
  12179. out_FragColor = vec4(vec3(ao), 1.0);
  12180. }
  12181. `;var SG=`uniform sampler2D colorTexture;
  12182. uniform sampler2D ambientOcclusionTexture;
  12183. uniform bool ambientOcclusionOnly;
  12184. in vec2 v_textureCoordinates;
  12185. void main(void)
  12186. {
  12187. vec4 color = texture(colorTexture, v_textureCoordinates);
  12188. vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates);
  12189. out_FragColor = ambientOcclusionOnly ? ao : ao * color;
  12190. }
  12191. `;var wG=`uniform sampler2D colorTexture;
  12192. uniform float gradations;
  12193. in vec2 v_textureCoordinates;
  12194. void main(void)
  12195. {
  12196. vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
  12197. #ifdef CZM_SELECTED_FEATURE
  12198. if (czm_selected()) {
  12199. out_FragColor = vec4(rgb, 1.0);
  12200. return;
  12201. }
  12202. #endif
  12203. float luminance = czm_luminance(rgb);
  12204. float darkness = luminance * gradations;
  12205. darkness = (darkness - fract(darkness)) / gradations;
  12206. out_FragColor = vec4(vec3(darkness), 1.0);
  12207. }
  12208. `;var IG=`uniform sampler2D colorTexture;
  12209. uniform sampler2D bloomTexture;
  12210. uniform bool glowOnly;
  12211. in vec2 v_textureCoordinates;
  12212. void main(void)
  12213. {
  12214. vec4 color = texture(colorTexture, v_textureCoordinates);
  12215. #ifdef CZM_SELECTED_FEATURE
  12216. if (czm_selected()) {
  12217. out_FragColor = color;
  12218. return;
  12219. }
  12220. #endif
  12221. vec4 bloom = texture(bloomTexture, v_textureCoordinates);
  12222. out_FragColor = glowOnly ? bloom : bloom + color;
  12223. }
  12224. `;var DG=`uniform sampler2D colorTexture;
  12225. uniform float brightness;
  12226. in vec2 v_textureCoordinates;
  12227. void main(void)
  12228. {
  12229. vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
  12230. vec3 target = vec3(0.0);
  12231. out_FragColor = vec4(mix(target, rgb, brightness), 1.0);
  12232. }
  12233. `;var PG=`uniform sampler2D colorTexture;
  12234. uniform float contrast;
  12235. uniform float brightness;
  12236. in vec2 v_textureCoordinates;
  12237. void main(void)
  12238. {
  12239. vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz;
  12240. sceneColor = czm_RGBToHSB(sceneColor);
  12241. sceneColor.z += brightness;
  12242. sceneColor = czm_HSBToRGB(sceneColor);
  12243. float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));
  12244. sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);
  12245. out_FragColor = vec4(sceneColor, 1.0);
  12246. }
  12247. `;var RG=`uniform sampler2D colorTexture;
  12248. uniform sampler2D blurTexture;
  12249. uniform sampler2D depthTexture;
  12250. uniform float focalDistance;
  12251. in vec2 v_textureCoordinates;
  12252. vec4 toEye(vec2 uv, float depth)
  12253. {
  12254. vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
  12255. vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);
  12256. posInCamera = posInCamera / posInCamera.w;
  12257. return posInCamera;
  12258. }
  12259. float computeDepthBlur(float depth)
  12260. {
  12261. float f;
  12262. if (depth < focalDistance)
  12263. {
  12264. f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);
  12265. }
  12266. else
  12267. {
  12268. f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);
  12269. f = pow(f, 0.1);
  12270. }
  12271. f *= f;
  12272. f = clamp(f, 0.0, 1.0);
  12273. return pow(f, 0.5);
  12274. }
  12275. void main(void)
  12276. {
  12277. float depth = czm_readDepth(depthTexture, v_textureCoordinates);
  12278. vec4 posInCamera = toEye(v_textureCoordinates, depth);
  12279. float d = computeDepthBlur(-posInCamera.z);
  12280. out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d);
  12281. }
  12282. `;var OG=`uniform sampler2D depthTexture;
  12283. in vec2 v_textureCoordinates;
  12284. void main(void)
  12285. {
  12286. float depth = czm_readDepth(depthTexture, v_textureCoordinates);
  12287. out_FragColor = vec4(vec3(depth), 1.0);
  12288. }
  12289. `;var MG=`uniform sampler2D depthTexture;
  12290. uniform float length;
  12291. uniform vec4 color;
  12292. in vec2 v_textureCoordinates;
  12293. void main(void)
  12294. {
  12295. float directions[3];
  12296. directions[0] = -1.0;
  12297. directions[1] = 0.0;
  12298. directions[2] = 1.0;
  12299. float scalars[3];
  12300. scalars[0] = 3.0;
  12301. scalars[1] = 10.0;
  12302. scalars[2] = 3.0;
  12303. float padx = czm_pixelRatio / czm_viewport.z;
  12304. float pady = czm_pixelRatio / czm_viewport.w;
  12305. #ifdef CZM_SELECTED_FEATURE
  12306. bool selected = false;
  12307. for (int i = 0; i < 3; ++i)
  12308. {
  12309. float dir = directions[i];
  12310. selected = selected || czm_selected(vec2(-padx, dir * pady));
  12311. selected = selected || czm_selected(vec2(padx, dir * pady));
  12312. selected = selected || czm_selected(vec2(dir * padx, -pady));
  12313. selected = selected || czm_selected(vec2(dir * padx, pady));
  12314. if (selected)
  12315. {
  12316. break;
  12317. }
  12318. }
  12319. if (!selected)
  12320. {
  12321. out_FragColor = vec4(color.rgb, 0.0);
  12322. return;
  12323. }
  12324. #endif
  12325. float horizEdge = 0.0;
  12326. float vertEdge = 0.0;
  12327. for (int i = 0; i < 3; ++i)
  12328. {
  12329. float dir = directions[i];
  12330. float scale = scalars[i];
  12331. horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;
  12332. horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;
  12333. vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;
  12334. vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;
  12335. }
  12336. float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);
  12337. out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);
  12338. }
  12339. `;var BG=`uniform sampler2D colorTexture;
  12340. in vec2 v_textureCoordinates;
  12341. #ifdef AUTO_EXPOSURE
  12342. uniform sampler2D autoExposure;
  12343. #else
  12344. uniform float exposure;
  12345. #endif
  12346. // See slides 142 and 143:
  12347. // http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting
  12348. void main()
  12349. {
  12350. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  12351. vec3 color = fragmentColor.rgb;
  12352. #ifdef AUTO_EXPOSURE
  12353. float exposure = texture(autoExposure, vec2(0.5)).r;
  12354. color /= exposure;
  12355. #else
  12356. color *= vec3(exposure);
  12357. #endif
  12358. const float A = 0.22; // shoulder strength
  12359. const float B = 0.30; // linear strength
  12360. const float C = 0.10; // linear angle
  12361. const float D = 0.20; // toe strength
  12362. const float E = 0.01; // toe numerator
  12363. const float F = 0.30; // toe denominator
  12364. const float white = 11.2; // linear white point value
  12365. vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;
  12366. float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;
  12367. c = czm_inverseGamma(c / w);
  12368. out_FragColor = vec4(c, fragmentColor.a);
  12369. }
  12370. `;var LG=`uniform sampler2D colorTexture;
  12371. in vec2 v_textureCoordinates;
  12372. #ifdef AUTO_EXPOSURE
  12373. uniform sampler2D autoExposure;
  12374. #else
  12375. uniform float exposure;
  12376. #endif
  12377. void main()
  12378. {
  12379. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  12380. vec3 color = fragmentColor.rgb;
  12381. #ifdef AUTO_EXPOSURE
  12382. color /= texture(autoExposure, vec2(0.5)).r;
  12383. #else
  12384. color *= vec3(exposure);
  12385. #endif
  12386. color = czm_pbrNeutralTonemapping(color);
  12387. color = czm_inverseGamma(color);
  12388. out_FragColor = vec4(color, fragmentColor.a);
  12389. }
  12390. `;var NG=`in vec2 v_textureCoordinates;
  12391. uniform sampler2D colorTexture;
  12392. const float fxaaQualitySubpix = 0.5;
  12393. const float fxaaQualityEdgeThreshold = 0.125;
  12394. const float fxaaQualityEdgeThresholdMin = 0.0833;
  12395. void main()
  12396. {
  12397. vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;
  12398. vec4 color = FxaaPixelShader(
  12399. v_textureCoordinates,
  12400. colorTexture,
  12401. fxaaQualityRcpFrame,
  12402. fxaaQualitySubpix,
  12403. fxaaQualityEdgeThreshold,
  12404. fxaaQualityEdgeThresholdMin);
  12405. float alpha = texture(colorTexture, v_textureCoordinates).a;
  12406. out_FragColor = vec4(color.rgb, alpha);
  12407. }
  12408. `;var jb=`#define SAMPLES 8
  12409. uniform float delta;
  12410. uniform float sigma;
  12411. uniform float direction; // 0.0 for x direction, 1.0 for y direction
  12412. uniform sampler2D colorTexture;
  12413. #ifdef USE_STEP_SIZE
  12414. uniform float stepSize;
  12415. #else
  12416. uniform vec2 step;
  12417. #endif
  12418. in vec2 v_textureCoordinates;
  12419. // Incremental Computation of the Gaussian:
  12420. // https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html
  12421. void main()
  12422. {
  12423. vec2 st = v_textureCoordinates;
  12424. vec2 dir = vec2(1.0 - direction, direction);
  12425. #ifdef USE_STEP_SIZE
  12426. vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));
  12427. #else
  12428. vec2 step = step;
  12429. #endif
  12430. vec3 g;
  12431. g.x = 1.0 / (sqrt(czm_twoPi) * sigma);
  12432. g.y = exp((-0.5 * delta * delta) / (sigma * sigma));
  12433. g.z = g.y * g.y;
  12434. vec4 result = texture(colorTexture, st) * g.x;
  12435. for (int i = 1; i < SAMPLES; ++i)
  12436. {
  12437. g.xy *= g.yz;
  12438. vec2 offset = float(i) * dir * step;
  12439. result += texture(colorTexture, st - offset) * g.x;
  12440. result += texture(colorTexture, st + offset) * g.x;
  12441. }
  12442. out_FragColor = result;
  12443. }
  12444. `;var FG=`uniform sampler2D colorTexture;
  12445. uniform sampler2D dirtTexture;
  12446. uniform sampler2D starTexture;
  12447. uniform vec2 dirtTextureDimensions;
  12448. uniform float distortion;
  12449. uniform float ghostDispersal;
  12450. uniform float haloWidth;
  12451. uniform float dirtAmount;
  12452. uniform float earthRadius;
  12453. uniform float intensity;
  12454. in vec2 v_textureCoordinates;
  12455. // whether it is in space or not
  12456. // 6500000.0 is empirical value
  12457. #define DISTANCE_TO_SPACE 6500000.0
  12458. // return ndc from world coordinate biased earthRadius
  12459. vec4 getNDCFromWC(vec3 WC, float earthRadius)
  12460. {
  12461. vec4 positionEC = czm_view * vec4(WC, 1.0);
  12462. positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);
  12463. vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
  12464. return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);
  12465. }
  12466. // Check if current pixel is included Earth
  12467. // if then mask it gradually
  12468. float isInEarth(vec2 texcoord, vec2 sceneSize)
  12469. {
  12470. vec2 NDC = texcoord * 2.0 - 1.0;
  12471. vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);
  12472. vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);
  12473. NDC.xy -= earthPosSC.xy;
  12474. float X = abs(NDC.x) * sceneSize.x;
  12475. float Y = abs(NDC.y) * sceneSize.y;
  12476. return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));
  12477. }
  12478. // For Chromatic effect
  12479. vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)
  12480. {
  12481. vec2 sceneSize = czm_viewport.zw;
  12482. vec3 color;
  12483. if(isSpace)
  12484. {
  12485. color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;
  12486. color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;
  12487. color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;
  12488. }
  12489. else
  12490. {
  12491. color.r = texture(tex, texcoord + direction * distortion.r).r;
  12492. color.g = texture(tex, texcoord + direction * distortion.g).g;
  12493. color.b = texture(tex, texcoord + direction * distortion.b).b;
  12494. }
  12495. return vec4(clamp(color, 0.0, 1.0), 0.0);
  12496. }
  12497. void main(void)
  12498. {
  12499. vec4 originalColor = texture(colorTexture, v_textureCoordinates);
  12500. vec3 rgb = originalColor.rgb;
  12501. bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;
  12502. // Sun position
  12503. vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);
  12504. vec4 sunPositionEC = czm_view * sunPos;
  12505. vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);
  12506. sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);
  12507. // If sun is not in the screen space, use original color.
  12508. if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
  12509. {
  12510. // Lens flare is disabled when not in space until #5932 is fixed.
  12511. // https://github.com/CesiumGS/cesium/issues/5932
  12512. out_FragColor = originalColor;
  12513. return;
  12514. }
  12515. vec2 texcoord = vec2(1.0) - v_textureCoordinates;
  12516. vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
  12517. vec2 invPixelSize = 1.0 / pixelSize;
  12518. vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);
  12519. // ghost vector to image centre:
  12520. vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
  12521. vec3 direction = normalize(vec3(ghostVec, 0.0));
  12522. // sample ghosts:
  12523. vec4 result = vec4(0.0);
  12524. vec4 ghost = vec4(0.0);
  12525. for (int i = 0; i < 4; ++i)
  12526. {
  12527. vec2 offset = fract(texcoord + ghostVec * float(i));
  12528. // Only bright spots from the centre of the source image
  12529. ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
  12530. }
  12531. result += ghost;
  12532. // sample halo
  12533. vec2 haloVec = normalize(ghostVec) * haloWidth;
  12534. float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
  12535. weightForHalo = pow(1.0 - weightForHalo, 5.0);
  12536. result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;
  12537. // dirt on lens
  12538. vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;
  12539. if (dirtTexCoords.x > 1.0)
  12540. {
  12541. dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);
  12542. }
  12543. if (dirtTexCoords.y > 1.0)
  12544. {
  12545. dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);
  12546. }
  12547. result += dirtAmount * texture(dirtTexture, dirtTexCoords);
  12548. // Rotating starburst texture's coordinate
  12549. // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))
  12550. float camrot = czm_view[0].z + czm_view[1].y;
  12551. float cosValue = cos(camrot);
  12552. float sinValue = sin(camrot);
  12553. mat3 rotation = mat3(
  12554. cosValue, -sinValue, 0.0,
  12555. sinValue, cosValue, 0.0,
  12556. 0.0, 0.0, 1.0
  12557. );
  12558. vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);
  12559. vec3 st2 = vec3((rotation * st1).xy, 1.0);
  12560. vec3 st3 = st2 * 0.5 + vec3(0.5);
  12561. vec2 lensStarTexcoord = st3.xy;
  12562. float weightForLensFlare = length(vec3(sunPos.xy, 0.0));
  12563. float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);
  12564. if (!isSpace)
  12565. {
  12566. result *= oneMinusWeightForLensFlare * intensity * 0.2;
  12567. }
  12568. else
  12569. {
  12570. result *= oneMinusWeightForLensFlare * intensity;
  12571. result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;
  12572. }
  12573. result += texture(colorTexture, v_textureCoordinates);
  12574. out_FragColor = result;
  12575. }
  12576. `;var kG=`uniform sampler2D colorTexture;
  12577. uniform vec3 white;
  12578. in vec2 v_textureCoordinates;
  12579. #ifdef AUTO_EXPOSURE
  12580. uniform sampler2D autoExposure;
  12581. #else
  12582. uniform float exposure;
  12583. #endif
  12584. // See equation 4:
  12585. // http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
  12586. void main()
  12587. {
  12588. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  12589. vec3 color = fragmentColor.rgb;
  12590. #ifdef AUTO_EXPOSURE
  12591. float exposure = texture(autoExposure, vec2(0.5)).r;
  12592. color /= exposure;
  12593. #else
  12594. color *= vec3(exposure);
  12595. #endif
  12596. color = (color * (1.0 + color / white)) / (1.0 + color);
  12597. color = czm_inverseGamma(color);
  12598. out_FragColor = vec4(color, fragmentColor.a);
  12599. }
  12600. `;var zG=`uniform sampler2D colorTexture;
  12601. in vec2 v_textureCoordinates;
  12602. float rand(vec2 co)
  12603. {
  12604. return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
  12605. }
  12606. void main(void)
  12607. {
  12608. float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;
  12609. vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
  12610. vec3 green = vec3(0.0, 1.0, 0.0);
  12611. out_FragColor = vec4((noiseValue + rgb) * green, 1.0);
  12612. }
  12613. `;var UG=`uniform sampler2D colorTexture;
  12614. in vec2 v_textureCoordinates;
  12615. #ifdef AUTO_EXPOSURE
  12616. uniform sampler2D autoExposure;
  12617. #else
  12618. uniform float exposure;
  12619. #endif
  12620. // See equation 3:
  12621. // http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
  12622. void main()
  12623. {
  12624. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  12625. vec3 color = fragmentColor.rgb;
  12626. #ifdef AUTO_EXPOSURE
  12627. float exposure = texture(autoExposure, vec2(0.5)).r;
  12628. color /= exposure;
  12629. #else
  12630. color *= vec3(exposure);
  12631. #endif
  12632. color = color / (1.0 + color);
  12633. color = czm_inverseGamma(color);
  12634. out_FragColor = vec4(color, fragmentColor.a);
  12635. }
  12636. `;var VG=`uniform sampler2D colorTexture;
  12637. uniform sampler2D silhouetteTexture;
  12638. in vec2 v_textureCoordinates;
  12639. void main(void)
  12640. {
  12641. vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
  12642. vec4 color = texture(colorTexture, v_textureCoordinates);
  12643. out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
  12644. }
  12645. `;/**
  12646. * @license
  12647. * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
  12648. *
  12649. * Redistribution and use in source and binary forms, with or without
  12650. * modification, are permitted provided that the following conditions
  12651. * are met:
  12652. * * Redistributions of source code must retain the above copyright
  12653. * notice, this list of conditions and the following disclaimer.
  12654. * * Redistributions in binary form must reproduce the above copyright
  12655. * notice, this list of conditions and the following disclaimer in the
  12656. * documentation and/or other materials provided with the distribution.
  12657. * * Neither the name of NVIDIA CORPORATION nor the names of its
  12658. * contributors may be used to endorse or promote products derived
  12659. * from this software without specific prior written permission.
  12660. *
  12661. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
  12662. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  12663. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  12664. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  12665. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  12666. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  12667. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  12668. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  12669. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12670. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  12671. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  12672. */var jG=`/**
  12673. * @license
  12674. * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
  12675. *
  12676. * Redistribution and use in source and binary forms, with or without
  12677. * modification, are permitted provided that the following conditions
  12678. * are met:
  12679. * * Redistributions of source code must retain the above copyright
  12680. * notice, this list of conditions and the following disclaimer.
  12681. * * Redistributions in binary form must reproduce the above copyright
  12682. * notice, this list of conditions and the following disclaimer in the
  12683. * documentation and/or other materials provided with the distribution.
  12684. * * Neither the name of NVIDIA CORPORATION nor the names of its
  12685. * contributors may be used to endorse or promote products derived
  12686. * from this software without specific prior written permission.
  12687. *
  12688. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY
  12689. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  12690. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  12691. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  12692. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  12693. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  12694. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  12695. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  12696. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12697. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  12698. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  12699. */
  12700. // NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples
  12701. // Original source (archived): https://archive.org/details/nvidiagame-works-graphics-samples-master
  12702. // Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h
  12703. // Shader link in fork: https://github.com/lyntel/GraphicsSamples/blob/3d30817ebeeade64fe6a4fc3aa1fe4265c29b6fd/samples/es3-kepler/FXAA/FXAA3_11.h
  12704. // Steps used to integrate into Cesium:
  12705. // * The following defines are set:
  12706. // #define FXAA_PC 1
  12707. // #define FXAA_WEBGL_1 1
  12708. // #define FXAA_GREEN_AS_LUMA 1
  12709. // #define FXAA_EARLY_EXIT 1
  12710. // #define FXAA_GLSL_120 1
  12711. // * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.
  12712. // * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace
  12713. // /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.
  12714. // * There are no implicit conversions from ivec* to vec* so replace:
  12715. // #define FxaaInt2 ivec2
  12716. // with
  12717. // #define FxaaInt2 vec2
  12718. // * The texture2DLod function is only available in vertex shaders so replace:
  12719. // #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
  12720. // #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
  12721. // with
  12722. // #define FxaaTexTop(t, p) texture(t, p)
  12723. // #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
  12724. // * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.
  12725. // * The following parameters to FxaaPixelShader are unused and can be removed:
  12726. // fxaaConsolePosPos
  12727. // fxaaConsoleRcpFrameOpt
  12728. // fxaaConsoleRcpFrameOpt2
  12729. // fxaaConsole360RcpFrameOpt2
  12730. // fxaaConsoleEdgeSharpness
  12731. // fxaaConsoleEdgeThreshold
  12732. // fxaaConsoleEdgeThresholdMi
  12733. // fxaaConsole360ConstDir
  12734. //
  12735. // Choose the quality preset.
  12736. // This needs to be compiled into the shader as it effects code.
  12737. // Best option to include multiple presets is to
  12738. // in each shader define the preset, then include this file.
  12739. //
  12740. // OPTIONS
  12741. // -----------------------------------------------------------------------
  12742. // 10 to 15 - default medium dither (10=fastest, 15=highest quality)
  12743. // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
  12744. // 39 - no dither, very expensive
  12745. //
  12746. // NOTES
  12747. // -----------------------------------------------------------------------
  12748. // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
  12749. // 13 = about same speed as FXAA 3.9 and better than 12
  12750. // 23 = closest to FXAA 3.9 visually and performance wise
  12751. // _ = the lowest digit is directly related to performance
  12752. // _ = the highest digit is directly related to style
  12753. //
  12754. //#define FXAA_QUALITY_PRESET 12
  12755. #if (FXAA_QUALITY_PRESET == 10)
  12756. #define FXAA_QUALITY_PS 3
  12757. #define FXAA_QUALITY_P0 1.5
  12758. #define FXAA_QUALITY_P1 3.0
  12759. #define FXAA_QUALITY_P2 12.0
  12760. #endif
  12761. #if (FXAA_QUALITY_PRESET == 11)
  12762. #define FXAA_QUALITY_PS 4
  12763. #define FXAA_QUALITY_P0 1.0
  12764. #define FXAA_QUALITY_P1 1.5
  12765. #define FXAA_QUALITY_P2 3.0
  12766. #define FXAA_QUALITY_P3 12.0
  12767. #endif
  12768. #if (FXAA_QUALITY_PRESET == 12)
  12769. #define FXAA_QUALITY_PS 5
  12770. #define FXAA_QUALITY_P0 1.0
  12771. #define FXAA_QUALITY_P1 1.5
  12772. #define FXAA_QUALITY_P2 2.0
  12773. #define FXAA_QUALITY_P3 4.0
  12774. #define FXAA_QUALITY_P4 12.0
  12775. #endif
  12776. #if (FXAA_QUALITY_PRESET == 13)
  12777. #define FXAA_QUALITY_PS 6
  12778. #define FXAA_QUALITY_P0 1.0
  12779. #define FXAA_QUALITY_P1 1.5
  12780. #define FXAA_QUALITY_P2 2.0
  12781. #define FXAA_QUALITY_P3 2.0
  12782. #define FXAA_QUALITY_P4 4.0
  12783. #define FXAA_QUALITY_P5 12.0
  12784. #endif
  12785. #if (FXAA_QUALITY_PRESET == 14)
  12786. #define FXAA_QUALITY_PS 7
  12787. #define FXAA_QUALITY_P0 1.0
  12788. #define FXAA_QUALITY_P1 1.5
  12789. #define FXAA_QUALITY_P2 2.0
  12790. #define FXAA_QUALITY_P3 2.0
  12791. #define FXAA_QUALITY_P4 2.0
  12792. #define FXAA_QUALITY_P5 4.0
  12793. #define FXAA_QUALITY_P6 12.0
  12794. #endif
  12795. #if (FXAA_QUALITY_PRESET == 15)
  12796. #define FXAA_QUALITY_PS 8
  12797. #define FXAA_QUALITY_P0 1.0
  12798. #define FXAA_QUALITY_P1 1.5
  12799. #define FXAA_QUALITY_P2 2.0
  12800. #define FXAA_QUALITY_P3 2.0
  12801. #define FXAA_QUALITY_P4 2.0
  12802. #define FXAA_QUALITY_P5 2.0
  12803. #define FXAA_QUALITY_P6 4.0
  12804. #define FXAA_QUALITY_P7 12.0
  12805. #endif
  12806. #if (FXAA_QUALITY_PRESET == 20)
  12807. #define FXAA_QUALITY_PS 3
  12808. #define FXAA_QUALITY_P0 1.5
  12809. #define FXAA_QUALITY_P1 2.0
  12810. #define FXAA_QUALITY_P2 8.0
  12811. #endif
  12812. #if (FXAA_QUALITY_PRESET == 21)
  12813. #define FXAA_QUALITY_PS 4
  12814. #define FXAA_QUALITY_P0 1.0
  12815. #define FXAA_QUALITY_P1 1.5
  12816. #define FXAA_QUALITY_P2 2.0
  12817. #define FXAA_QUALITY_P3 8.0
  12818. #endif
  12819. #if (FXAA_QUALITY_PRESET == 22)
  12820. #define FXAA_QUALITY_PS 5
  12821. #define FXAA_QUALITY_P0 1.0
  12822. #define FXAA_QUALITY_P1 1.5
  12823. #define FXAA_QUALITY_P2 2.0
  12824. #define FXAA_QUALITY_P3 2.0
  12825. #define FXAA_QUALITY_P4 8.0
  12826. #endif
  12827. #if (FXAA_QUALITY_PRESET == 23)
  12828. #define FXAA_QUALITY_PS 6
  12829. #define FXAA_QUALITY_P0 1.0
  12830. #define FXAA_QUALITY_P1 1.5
  12831. #define FXAA_QUALITY_P2 2.0
  12832. #define FXAA_QUALITY_P3 2.0
  12833. #define FXAA_QUALITY_P4 2.0
  12834. #define FXAA_QUALITY_P5 8.0
  12835. #endif
  12836. #if (FXAA_QUALITY_PRESET == 24)
  12837. #define FXAA_QUALITY_PS 7
  12838. #define FXAA_QUALITY_P0 1.0
  12839. #define FXAA_QUALITY_P1 1.5
  12840. #define FXAA_QUALITY_P2 2.0
  12841. #define FXAA_QUALITY_P3 2.0
  12842. #define FXAA_QUALITY_P4 2.0
  12843. #define FXAA_QUALITY_P5 3.0
  12844. #define FXAA_QUALITY_P6 8.0
  12845. #endif
  12846. #if (FXAA_QUALITY_PRESET == 25)
  12847. #define FXAA_QUALITY_PS 8
  12848. #define FXAA_QUALITY_P0 1.0
  12849. #define FXAA_QUALITY_P1 1.5
  12850. #define FXAA_QUALITY_P2 2.0
  12851. #define FXAA_QUALITY_P3 2.0
  12852. #define FXAA_QUALITY_P4 2.0
  12853. #define FXAA_QUALITY_P5 2.0
  12854. #define FXAA_QUALITY_P6 4.0
  12855. #define FXAA_QUALITY_P7 8.0
  12856. #endif
  12857. #if (FXAA_QUALITY_PRESET == 26)
  12858. #define FXAA_QUALITY_PS 9
  12859. #define FXAA_QUALITY_P0 1.0
  12860. #define FXAA_QUALITY_P1 1.5
  12861. #define FXAA_QUALITY_P2 2.0
  12862. #define FXAA_QUALITY_P3 2.0
  12863. #define FXAA_QUALITY_P4 2.0
  12864. #define FXAA_QUALITY_P5 2.0
  12865. #define FXAA_QUALITY_P6 2.0
  12866. #define FXAA_QUALITY_P7 4.0
  12867. #define FXAA_QUALITY_P8 8.0
  12868. #endif
  12869. #if (FXAA_QUALITY_PRESET == 27)
  12870. #define FXAA_QUALITY_PS 10
  12871. #define FXAA_QUALITY_P0 1.0
  12872. #define FXAA_QUALITY_P1 1.5
  12873. #define FXAA_QUALITY_P2 2.0
  12874. #define FXAA_QUALITY_P3 2.0
  12875. #define FXAA_QUALITY_P4 2.0
  12876. #define FXAA_QUALITY_P5 2.0
  12877. #define FXAA_QUALITY_P6 2.0
  12878. #define FXAA_QUALITY_P7 2.0
  12879. #define FXAA_QUALITY_P8 4.0
  12880. #define FXAA_QUALITY_P9 8.0
  12881. #endif
  12882. #if (FXAA_QUALITY_PRESET == 28)
  12883. #define FXAA_QUALITY_PS 11
  12884. #define FXAA_QUALITY_P0 1.0
  12885. #define FXAA_QUALITY_P1 1.5
  12886. #define FXAA_QUALITY_P2 2.0
  12887. #define FXAA_QUALITY_P3 2.0
  12888. #define FXAA_QUALITY_P4 2.0
  12889. #define FXAA_QUALITY_P5 2.0
  12890. #define FXAA_QUALITY_P6 2.0
  12891. #define FXAA_QUALITY_P7 2.0
  12892. #define FXAA_QUALITY_P8 2.0
  12893. #define FXAA_QUALITY_P9 4.0
  12894. #define FXAA_QUALITY_P10 8.0
  12895. #endif
  12896. #if (FXAA_QUALITY_PRESET == 29)
  12897. #define FXAA_QUALITY_PS 12
  12898. #define FXAA_QUALITY_P0 1.0
  12899. #define FXAA_QUALITY_P1 1.5
  12900. #define FXAA_QUALITY_P2 2.0
  12901. #define FXAA_QUALITY_P3 2.0
  12902. #define FXAA_QUALITY_P4 2.0
  12903. #define FXAA_QUALITY_P5 2.0
  12904. #define FXAA_QUALITY_P6 2.0
  12905. #define FXAA_QUALITY_P7 2.0
  12906. #define FXAA_QUALITY_P8 2.0
  12907. #define FXAA_QUALITY_P9 2.0
  12908. #define FXAA_QUALITY_P10 4.0
  12909. #define FXAA_QUALITY_P11 8.0
  12910. #endif
  12911. #if (FXAA_QUALITY_PRESET == 39)
  12912. #define FXAA_QUALITY_PS 12
  12913. #define FXAA_QUALITY_P0 1.0
  12914. #define FXAA_QUALITY_P1 1.0
  12915. #define FXAA_QUALITY_P2 1.0
  12916. #define FXAA_QUALITY_P3 1.0
  12917. #define FXAA_QUALITY_P4 1.0
  12918. #define FXAA_QUALITY_P5 1.5
  12919. #define FXAA_QUALITY_P6 2.0
  12920. #define FXAA_QUALITY_P7 2.0
  12921. #define FXAA_QUALITY_P8 2.0
  12922. #define FXAA_QUALITY_P9 2.0
  12923. #define FXAA_QUALITY_P10 4.0
  12924. #define FXAA_QUALITY_P11 8.0
  12925. #endif
  12926. #define FxaaBool bool
  12927. #define FxaaFloat float
  12928. #define FxaaFloat2 vec2
  12929. #define FxaaFloat3 vec3
  12930. #define FxaaFloat4 vec4
  12931. #define FxaaHalf float
  12932. #define FxaaHalf2 vec2
  12933. #define FxaaHalf3 vec3
  12934. #define FxaaHalf4 vec4
  12935. #define FxaaInt2 vec2
  12936. #define FxaaTex sampler2D
  12937. #define FxaaSat(x) clamp(x, 0.0, 1.0)
  12938. #define FxaaTexTop(t, p) texture(t, p)
  12939. #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
  12940. FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
  12941. FxaaFloat4 FxaaPixelShader(
  12942. //
  12943. // Use noperspective interpolation here (turn off perspective interpolation).
  12944. // {xy} = center of pixel
  12945. FxaaFloat2 pos,
  12946. //
  12947. // Input color texture.
  12948. // {rgb_} = color in linear or perceptual color space
  12949. // if (FXAA_GREEN_AS_LUMA == 0)
  12950. // {___a} = luma in perceptual color space (not linear)
  12951. FxaaTex tex,
  12952. //
  12953. // Only used on FXAA Quality.
  12954. // This must be from a constant/uniform.
  12955. // {x_} = 1.0/screenWidthInPixels
  12956. // {_y} = 1.0/screenHeightInPixels
  12957. FxaaFloat2 fxaaQualityRcpFrame,
  12958. //
  12959. // Only used on FXAA Quality.
  12960. // This used to be the FXAA_QUALITY_SUBPIX define.
  12961. // It is here now to allow easier tuning.
  12962. // Choose the amount of sub-pixel aliasing removal.
  12963. // This can effect sharpness.
  12964. // 1.00 - upper limit (softer)
  12965. // 0.75 - default amount of filtering
  12966. // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)
  12967. // 0.25 - almost off
  12968. // 0.00 - completely off
  12969. FxaaFloat fxaaQualitySubpix,
  12970. //
  12971. // Only used on FXAA Quality.
  12972. // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.
  12973. // It is here now to allow easier tuning.
  12974. // The minimum amount of local contrast required to apply algorithm.
  12975. // 0.333 - too little (faster)
  12976. // 0.250 - low quality
  12977. // 0.166 - default
  12978. // 0.125 - high quality
  12979. // 0.063 - overkill (slower)
  12980. FxaaFloat fxaaQualityEdgeThreshold,
  12981. //
  12982. // Only used on FXAA Quality.
  12983. // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.
  12984. // It is here now to allow easier tuning.
  12985. // Trims the algorithm from processing darks.
  12986. // 0.0833 - upper limit (default, the start of visible unfiltered edges)
  12987. // 0.0625 - high quality (faster)
  12988. // 0.0312 - visible limit (slower)
  12989. // Special notes when using FXAA_GREEN_AS_LUMA,
  12990. // Likely want to set this to zero.
  12991. // As colors that are mostly not-green
  12992. // will appear very dark in the green channel!
  12993. // Tune by looking at mostly non-green content,
  12994. // then start at zero and increase until aliasing is a problem.
  12995. FxaaFloat fxaaQualityEdgeThresholdMin
  12996. ) {
  12997. /*--------------------------------------------------------------------------*/
  12998. FxaaFloat2 posM;
  12999. posM.x = pos.x;
  13000. posM.y = pos.y;
  13001. FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
  13002. #define lumaM rgbyM.y
  13003. FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
  13004. FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
  13005. FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
  13006. FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
  13007. /*--------------------------------------------------------------------------*/
  13008. FxaaFloat maxSM = max(lumaS, lumaM);
  13009. FxaaFloat minSM = min(lumaS, lumaM);
  13010. FxaaFloat maxESM = max(lumaE, maxSM);
  13011. FxaaFloat minESM = min(lumaE, minSM);
  13012. FxaaFloat maxWN = max(lumaN, lumaW);
  13013. FxaaFloat minWN = min(lumaN, lumaW);
  13014. FxaaFloat rangeMax = max(maxWN, maxESM);
  13015. FxaaFloat rangeMin = min(minWN, minESM);
  13016. FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
  13017. FxaaFloat range = rangeMax - rangeMin;
  13018. FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
  13019. FxaaBool earlyExit = range < rangeMaxClamped;
  13020. /*--------------------------------------------------------------------------*/
  13021. if(earlyExit)
  13022. return rgbyM;
  13023. /*--------------------------------------------------------------------------*/
  13024. FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
  13025. FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
  13026. FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
  13027. FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
  13028. /*--------------------------------------------------------------------------*/
  13029. FxaaFloat lumaNS = lumaN + lumaS;
  13030. FxaaFloat lumaWE = lumaW + lumaE;
  13031. FxaaFloat subpixRcpRange = 1.0/range;
  13032. FxaaFloat subpixNSWE = lumaNS + lumaWE;
  13033. FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
  13034. FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
  13035. /*--------------------------------------------------------------------------*/
  13036. FxaaFloat lumaNESE = lumaNE + lumaSE;
  13037. FxaaFloat lumaNWNE = lumaNW + lumaNE;
  13038. FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
  13039. FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
  13040. /*--------------------------------------------------------------------------*/
  13041. FxaaFloat lumaNWSW = lumaNW + lumaSW;
  13042. FxaaFloat lumaSWSE = lumaSW + lumaSE;
  13043. FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
  13044. FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
  13045. FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
  13046. FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
  13047. FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
  13048. FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
  13049. /*--------------------------------------------------------------------------*/
  13050. FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
  13051. FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
  13052. FxaaBool horzSpan = edgeHorz >= edgeVert;
  13053. FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
  13054. /*--------------------------------------------------------------------------*/
  13055. if(!horzSpan) lumaN = lumaW;
  13056. if(!horzSpan) lumaS = lumaE;
  13057. if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
  13058. FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
  13059. /*--------------------------------------------------------------------------*/
  13060. FxaaFloat gradientN = lumaN - lumaM;
  13061. FxaaFloat gradientS = lumaS - lumaM;
  13062. FxaaFloat lumaNN = lumaN + lumaM;
  13063. FxaaFloat lumaSS = lumaS + lumaM;
  13064. FxaaBool pairN = abs(gradientN) >= abs(gradientS);
  13065. FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
  13066. if(pairN) lengthSign = -lengthSign;
  13067. FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
  13068. /*--------------------------------------------------------------------------*/
  13069. FxaaFloat2 posB;
  13070. posB.x = posM.x;
  13071. posB.y = posM.y;
  13072. FxaaFloat2 offNP;
  13073. offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
  13074. offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
  13075. if(!horzSpan) posB.x += lengthSign * 0.5;
  13076. if( horzSpan) posB.y += lengthSign * 0.5;
  13077. /*--------------------------------------------------------------------------*/
  13078. FxaaFloat2 posN;
  13079. posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
  13080. posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
  13081. FxaaFloat2 posP;
  13082. posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
  13083. posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
  13084. FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
  13085. FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
  13086. FxaaFloat subpixE = subpixC * subpixC;
  13087. FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
  13088. /*--------------------------------------------------------------------------*/
  13089. if(!pairN) lumaNN = lumaSS;
  13090. FxaaFloat gradientScaled = gradient * 1.0/4.0;
  13091. FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
  13092. FxaaFloat subpixF = subpixD * subpixE;
  13093. FxaaBool lumaMLTZero = lumaMM < 0.0;
  13094. /*--------------------------------------------------------------------------*/
  13095. lumaEndN -= lumaNN * 0.5;
  13096. lumaEndP -= lumaNN * 0.5;
  13097. FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
  13098. FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
  13099. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
  13100. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
  13101. FxaaBool doneNP = (!doneN) || (!doneP);
  13102. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
  13103. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
  13104. /*--------------------------------------------------------------------------*/
  13105. if(doneNP) {
  13106. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13107. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13108. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13109. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13110. doneN = abs(lumaEndN) >= gradientScaled;
  13111. doneP = abs(lumaEndP) >= gradientScaled;
  13112. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
  13113. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
  13114. doneNP = (!doneN) || (!doneP);
  13115. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
  13116. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
  13117. /*--------------------------------------------------------------------------*/
  13118. #if (FXAA_QUALITY_PS > 3)
  13119. if(doneNP) {
  13120. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13121. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13122. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13123. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13124. doneN = abs(lumaEndN) >= gradientScaled;
  13125. doneP = abs(lumaEndP) >= gradientScaled;
  13126. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
  13127. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
  13128. doneNP = (!doneN) || (!doneP);
  13129. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
  13130. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
  13131. /*--------------------------------------------------------------------------*/
  13132. #if (FXAA_QUALITY_PS > 4)
  13133. if(doneNP) {
  13134. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13135. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13136. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13137. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13138. doneN = abs(lumaEndN) >= gradientScaled;
  13139. doneP = abs(lumaEndP) >= gradientScaled;
  13140. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
  13141. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
  13142. doneNP = (!doneN) || (!doneP);
  13143. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
  13144. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
  13145. /*--------------------------------------------------------------------------*/
  13146. #if (FXAA_QUALITY_PS > 5)
  13147. if(doneNP) {
  13148. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13149. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13150. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13151. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13152. doneN = abs(lumaEndN) >= gradientScaled;
  13153. doneP = abs(lumaEndP) >= gradientScaled;
  13154. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
  13155. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
  13156. doneNP = (!doneN) || (!doneP);
  13157. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
  13158. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
  13159. /*--------------------------------------------------------------------------*/
  13160. #if (FXAA_QUALITY_PS > 6)
  13161. if(doneNP) {
  13162. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13163. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13164. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13165. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13166. doneN = abs(lumaEndN) >= gradientScaled;
  13167. doneP = abs(lumaEndP) >= gradientScaled;
  13168. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
  13169. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
  13170. doneNP = (!doneN) || (!doneP);
  13171. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
  13172. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
  13173. /*--------------------------------------------------------------------------*/
  13174. #if (FXAA_QUALITY_PS > 7)
  13175. if(doneNP) {
  13176. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13177. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13178. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13179. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13180. doneN = abs(lumaEndN) >= gradientScaled;
  13181. doneP = abs(lumaEndP) >= gradientScaled;
  13182. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
  13183. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
  13184. doneNP = (!doneN) || (!doneP);
  13185. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
  13186. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
  13187. /*--------------------------------------------------------------------------*/
  13188. #if (FXAA_QUALITY_PS > 8)
  13189. if(doneNP) {
  13190. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13191. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13192. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13193. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13194. doneN = abs(lumaEndN) >= gradientScaled;
  13195. doneP = abs(lumaEndP) >= gradientScaled;
  13196. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
  13197. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
  13198. doneNP = (!doneN) || (!doneP);
  13199. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
  13200. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
  13201. /*--------------------------------------------------------------------------*/
  13202. #if (FXAA_QUALITY_PS > 9)
  13203. if(doneNP) {
  13204. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13205. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13206. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13207. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13208. doneN = abs(lumaEndN) >= gradientScaled;
  13209. doneP = abs(lumaEndP) >= gradientScaled;
  13210. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
  13211. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
  13212. doneNP = (!doneN) || (!doneP);
  13213. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
  13214. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
  13215. /*--------------------------------------------------------------------------*/
  13216. #if (FXAA_QUALITY_PS > 10)
  13217. if(doneNP) {
  13218. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13219. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13220. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13221. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13222. doneN = abs(lumaEndN) >= gradientScaled;
  13223. doneP = abs(lumaEndP) >= gradientScaled;
  13224. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
  13225. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
  13226. doneNP = (!doneN) || (!doneP);
  13227. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
  13228. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
  13229. /*--------------------------------------------------------------------------*/
  13230. #if (FXAA_QUALITY_PS > 11)
  13231. if(doneNP) {
  13232. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13233. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13234. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13235. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13236. doneN = abs(lumaEndN) >= gradientScaled;
  13237. doneP = abs(lumaEndP) >= gradientScaled;
  13238. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
  13239. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
  13240. doneNP = (!doneN) || (!doneP);
  13241. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
  13242. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
  13243. /*--------------------------------------------------------------------------*/
  13244. #if (FXAA_QUALITY_PS > 12)
  13245. if(doneNP) {
  13246. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  13247. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  13248. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  13249. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  13250. doneN = abs(lumaEndN) >= gradientScaled;
  13251. doneP = abs(lumaEndP) >= gradientScaled;
  13252. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
  13253. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
  13254. doneNP = (!doneN) || (!doneP);
  13255. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
  13256. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
  13257. /*--------------------------------------------------------------------------*/
  13258. }
  13259. #endif
  13260. /*--------------------------------------------------------------------------*/
  13261. }
  13262. #endif
  13263. /*--------------------------------------------------------------------------*/
  13264. }
  13265. #endif
  13266. /*--------------------------------------------------------------------------*/
  13267. }
  13268. #endif
  13269. /*--------------------------------------------------------------------------*/
  13270. }
  13271. #endif
  13272. /*--------------------------------------------------------------------------*/
  13273. }
  13274. #endif
  13275. /*--------------------------------------------------------------------------*/
  13276. }
  13277. #endif
  13278. /*--------------------------------------------------------------------------*/
  13279. }
  13280. #endif
  13281. /*--------------------------------------------------------------------------*/
  13282. }
  13283. #endif
  13284. /*--------------------------------------------------------------------------*/
  13285. }
  13286. #endif
  13287. /*--------------------------------------------------------------------------*/
  13288. }
  13289. /*--------------------------------------------------------------------------*/
  13290. FxaaFloat dstN = posM.x - posN.x;
  13291. FxaaFloat dstP = posP.x - posM.x;
  13292. if(!horzSpan) dstN = posM.y - posN.y;
  13293. if(!horzSpan) dstP = posP.y - posM.y;
  13294. /*--------------------------------------------------------------------------*/
  13295. FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
  13296. FxaaFloat spanLength = (dstP + dstN);
  13297. FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
  13298. FxaaFloat spanLengthRcp = 1.0/spanLength;
  13299. /*--------------------------------------------------------------------------*/
  13300. FxaaBool directionN = dstN < dstP;
  13301. FxaaFloat dst = min(dstN, dstP);
  13302. FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
  13303. FxaaFloat subpixG = subpixF * subpixF;
  13304. FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
  13305. FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
  13306. /*--------------------------------------------------------------------------*/
  13307. FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
  13308. FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
  13309. if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
  13310. if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
  13311. return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
  13312. }
  13313. `;function Gb(){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 bi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new z,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(Gb.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 mwe(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 wvt(e,t){mwe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),a=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),a[c]=new bi,a[c].update(t,n,i,1,o);let s=a[r-1].getColorTexture(0);e._previousLuminance.update(t,s.width,s.height,1,o),e._framebuffers=a}function pwe(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 Ivt(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 Dvt(e,t){let n=`uniform sampler2D colorTexture;
  13314. in vec2 v_textureCoordinates;
  13315. float sampleTexture(vec2 offset) {
  13316. `;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset);
  13317. return czm_luminance(color.rgb);
  13318. `:n+=` return texture(colorTexture, v_textureCoordinates + offset).r;
  13319. `,n+=`}
  13320. `,n+=`uniform vec2 colorTextureDimensions;
  13321. uniform vec2 minMaxLuminance;
  13322. uniform sampler2D previousLuminance;
  13323. void main() {
  13324. float color = 0.0;
  13325. float xStep = 1.0 / colorTextureDimensions.x;
  13326. float yStep = 1.0 / colorTextureDimensions.y;
  13327. int count = 0;
  13328. for (int i = 0; i < 3; ++i) {
  13329. for (int j = 0; j < 3; ++j) {
  13330. vec2 offset;
  13331. offset.x = -xStep + float(i) * xStep;
  13332. offset.y = -yStep + float(j) * yStep;
  13333. if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) {
  13334. continue;
  13335. }
  13336. color += sampleTexture(offset);
  13337. ++count;
  13338. }
  13339. }
  13340. if (count > 0) {
  13341. color /= float(count);
  13342. }
  13343. `,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r;
  13344. color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
  13345. color = previous + (color - previous) / (60.0 * 1.5);
  13346. color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
  13347. `),n+=` out_FragColor = vec4(color);
  13348. }
  13349. `,n}function Pvt(e,t){pwe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Dvt(r,i),{framebuffer:n[r].framebuffer,uniformMap:Ivt(e,r)});e._commands=o}Gb.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new si({color:new U(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};Gb.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,wvt(this,e),Pvt(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};Gb.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)};Gb.prototype.isDestroyed=function(){return!1};Gb.prototype.destroy=function(){return mwe(this),pwe(this),fe(this)};var GG=Gb;var Rvt={NEAREST:0,LINEAR:1},Fd=Rvt;function Hb(e){e=e??G.EMPTY_OBJECT;let{name:t=Hn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:a=Fd.NEAREST,pixelFormat:s=Xe.RGBA,pixelDatatype:c=je.UNSIGNED_BYTE,clearColor:u=U.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=a,this._pixelFormat=s,this._pixelDatatype=c,this._clearColor=u,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 d=new _l;d.scissorTest={enabled:!0,rectangle:l(f)?Je.clone(f):new Je},this._passState=d,this._ready=!1,this._name=t,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(Hb.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 Ovt=/uniform\s+sampler2D\s+depthTexture/g;Hb.prototype._isSupported=function(e){return!Ovt.test(this._fragmentShader)||e.depthTexture};function Mvt(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 a=e._actualUniforms,s=a[n];l(s)&&s!==r&&s instanceof Dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(s),delete a[n],delete a[`${n}Dimensions`]),r instanceof Dt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):a[n]=o}}}function Bvt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Lvt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Nvt(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]=Bvt(e,r),n[r]=Mvt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let a=t[r]();(typeof a=="string"||a instanceof Dt||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Lvt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=It(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 Fvt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE
  13350. uniform sampler2D czm_idTexture;
  13351. uniform sampler2D czm_selectedIdTexture;
  13352. uniform float czm_selectedIdTextureStep;
  13353. in vec2 v_textureCoordinates;
  13354. bool czm_selected(vec2 offset)
  13355. {
  13356. bool selected = false;
  13357. vec4 id = texture(czm_idTexture, v_textureCoordinates + offset);
  13358. for (int i = 0; i < ${t}; ++i)
  13359. {
  13360. vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5));
  13361. if (all(equal(id, selectedId)))
  13362. {
  13363. return true;
  13364. }
  13365. }
  13366. return false;
  13367. }
  13368. bool czm_selected()
  13369. {
  13370. return czm_selected(vec2(0.0));
  13371. }
  13372. ${e}`}function kvt(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=Fvt(n,o)}let i=new He({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function zvt(e){let t=e._sampleMode,n,i;t===Fd.LINEAR?(n=Vt.LINEAR,i=ti.LINEAR):(n=Vt.NEAREST,i=ti.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Uvt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Vvt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function jvt(e,t){let n=e._texturesToRelease;for(let s=0;s<n.length;++s){let c=n[s];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let s=0;s<i.length;++s){let{name:c,source:u}=i[s];e._actualUniforms[c]=new Dt({context:t,source:u})}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,a=[];for(let s=0;s<o.length;++s){let c=o[s],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=Vvt(e,u);else if(typeof u=="string"){let d=new De({url:u});a.push(d.fetchImage().then(Uvt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}o.length=0,a.length>0?(e._ready=!1,e._texturePromise=Promise.all(a).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function gwe(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 Dt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function Gvt(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 Hvt(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 a=0;a<n.length;++a){let s=n[a];l(s.pickIds)?i+=s.pickIds.length:l(s.pickId)&&++i}if(n.length===0||i===0){let a=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Dt({context:t,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:a,width:1,height:1},sampler:jt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let a=0;a<n.length;++a){let s=n[a];if(l(s.pickIds)){let c=s.pickIds,u=c.length;for(let f=0;f<u;++f){let d=c[f].color;r[o]=U.floatToByte(d.red),r[o+1]=U.floatToByte(d.green),r[o+2]=U.floatToByte(d.blue),r[o+3]=U.floatToByte(d.alpha),o+=4}}else if(l(s.pickId)){let c=s.pickId.color;r[o]=U.floatToByte(c.red),r[o+1]=U.floatToByte(c.green),r[o+2]=U.floatToByte(c.blue),r[o+3]=U.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Dt({context:t,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:jt.NEAREST})}Hb.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&gwe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Gvt(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,Hvt(this,e),Nvt(this),jvt(this,e),kvt(this,e),zvt(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=Ve.fromCache({viewport:new Je(0,0,i.width,i.height)}))),this._command.renderState=o};Hb.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,jt.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)};Hb.prototype.isDestroyed=function(){return!1};Hb.prototype.destroy=function(){return gwe(this),fe(this)};var Ro=Hb;function Wb(e){e=e??G.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Hn()),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(Wb.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}}});Wb.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};Wb.prototype.get=function(e){return this._stages[e]};function Wvt(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}Wb.prototype.update=function(e,t){this._selectedDirty=Wvt(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)}};Wb.prototype.isDestroyed=function(){return!1};Wb.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var wf=Wb;var $r={};function cte(e){let o=`#define USE_STEP_SIZE
  13373. ${jb}`,r=new Ro({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Fd.LINEAR}),a=new Ro({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Fd.LINEAR}),s={};return Object.defineProperties(s,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=a.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=a.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=a.uniforms;u.stepSize=f.stepSize=c}}}),new wf({name:e,stages:[r,a],uniforms:s})}$r.createBlurStage=function(){return cte("czm_blur")};$r.createDepthOfFieldStage=function(){let e=cte("czm_depth_of_field_blur"),t=new Ro({name:"czm_depth_of_field_composite",fragmentShader:RG,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 wf({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};$r.isDepthOfFieldSupported=function(e){return e.context.depthTexture};$r.createEdgeDetectionStage=function(){let e=Hn();return new Ro({name:`czm_edge_detection_${e}`,fragmentShader:MG,uniforms:{length:.25,color:U.clone(U.BLACK)}})};$r.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function qvt(e){if(!l(e))return $r.createEdgeDetectionStage();let t=new wf({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let s=0;s<e.length;++s)i+=`uniform sampler2D edgeTexture${s};
  13374. `,o+=` vec4 edge${s} = texture(edgeTexture${s}, v_textureCoordinates);
  13375. if (edge${s}.a > 0.0)
  13376. {
  13377. color = edge${s};
  13378. break;
  13379. }
  13380. `,n[`edgeTexture${s}`]=e[s].name;let r=`${i}in vec2 v_textureCoordinates;
  13381. void main() {
  13382. vec4 color = vec4(0.0);
  13383. for (int i = 0; i < ${e.length}; i++)
  13384. {
  13385. ${o} }
  13386. out_FragColor = color;
  13387. }
  13388. `,a=new Ro({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new wf({name:"czm_edge_detection_composite",stages:[t,a]})}$r.createSilhouetteStage=function(e){let t=qvt(e),n=new Ro({name:"czm_silhouette_color_edges",fragmentShader:VG,uniforms:{silhouetteTexture:t.name}});return new wf({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};$r.isSilhouetteSupported=function(e){return e.context.depthTexture};$r.createBloomStage=function(){let e=new Ro({name:"czm_bloom_contrast_bias",fragmentShader:PG,uniforms:{contrast:128,brightness:-.3}}),t=cte("czm_bloom_blur"),n=new wf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Ro({name:"czm_bloom_generate_composite",fragmentShader:IG,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 wf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};$r.createAmbientOcclusionStage=function(){let e=new Ro({name:"czm_ambient_occlusion_generate",fragmentShader:vG,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Ro({name:"czm_ambient_occlusion_composite",fragmentShader:SG,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new wf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};$r.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var Yvt=`#define FXAA_QUALITY_PRESET 39
  13389. ${jG}
  13390. ${NG}`;$r.createFXAAStage=function(){return new Ro({name:"czm_FXAA",fragmentShader:Yvt,sampleMode:Fd.LINEAR})};$r.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  13391. `:"";return t+=EG,new Ro({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};$r.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  13392. `:"";return t+=BG,new Ro({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};$r.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  13393. `:"";return t+=LG,new Ro({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};$r.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  13394. `:"";return t+=UG,new Ro({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};$r.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  13395. `:"";return t+=kG,new Ro({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:U.WHITE,autoExposure:void 0,exposure:1}})};$r.createAutoExposureStage=function(){return new GG};$r.createBlackAndWhiteStage=function(){return new Ro({name:"czm_black_and_white",fragmentShader:wG,uniforms:{gradations:5}})};$r.createBrightnessStage=function(){return new Ro({name:"czm_brightness",fragmentShader:DG,uniforms:{brightness:.5}})};$r.createNightVisionStage=function(){return new Ro({name:"czm_night_vision",fragmentShader:zG})};$r.createDepthViewStage=function(){return new Ro({name:"czm_depth_view",fragmentShader:OG})};$r.createLensFlareStage=function(){return new Ro({name:"czm_lens_flare",fragmentShader:FG,uniforms:{dirtTexture:Xt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Xt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:te.WGS84.maximumRadius}})};var kd=$r;function Sg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function SR(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function lte(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let s=e.getStageByName(o);r[SR(s)]=!0}let a=i.uniforms;if(l(a)){let s=Object.getOwnPropertyNames(a),c=s.length;for(let u=0;u<c;++u){let f=a[s[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(r[SR(d)]=!0)}}}return i.name}function vR(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,a=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,s=o,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?s=vR(e,t,n,p,o):s=lte(e,t,n,p,o),a&&(o=s)}let u,f;if(a)for(u=1;u<c;++u)f=SR(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=SR(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[SR(i.get(p))]=!0}return s}function Xvt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,a=e.fxaa,s=vR(e,t,n,i,void 0);s=vR(e,t,n,o,s),s=lte(e,t,n,r,s),s=vR(e,t,n,e,s),lte(e,t,n,a,s)}else vR(e,t,n,e,void 0);return n}function Kvt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,a=o._forcePowerOfTwo,s=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],r!==d.textureScale||a!==d.forcePowerOfTwo||s!==d.pixelFormat||c!==d.pixelDatatype||!U.equals(u,d.clearColor))continue;let m=d.stages,A=m.length,y=!1;for(let x=0;x<A;++x)if(n[m[x]]){y=!0;break}if(!y)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:r,forcePowerOfTwo:a,pixelFormat:s,pixelDatatype:c,clearColor:u,stages:[t],buffer:new bi({pixelFormat:s,pixelDatatype:c}),clear:void 0},p.push(d),d)}function Qvt(e,t){let n=Xvt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Kvt(e,i,n[i]))}function ute(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function $vt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let a=0;a<r;++a){let s=o[a],c=s.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);s.forcePowerOfTwo&&(D.isPowerOfTwo(d)||(d=D.nextPowerOfTwo(d)),u=d,f=d),s.buffer.update(t,u,f),s.clear=new si({color:s.clearColor,framebuffer:s.buffer.framebuffer})}}Sg.prototype.updateDependencies=function(){this._updateDependencies=!0};Sg.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),a=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),s=!l(t._activeStages)||t._activeStages.length>0||i||o||r||a;if((n||!s&&this._framebuffers.length>0)&&(ute(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!s)return;this._framebuffers.length===0&&Qvt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,ute(this),$vt(this,e))};Sg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};Sg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};Sg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};Sg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};Sg.prototype.isDestroyed=function(){return!1};Sg.prototype.destroy=function(){return ute(this),fe(this)};var kS=Sg;var _we={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(_we);var sy=_we;var fte=[];function Gl(){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=sy.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new kS(this),r={},a=fte;for(a.push(e,t,n,i);a.length>0;){let c=a.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)a.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let s=this;t.uniforms.randomTexture=function(){return s._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(Gl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let c=t[s];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,a=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||a.ready&&a.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return dte(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 a=n-1;a>=0;--a){let s=t[a];if(l(s)&&s.ready&&s.enabled)return this.getOutputTexture(s.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 sy.REINHARD:n=kd.createReinhardTonemappingStage(t);break;case sy.MODIFIED_REINHARD:n=kd.createModifiedReinhardTonemappingStage(t);break;case sy.FILMIC:n=kd.createFilmicTonemappingStage(t);break;case sy.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 dte(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}Gl.prototype.add=function(e){let t=this._stageNames,n=fte;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 a=0;a<r;++a)n.push(o.get(a))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Gl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=fte;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};Gl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Gl.prototype.get=function(e){return dte(this),this._stages[e]};Gl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Gl.prototype.getStageByName=function(e){return this._stageNames[e]};Gl.prototype.update=function(e,t,n){dte(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let a=0;for(let x=0;x<r.length;++x){let b=r[x];b.ready&&b.enabled&&b._isSupported(e)&&(o[a++]=b)}o.length=a;let s=a!==i.length;if(!s){for(let x=0;x<a;++x)if(o[x]!==i[x]){s=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),A=d.enabled&&d._isSupported(e),y=p.enabled&&p._isSupported(e);if((s||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||A!==this._tonemappingEnabled||y!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=A,this._fxaaEnabled=y,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let b=new Uint8Array(196608);for(let T=0;T<196608;T+=3)b[T]=Math.floor(Math.random()*255);this._randomTexture=new Dt({context:e,pixelFormat:Xe.RGB,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:b,width:256,height:256},sampler:new jt({wrapS:un.REPEAT,wrapT:un.REPEAT,minificationFilter:Vt.NEAREST,magnificationFilter:ti.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let x=0;x<r.length;++x)r[x].update(e,t);a=0;for(let x=0;x<r.length;++x){let b=r[x];b.ready&&b.enabled&&b._isSupported(e)&&a++}s=a!==o.length,s&&this.update(e,t,n)};Gl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function qb(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Gl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return qb(t)};function Wp(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){Wp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)Wp(e.get(r),t,qb(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)Wp(e.get(r),t,n,i,o)}Gl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,a=this._fxaa,s=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=s.enabled&&s._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),A=a.enabled&&a._isSupported(e);if(!A&&!d&&!p&&!m&&r===0)return;let y=t;d&&s.ready&&(Wp(s,e,y,n,i),y=qb(s)),p&&c.ready&&(Wp(c,e,y,n,i),y=qb(c)),g&&u.ready&&Wp(u,e,y,n,i),m&&f.ready&&(Wp(f,e,y,n,i),y=qb(f));let x=y;if(r>0){Wp(o[0],e,y,n,i);for(let b=1;b<r;++b)Wp(o[b],e,qb(o[b-1]),n,i);x=qb(o[r-1])}A&&a.ready&&Wp(a,e,x,n,i)};Gl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Sf,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Gl.prototype.isDestroyed=function(){return!1};Gl.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(),fe(this)};var HG=Gl;var Awe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(Awe);var br=Awe;var ywe={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};Object.freeze(ywe);var Sn=ywe;function cy(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 Ate(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function Yb(e){let t=[];if(e.shiftKey&&t.push(br.SHIFT),e.ctrlKey&&t.push(br.CTRL),e.altKey&&t.push(br.ALT),t.length)return t}var ha={LEFT:0,MIDDLE:1,RIGHT:2};function If(e,t,n,i){function o(r){i(e,r)}n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Jvt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;cn.supportsPointerEvents()?(If(e,"pointerdown",t,oSt),If(e,"pointerup",t,Dwe),If(e,"pointermove",t,rSt),If(e,"pointercancel",t,Dwe)):(If(e,"mousedown",t,Pwe),If(e,"mouseup",n,Rwe),If(e,"mousemove",n,Owe),If(e,"touchstart",t,nSt),If(e,"touchend",n,Ewe),If(e,"touchmove",n,iSt),If(e,"touchcancel",n,Ewe)),If(e,"dblclick",t,eSt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",If(e,i,t,tSt)}function Zvt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var xwe={position:new z};function yte(e){e._lastSeenTouchEvent=zi()}function xte(e){return zi()-e._lastSeenTouchEvent>om.mouseEmulationIgnoreMilliseconds}function _te(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function Pwe(e,t){if(!xte(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ha.LEFT)i=Sn.LEFT_DOWN;else if(n===ha.MIDDLE)i=Sn.MIDDLE_DOWN;else if(n===ha.RIGHT)i=Sn.RIGHT_DOWN;else return;let o=cy(e,t,e._primaryPosition);z.clone(o,e._primaryStartPosition),z.clone(o,e._primaryPreviousPosition);let r=Yb(t),a=e.getInputAction(i,r);l(a)&&(z.clone(o,xwe.position),a(xwe),t.preventDefault())}var bwe={position:new z},Twe={position:new z};function hte(e,t,n,i){let o=Yb(i),r=e.getInputAction(t,o),a=e.getInputAction(n,o);if(l(r)||l(a)){let s=cy(e,i,e._primaryPosition);if(l(r)&&(z.clone(s,bwe.position),r(bwe)),l(a)){let c=e._primaryStartPosition;_te(c,s,e._clickPixelTolerance)&&(z.clone(s,Twe.position),a(Twe))}}}function Rwe(e,t){if(!xte(e))return;let n=t.button;n!==ha.LEFT&&n!==ha.MIDDLE&&n!==ha.RIGHT||(e._buttonDown[ha.LEFT]&&(hte(e,Sn.LEFT_UP,Sn.LEFT_CLICK,t),e._buttonDown[ha.LEFT]=!1),e._buttonDown[ha.MIDDLE]&&(hte(e,Sn.MIDDLE_UP,Sn.MIDDLE_CLICK,t),e._buttonDown[ha.MIDDLE]=!1),e._buttonDown[ha.RIGHT]&&(hte(e,Sn.RIGHT_UP,Sn.RIGHT_CLICK,t),e._buttonDown[ha.RIGHT]=!1))}var mte={startPosition:new z,endPosition:new z};function Owe(e,t){if(!xte(e))return;let n=Yb(t),i=cy(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Sn.MOUSE_MOVE,n);l(r)&&(z.clone(o,mte.startPosition),z.clone(i,mte.endPosition),r(mte)),z.clone(i,o),(e._buttonDown[ha.LEFT]||e._buttonDown[ha.MIDDLE]||e._buttonDown[ha.RIGHT])&&t.preventDefault()}var Cwe={position:new z};function eSt(e,t){let n=t.button,i;if(n===ha.LEFT)i=Sn.LEFT_DOUBLE_CLICK;else return;let o=Yb(t),r=e.getInputAction(i,o);l(r)&&(cy(e,t,Cwe.position),r(Cwe))}function tSt(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=Yb(t),o=e.getInputAction(Sn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function nSt(e,t){yte(e);let n=t.changedTouches,i,o=n.length,r,a,s=e._positions;for(i=0;i<o;++i)r=n[i],a=r.identifier,s.set(a,cy(e,r,new z));WG(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],a=r.identifier,c.set(a,z.clone(s.get(a)))}function Ewe(e,t){yte(e);let n=t.changedTouches,i,o=n.length,r,a,s=e._positions;for(i=0;i<o;++i)r=n[i],a=r.identifier,s.remove(a);WG(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],a=r.identifier,c.remove(a)}var vwe={position:new z},pte={position1:new z,position2:new z},Swe={position:new z},wwe={position:new z},Iwe={position:new z};function WG(e,t){let n=Yb(t),i=e._positions,o=i.length,r,a,s=e._isPinching;if(o!==1&&e._buttonDown[ha.LEFT]){if(e._buttonDown[ha.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Sn.LEFT_UP,n),l(r)&&(z.clone(e._primaryPosition,Swe.position),r(Swe)),o===0&&!e._isTouchHolding&&(a=e.getInputAction(Sn.LEFT_CLICK,n),l(a))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];_te(c,u,e._clickPixelTolerance)&&(z.clone(e._primaryPosition,wwe.position),a(wwe))}e._isTouchHolding=!1}if(o===0&&s&&(e._isPinching=!1,r=e.getInputAction(Sn.PINCH_END,n),l(r)&&r()),o===1&&!s){let c=i.values[0];z.clone(c,e._primaryPosition),z.clone(c,e._primaryStartPosition),z.clone(c,e._primaryPreviousPosition),e._buttonDown[ha.LEFT]=!0,r=e.getInputAction(Sn.LEFT_DOWN,n),l(r)&&(z.clone(c,vwe.position),r(vwe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,a=e.getInputAction(Sn.RIGHT_CLICK,n),l(a))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];_te(u,f,e._holdPixelTolerance)&&(z.clone(e._primaryPosition,Iwe.position),a(Iwe))}},om.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!s&&(e._isPinching=!0,r=e.getInputAction(Sn.PINCH_START,n),l(r)&&(z.clone(i.values[0],pte.position1),z.clone(i.values[1],pte.position2),r(pte),t.preventDefault()))}function iSt(e,t){yte(e);let n=t.changedTouches,i,o=n.length,r,a,s=e._positions;for(i=0;i<o;++i){r=n[i],a=r.identifier;let u=s.get(a);l(u)&&cy(e,r,u)}Mwe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],a=r.identifier,z.clone(s.get(a),c.get(a))}var gte={startPosition:new z,endPosition:new z},wR={distance:{startPosition:new z,endPosition:new z},angleAndHeight:{startPosition:new z,endPosition:new z}};function Mwe(e,t){let n=Yb(t),i=e._positions,o=e._previousPositions,r=i.length,a;if(r===1&&e._buttonDown[ha.LEFT]){let s=i.values[0];z.clone(s,e._primaryPosition);let c=e._primaryPreviousPosition;a=e.getInputAction(Sn.MOUSE_MOVE,n),l(a)&&(z.clone(c,gte.startPosition),z.clone(s,gte.endPosition),a(gte)),z.clone(s,c),t.preventDefault()}else if(r===2&&e._isPinching&&(a=e.getInputAction(Sn.PINCH_MOVE,n),l(a))){let s=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],d=c.x-s.x,p=c.y-s.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,A=f.y-u.y,y=Math.sqrt(m*m+A*A)*.25,x=(c.y+s.y)*.125,b=(f.y+u.y)*.125,T=Math.atan2(p,d),E=Math.atan2(A,m);z.fromElements(0,y,wR.distance.startPosition),z.fromElements(0,g,wR.distance.endPosition),z.fromElements(E,b,wR.angleAndHeight.startPosition),z.fromElements(T,x,wR.angleAndHeight.endPosition),a(wR)}}function oSt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,cy(e,t,new z)),WG(e,t),e._previousPositions.set(i,z.clone(n.get(i)))}else Pwe(e,t)}function Dwe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),WG(e,t),e._previousPositions.remove(i)}else Rwe(e,t)}function rSt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;cy(e,t,o),Mwe(e,t);let r=e._previousPositions;z.clone(n.get(i),r.get(i))}else Owe(e,t)}function om(e){this._inputEvents={},this._buttonDown={[ha.LEFT]:!1,[ha.MIDDLE]:!1,[ha.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-om.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new z,this._primaryPosition=new z,this._primaryPreviousPosition=new z,this._positions=new Nt,this._previousPositions=new Nt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,Jvt(this)}om.prototype.setInputAction=function(e,t,n){let i=Ate(t,n);this._inputEvents[i]=e};om.prototype.getInputAction=function(e,t){let n=Ate(e,t);return this._inputEvents[n]};om.prototype.removeInputAction=function(e,t){let n=Ate(e,t);delete this._inputEvents[n]};om.prototype.isDestroyed=function(){return!1};om.prototype.destroy=function(){return Zvt(this),fe(this)};om.mouseEmulationIgnoreMilliseconds=800;om.touchHoldDelayMilliseconds=1500;var zd=om;function Xb(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}Xb.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};Xb.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof fn,!(this._previousMode===ie.SCENE2D||this._previousMode===ie.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ie.SCENE2D,!0),n._mode=ie.MORPHING,n.camera._setTransform(R.IDENTITY),this._previousMode===ie.COLUMBUS_VIEW?kSt(this,e):WSt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var aSt=new h,sSt=new h,cSt=new h,lSt=new h,uSt=new h,fSt=new h,dSt=new h,hSt=new de,mSt=new R,pSt=new Gi,gSt=new fn,_St={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};Xb.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ie.COLUMBUS_VIEW||this._previousMode===ie.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ie.COLUMBUS_VIEW,!0),n.camera._setTransform(R.IDENTITY);let i=aSt,o=sSt,r=cSt;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 u=n.camera;if(this._previousMode===ie.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(u.positionWC,i),h.clone(u.directionWC,o),h.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,dSt),d=pt.eastNorthUpToFixedFrame(f,t,mSt);R.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,hSt),i),R.multiplyByPointAsVector(d,o,o),R.multiplyByPointAsVector(d,r,r)}}let a;this._morphToOrthographic?(a=gSt,a.width=n.camera.frustum.right-n.camera.frustum.left,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(a=pSt,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,a.fov=D.toRadians(60));let s=_St;s.position=i,s.direction=o,s.up=r,s.frustum=a;let c=YSt(s);IR(this,c),this._previousMode===ie.SCENE2D?qSt(this,e,s,c):(s.position2D=R.multiplyByPoint(vo.TRANSFORM_2D,i,lSt),s.direction2D=R.multiplyByPointAsVector(vo.TRANSFORM_2D,o,uSt),s.up2D=R.multiplyByPointAsVector(vo.TRANSFORM_2D,r,fSt),n._mode=ie.MORPHING,Hwe(this,e,s,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Cte={position:new h,direction:new h,up:new h,frustum:void 0},Lwe=new Gi;Xb.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ie.SCENE3D||this._previousMode===ie.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ie.SCENE3D,!0),n._mode=ie.MORPHING,n.camera._setTransform(R.IDENTITY),this._previousMode===ie.SCENE2D)ISt(this,e,t);else{let i;e>0?(i=Cte,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=Nwe(this,t);let o,r=n.camera;r.frustum instanceof fn?o=r.frustum.clone():(o=Lwe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=D.toRadians(60)),i.frustum=o;let a=qwe(i);IR(this,a),Tte(this,e,i,a)}e===0&&l(this._completeMorph)&&this._completeMorph()}};Xb.prototype.isDestroyed=function(){return!1};Xb.prototype.destroy=function(){return qG(this),fe(this)};function IR(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new zd(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 qG(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 ASt=new de,ySt=new h,xSt=new R;function Nwe(e,t){let n=e._scene,i=n.camera,o=Cte,r=o.position,a=o.direction,s=o.up,c=n.mapProjection.unproject(i.position,ASt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,ySt),f=pt.eastNorthUpToFixedFrame(u,t,xSt);return R.multiplyByPointAsVector(f,i.direction,a),R.multiplyByPointAsVector(f,i.up,s),o}var bSt=new h,TSt=new h,CSt=new h,ESt=new h,vSt=new h,SSt=new h;function Tte(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,a=h.clone(r.position,bSt),s=h.clone(r.direction,TSt),c=h.clone(r.up,CSt),u=R.multiplyByPoint(vo.TRANSFORM_2D_INVERSE,n.position,ESt),f=R.multiplyByPointAsVector(vo.TRANSFORM_2D_INVERSE,n.direction,vSt),d=R.multiplyByPointAsVector(vo.TRANSFORM_2D_INVERSE,n.up,SSt);function p(m){Ud(a,u,m.time,r.position),Ud(s,f,m.time,r.direction),Ud(c,d,m.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:Oa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Wwe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var wSt=new fn,Fwe=new h,kwe=new h,zwe=new h,Ete=new h,Uwe=new h,Vwe=new h;function ISt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=Cte,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=Nwe(e,n));let a;e._morphToOrthographic?(a=wSt,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.width=o.frustum.right-o.frustum.left):(a=Lwe,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.fov=D.toRadians(60)),r.frustum=a;let s=qwe(r);IR(e,s);let c;e._morphToOrthographic?c=function(){Tte(e,t,r,s)}:c=function(){Gwe(e,t,r,function(){Tte(e,t,r,s)})},t>0?(i._mode=ie.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,Ete),complete:function(){i._mode=ie.MORPHING,c()}})):c()}function Ud(e,t,n,i){return h.lerp(e,t,n,i)}function jwe(e,t,n,i,o){let r=e._scene,a=r.camera;if(a.frustum instanceof fn)return;let s=a.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(s*.5);a.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){a.frustum.fov=D.lerp(s,c,p.time);let g=u/Math.tan(a.frustum.fov*.5);i(a,g)}let d=r.tweens.add({duration:t,easingFunction:Oa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){a.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(d)}var DSt=new h,PSt=new h,RSt=new h,bte=new h,OSt=new h,MSt=new h,BSt=new ga,LSt=new An,NSt=new h,FSt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function kSt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,DSt),r=h.clone(i.direction,PSt),a=h.clone(i.up,RSt),s=h.negate(h.UNIT_Z,OSt),c=h.clone(h.UNIT_Y,MSt),u=bte;if(t>0)h.clone(h.ZERO,bte),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,bte);let y=LSt;R.multiplyByPoint(vo.TRANSFORM_2D,o,y.origin),R.multiplyByPointAsVector(vo.TRANSFORM_2D,r,y.direction);let x=n.globe;if(l(x)){let b=x.pickWorldCoordinates(y,n,!0,NSt);l(b)&&(R.multiplyByPoint(vo.TRANSFORM_2D_INVERSE,b,u),u.z+=h.distance(o,u))}}let f=BSt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=FSt;d.position=u,d.direction=s,d.up=c,d.frustum=f;let p=Ywe(d);IR(e,p);function g(y){Ud(o,u,y.time,i.position),Ud(r,s,y.time,i.direction),Ud(a,c,y.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(y,x){y.position.z=x}let A=n.tweens.add({duration:t,easingFunction:Oa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){jwe(e,t,d,m,p)}});e._currentTweens.push(A)}var Bwe=new de,zSt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new ga},USt={position:new h,direction:new h,up:new h,frustum:void 0},VSt=new h,jSt=new An,GSt=new R,HSt=new h;function WSt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=zSt;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,Bwe),i.mapProjection.project(Bwe,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let d=jSt;h.clone(r.position2D,d.origin);let p=h.clone(o.directionWC,d.direction),g=n.scaleToGeodeticSurface(o.positionWC,HSt),m=pt.eastNorthUpToFixedFrame(g,n,GSt);R.inverseTransformation(m,m),R.multiplyByPointAsVector(m,p,p),R.multiplyByPointAsVector(vo.TRANSFORM_2D,p,p);let A=i.globe;if(l(A)){let y=A.pickWorldCoordinates(d,i,!0,VSt);if(l(y)){let x=h.distance(r.position2D,y);y.x+=x,h.clone(y,r.position2D)}}}function a(d,p){d.position.x=p}R.multiplyByPoint(vo.TRANSFORM_2D,r.position,r.position2D),R.multiplyByPointAsVector(vo.TRANSFORM_2D,r.direction,r.direction2D),R.multiplyByPointAsVector(vo.TRANSFORM_2D,r.up,r.up2D);let s=r.frustum;s.right=r.position.z*.5,s.left=-s.right,s.top=s.right*(i.drawingBufferHeight/i.drawingBufferWidth),s.bottom=-s.top;let c=USt;R.multiplyByPoint(vo.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=s;let u=Ywe(c);IR(e,u);function f(){jwe(e,t,r,a,u)}Hwe(e,t,r,f)}function Gwe(e,t,n,i){let o=e._scene,r=o.camera,a=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let s=r.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=a*Math.tan(s*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=D.lerp(c,s,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let d=o.tweens.add({duration:t,easingFunction:Oa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function qSt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,a=h.clone(n.position,Ete),s=h.clone(n.direction,Uwe),c=h.clone(n.up,Vwe);o._mode=ie.MORPHING;function u(){r.frustum=n.frustum.clone();let f=h.clone(r.position,Fwe),d=h.clone(r.direction,kwe),p=h.clone(r.up,zwe);f.z=a.z;function g(A){Ud(f,a,A.time,r.position),Ud(d,s,A.time,r.direction),Ud(p,c,A.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:Oa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():Gwe(e,0,n,u)}function Hwe(e,t,n,i){let o=e._scene,r=o.camera,a=h.clone(r.position,Fwe),s=h.clone(r.direction,kwe),c=h.clone(r.up,zwe),u=h.clone(n.position2D,Ete),f=h.clone(n.direction2D,Uwe),d=h.clone(n.up2D,Vwe);function p(m){Ud(a,u,m.time,r.position),Ud(s,f,m.time,r.direction),Ud(c,d,m.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:Oa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Wwe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function Wwe(e,t,n,i,o,r){let a={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Oa.QUARTIC_OUT};l(r)&&(a.complete=function(){r(e)});let s=t.tweens.addProperty(a);e._currentTweens.push(s)}function qwe(e){return function(t){let n=t._scene;n._mode=ie.SCENE3D,n.morphTime=ie.getMorphTime(ie.SCENE3D),qG(t);let i=n.camera;(t._previousMode!==ie.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,ie.SCENE3D,r)}}function Ywe(e){return function(t){let n=t._scene;n._mode=ie.SCENE2D,n.morphTime=ie.getMorphTime(ie.SCENE2D),qG(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,ie.SCENE2D,o)}}function YSt(e){return function(t){let n=t._scene;n._mode=ie.COLUMBUS_VIEW,n.morphTime=ie.getMorphTime(ie.COLUMBUS_VIEW),qG(t);let i=n.camera;(t._previousModeMode!==ie.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,ie.COLUMBUS_VIEW,r)}}var YG=Xb;var Xwe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(Xwe);var eo=Xwe;var Zwe=[br.SHIFT,br.CTRL,br.ALT,[br.SHIFT,br.CTRL],[br.SHIFT,br.ALT],[br.CTRL,br.ALT],[br.SHIFT,br.CTRL,br.ALT]];function Fs(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function XSt(e,t){z.clone(e.distance.startPosition,t.distance.startPosition),z.clone(e.distance.endPosition,t.distance.endPosition),z.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),z.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function Kwe(e,t,n){let i=Fs(eo.PINCH,t),o=e._update,r=e._isDown,a=e._eventStartPosition,s=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,a[i]=new z;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new z,endPosition:new z},u.angleAndHeight={startPosition:new z,endPosition:new z},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,s[i]=new Date,z.lerp(f.position1,f.position2,.5,a[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(f){if(r[i]){o[i]?(XSt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(z.clone(f.distance.endPosition,u.distance.endPosition),z.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Sn.PINCH_MOVE,t)}function Qwe(e,t){let n=Fs(eo.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let a=e._movement[n];l(a)||(a=e._movement[n]={});let s=e._lastMovement[n];l(s)||(s=e._lastMovement[n]={startPosition:new z,endPosition:new z,valid:!1}),a.startPosition=new z,z.clone(z.ZERO,a.startPosition),a.endPosition=new z,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=o[n]=new Date,a.endPosition.x=0,a.endPosition.y=u,z.clone(a.endPosition,s.endPosition),s.valid=!0,r[n]=!1},Sn.WHEEL,t)}function zS(e,t,n){let i=Fs(n,t),o=e._isDown,r=e._eventStartPosition,a=e._pressTime;o[i]=!1,r[i]=new z;let s=e._lastMovement[i];l(s)||(s=e._lastMovement[i]={startPosition:new z,endPosition:new z,valid:!1});let c,u;n===eo.LEFT_DRAG?(c=Sn.LEFT_DOWN,u=Sn.LEFT_UP):n===eo.RIGHT_DRAG?(c=Sn.RIGHT_DOWN,u=Sn.RIGHT_UP):n===eo.MIDDLE_DRAG&&(c=Sn.MIDDLE_DOWN,u=Sn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,s.valid=!1,o[i]=!0,a[i]=new Date,z.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){vte(Fs(n,void 0),e);for(let f of Zwe){let d=Fs(n,f);vte(d,e)}},u,t)}function vte(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 $we(e,t){z.clone(e.startPosition,t.startPosition),z.clone(e.endPosition,t.endPosition)}function KSt(e,t,n){let i=n._isDown,o=!1,r=Fs(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,vte(c,n));if(!o)return;let a=n._pressTime,s=n._lastMovement[r];l(s)||(s=n._lastMovement[r]={startPosition:new z,endPosition:new z,valid:!1}),n._buttonsDown++,s.valid=!1,i[r]=!0,a[r]=new Date}function Jwe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let a in eo)if(eo.hasOwnProperty(a)){let s=eo[a];if(l(s)){let c=Fs(s,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new z,endPosition:new z,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new z,endPosition:new z})}}e._eventHandler.setInputAction(function(a){for(let s in eo)if(eo.hasOwnProperty(s)){let c=eo[s];if(l(c)){let u=Fs(c,t);KSt(c,t,e),r[u]&&(n[u]?($we(i[u],o[u]),o[u].valid=!0,$we(a,i[u]),n[u]=!1):z.clone(a.endPosition,i[u].endPosition))}}z.clone(a.endPosition,e._currentMousePosition)},Sn.MOUSE_MOVE,t)}function Vd(e){this._eventHandler=new zd(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new z,Qwe(this,void 0),Kwe(this,void 0,e),zS(this,void 0,eo.LEFT_DRAG),zS(this,void 0,eo.RIGHT_DRAG),zS(this,void 0,eo.MIDDLE_DRAG),Jwe(this,void 0);for(let t of Zwe)Qwe(this,t),Kwe(this,t,e),zS(this,t,eo.LEFT_DRAG),zS(this,t,eo.RIGHT_DRAG),zS(this,t,eo.MIDDLE_DRAG),Jwe(this,t)}Object.defineProperties(Vd.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Fs(eo.WHEEL)]||!this._update[Fs(eo.WHEEL,br.SHIFT)]||!this._update[Fs(eo.WHEEL,br.CTRL)]||!this._update[Fs(eo.WHEEL,br.ALT)];return this._buttonsDown>0||e}}});Vd.prototype.isMoving=function(e,t){let n=Fs(e,t);return!this._update[n]};Vd.prototype.getMovement=function(e,t){let n=Fs(e,t);return this._movement[n]};Vd.prototype.getLastMovement=function(e,t){let n=Fs(e,t),i=this._lastMovement[n];if(i.valid)return i};Vd.prototype.isButtonDown=function(e,t){let n=Fs(e,t);return this._isDown[n]};Vd.prototype.getStartMousePosition=function(e,t){if(e===eo.WHEEL)return this._currentMousePosition;let n=Fs(e,t);return this._eventStartPosition[n]};Vd.prototype.getButtonPressTime=function(e,t){let n=Fs(e,t);return this._pressTime[n]};Vd.prototype.getButtonReleaseTime=function(e,t){let n=Fs(e,t);return this._releaseTime[n]};Vd.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Vd.prototype.isDestroyed=function(){return!1};Vd.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),fe(this)};var XG=Vd;function KG(e,t,n,i,o,r,a,s,c,u){this._tweens=e,this._tweenjs=t,this._startObject=qe(n),this._stopObject=qe(i),this._duration=o,this._delay=r,this._easingFunction=a,this._update=s,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(KG.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}}});KG.prototype.cancelTween=function(){this._tweens.remove(this)};function rm(){this._tweens=[]}Object.defineProperties(rm.prototype,{length:{get:function(){return this._tweens.length}}});rm.prototype.add=function(e){if(e=e??G.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new KG(this);let t=e.duration/oi.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/oi.SECONDS_PER_MILLISECOND,o=e.easingFunction??Oa.LINEAR_NONE,r=e.startObject,a=new ZCe(r);a.to(qe(e.stopObject),t),a.delay(i),a.easing(o),l(e.update)&&a.onUpdate(function(){e.update(r)}),a.onComplete(e.complete??null),a.repeat(e._repeat??0);let s=new KG(this,a,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(s),s};rm.prototype.addProperty=function(e){e=e??G.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(a){t[n]=a.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};rm.prototype.addAlpha=function(e){e=e??G.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 a=0;a<r;++a)t.uniforms[n[a]].alpha=o.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};rm.prototype.addOffsetIncrement=function(e){e=e??G.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})};rm.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};rm.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};rm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};rm.prototype.get=function(e){return this._tweens[e]};rm.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/oi.SECONDS_PER_MILLISECOND:zi();n<t.length;){let i=t[n],o=i.tweenjs;if(i.needsStart)i.needsStart=!1,o.start(e);else if(o.update(e))n++;else{if(t[n]?.needsStart)continue;o.stop(),t.splice(n,1)}}};var US=rm;function PR(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=eo.LEFT_DRAG,this.zoomEventTypes=[eo.RIGHT_DRAG,eo.WHEEL,eo.PINCH],this.rotateEventTypes=eo.LEFT_DRAG,this.tiltEventTypes=[eo.MIDDLE_DRAG,eo.PINCH,{eventType:eo.LEFT_DRAG,modifier:br.CTRL},{eventType:eo.RIGHT_DRAG,modifier:br.CTRL}],this.lookEventTypes={eventType:eo.LEFT_DRAG,modifier:br.SHIFT};let t=e.ellipsoid??te.default;this.minimumPickingTerrainHeight=te.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=te.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=te.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=te.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 XG(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 US,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new z(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new z(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new z,this._strafeEndMousePosition=new z,this._zoomMouseStart=new z(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new z,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 de(Math.PI,D.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 QSt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function $St(e){return z.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var JSt=.4;function ZSt(e,t,n,i,o,r,a){let s=r[a];l(s)||(s=r[a]={startPosition:new z,endPosition:new z,motion:new z,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<JSt){let g=QSt(p,i),m=e.getLastMovement(t,n);if(!l(m)||$St(m)||!s.inertiaEnabled||(s.motion.x=(m.endPosition.x-m.startPosition.x)*.5,s.motion.y=(m.endPosition.y-m.startPosition.y)*.5,s.startPosition=z.clone(m.startPosition,s.startPosition),s.endPosition=z.multiplyByScalar(s.motion,g,s.endPosition),s.endPosition=z.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||z.distance(s.startPosition,s.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let A=e.getStartMousePosition(t,n);o(r,A,s)}}}function ewt(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 eIe=[];function Hl(e,t,n,i,o,r){if(!l(n))return;let a=e._aggregator;Array.isArray(n)||(eIe[0]=n,n=eIe);let s=n.length;for(let c=0;c<s;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=a.isMoving(f,d)&&a.getMovement(f,d),g=a.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),ewt(e,r)):o<1&&ZSt(a,f,d,o,i,e,r))}}var QG=new An,twt=new h,nwt=new z,iwt=new h,owt=new z,rwt=new h,awt=new h,swt=new h,cwt=new h,dIe=new h,lwt=new h,uwt=new h,fwt=new h,dwt=new h,hwt=new h,mwt=new h,pwt=new h,gwt=new h,_wt=new h,Awt=new h,Kb=new h,tIe=new h,nIe=new h,Ste={orientation:new kc};function Bte(e,t,n,i,o,r){let a=1;l(r)&&(a=D.clamp(Math.abs(r),.25,1));let s=n.endPosition.y-n.startPosition.y,u=s>0?e.minimumZoomDistance*a:0,f=e.maximumZoomDistance,d=o-u,p=i*d;p=D.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=s/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let A=e._scene,y=A.camera,x=A.mode,b=Ste.orientation;b.heading=y.heading,b.pitch=y.pitch,b.roll=y.roll;let T=n.inertiaEnabled??z.equals(t,e._zoomMouseStart),E=e._zoomingOnVector,S=e._rotatingZoom,w;if(T||(e._zoomMouseStart=z.clone(t,e._zoomMouseStart),l(e._globe)&&x===ie.SCENE2D?(w=y.getPickRay(t,QG).origin,w=h.fromElements(w.y,w.z,w.x)):l(e._globe)&&(w=wg(e,t,twt)),l(w)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(w,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,E=e._zoomingOnVector=!1,S=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){y.zoomIn(m);return}let P=x===ie.COLUMBUS_VIEW;if(y.positionCartographic.height<2e6&&(S=!0),!T||S){if(x===ie.SCENE2D){let O=e._zoomWorldPosition,B=y.position;if(!h.equals(O,B)&&y.positionCartographic.height<e._maxCoord.x*2){let L=y.position.x,_=h.subtract(O,B,iwt);h.normalize(_,_);let C=h.distance(O,B)*m/(y.getMagnitude()*.5);y.move(_,C*.5),(y.position.x<0&&L>0||y.position.x>0&&L<0)&&(w=y.getPickRay(t,QG).origin,w=h.fromElements(w.y,w.z,w.x),e._zoomWorldPosition=h.clone(w,e._zoomWorldPosition))}}else if(x===ie.SCENE3D){let O=h.normalize(y.position,dIe);if(e._cameraUnderground||e._zoomingUnderground||y.positionCartographic.height<3e3&&Math.abs(h.dot(y.direction,O))<.6)P=!0;else{let B=A.canvas,L=owt;L.x=B.clientWidth/2,L.y=B.clientHeight/2;let _=wg(e,L,rwt);if(!l(_))P=!0;else if(y.positionCartographic.height<1e6)if(h.dot(y.direction,O)>=-.5)P=!0;else{let C=uwt;h.clone(y.position,C);let v=e._zoomWorldPosition,I=lwt;if(I=h.normalize(v,I),h.dot(I,O)<0)return;let M=Awt,N=hwt;h.clone(y.direction,N),h.add(C,h.multiplyByScalar(N,1e3,Kb),M);let j=mwt,k=pwt;h.subtract(v,C,j),h.normalize(j,k);let V=h.dot(O,k);if(V>=0){e._zoomMouseStart.x=-1;return}let F=Math.acos(-V),W=h.magnitude(C),q=h.magnitude(v),J=W-m,H=h.magnitude(j),Z=Math.asin(D.clamp(H/q*Math.sin(F),-1,1)),K=Math.asin(D.clamp(J/q*Math.sin(F),-1,1)),le=Z-K+F,me=fwt;h.normalize(C,me);let ae=dwt;ae=h.cross(k,me,ae),ae=h.normalize(ae,ae),h.normalize(h.cross(me,ae,Kb),N),h.multiplyByScalar(h.normalize(M,Kb),h.magnitude(M)-m,M),h.normalize(C,C),h.multiplyByScalar(C,J,C);let be=gwt;h.multiplyByScalar(h.add(h.multiplyByScalar(me,Math.cos(le)-1,tIe),h.multiplyByScalar(N,Math.sin(le),nIe),Kb),J,be),h.add(C,be,C),h.normalize(M,me),h.normalize(h.cross(me,ae,Kb),N);let ge=_wt;h.multiplyByScalar(h.add(h.multiplyByScalar(me,Math.cos(le)-1,tIe),h.multiplyByScalar(N,Math.sin(le),nIe),Kb),h.magnitude(M),ge),h.add(M,ge,M),h.clone(C,y.position),h.normalize(h.subtract(M,C,Kb),y.direction),h.clone(y.direction,y.direction),h.cross(y.direction,y.up,y.right),h.cross(y.right,y.direction,y.up),y.setView(Ste);return}else{let C=h.normalize(_,awt),v=h.normalize(e._zoomWorldPosition,swt),I=h.dot(v,C);if(I>0&&I<1){let M=D.acosClamped(I),N=h.cross(v,C,cwt),j=Math.abs(M)>D.toRadians(20)?y.positionCartographic.height*.75:y.positionCartographic.height-m,k=m/j;y.rotate(N,M*k)}}}}e._rotatingZoom=!P}if(!T&&P||E){let O,B=io.worldToWindowCoordinates(A,e._zoomWorldPosition,nwt);x!==ie.COLUMBUS_VIEW&&z.equals(t,e._zoomMouseStart)&&l(B)?O=y.getPickRay(B,QG):O=y.getPickRay(t,QG);let L=O.direction;(x===ie.COLUMBUS_VIEW||x===ie.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),y.move(L,m),e._zoomingOnVector=!0}else y.zoomIn(m);e._cameraUnderground||y.setView(Ste)}var ywt=new An,xwt=new An,bwt=new h;function Twt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,ywt).origin,a=o.getPickRay(n.endPosition,xwt).origin;r=h.fromElements(r.y,r.z,r.x,r),a=h.fromElements(a.y,a.z,a.x,a);let s=h.subtract(r,a,bwt),c=h.magnitude(s);c>0&&(h.normalize(s,s),o.move(s,c))}function iIe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;Bte(e,t,n,e.zoomFactor,o.getMagnitude())}var Cwt=new z,Ewt=new z;function oIe(e,t,n){if(l(n.angleAndHeight)){vwt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,a=r.clientWidth,s=r.clientHeight,c=Cwt;c.x=2/a*n.startPosition.x-1,c.y=2/s*(s-n.startPosition.y)-1,c=z.normalize(c,c);let u=Ewt;u.x=2/a*n.endPosition.x-1,u.y=2/s*(s-n.endPosition.y)-1,u=z.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let d=D.acosClamped(u.x);u.y<0&&(d=D.TWO_PI-d);let p=d-f;o.twistRight(p)}function vwt(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,a=o.canvas,s=(n.endPosition.x-n.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);let c=i*s*Math.PI*4;r.twistRight(c)}function Swt(e){let t=e._scene.mapMode2D===Mu.ROTATE;R.equals(R.IDENTITY,e._scene.camera.transform)?(Hl(e,e.enableTranslate,e.translateEventTypes,Twt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Hl(e,e.enableZoom,e.zoomEventTypes,iIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Hl(e,e.enableRotate,e.tiltEventTypes,oIe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Hl(e,e.enableZoom,e.zoomEventTypes,iIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Hl(e,e.enableRotate,e.translateEventTypes,oIe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var hIe=new An,wwt=new h,Iwt=new h;function wg(e,t,n){let i=e._scene,o=e._globe,r=i.camera,a;if(i.pickPositionSupported&&(a=i.pickPositionWorldCoordinates(t,wwt)),!l(o))return h.clone(a,n);let s=!e._cameraUnderground,c=r.getPickRay(t,hIe),u=o.pickWorldCoordinates(c,i,s,Iwt),f=l(a)?h.distance(a,r.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(a,n):h.clone(u,n)}var Dwt=new de;function i6(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ie.SCENE3D){let c=t.cartesianToCartographic(i.position,Dwt);l(c)&&(r=c.height)}else r=i.position.z;let a=e._scene.globeHeight??0;return Math.abs(a-r)}var Pwt=new h;function mIe(e,t){let n=t.origin,i=t.direction,o=i6(e),r=h.normalize(n,Pwt),a=Math.abs(h.dot(r,i));return a=Math.max(a,.5)*2,o*a}function pIe(e,t,n,i){let o=h.distance(t.origin,n),r=i6(e),a=D.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>a&&(o=Math.min(o,r/5),o=Math.max(o,100)),An.getPoint(t,o,i)}function gIe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=i6(e))):o=i6(e),An.getPoint(t,o,i)}var Rwt=new z;function _Ie(e,t){let n=t.endPosition,i=z.subtract(t.endPosition,t.startPosition,Rwt),o=e._strafeEndMousePosition;z.add(o,i,o),t.endPosition=o,Lte(e,t,e._strafeStartPosition),t.endPosition=n}var rIe=new An,Owt=new An,wte=new h,Mwt=new h,Bwt=new h,Lwt=new h,Nwt=new tn(h.UNIT_X,0),Fwt=new z,kwt=new z;function zwt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Pf(e,t,n);return}if(e._strafing){_Ie(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,a=z.clone(n.startPosition,Fwt),s=z.clone(n.endPosition,kwt),c=o.getPickRay(a,rIe),u=h.clone(h.ZERO,Lwt),f=h.UNIT_X,d;if(o.position.z<e._minimumPickingTerrainHeight&&(d=wg(e,a,wte),l(d)&&(u.x=d.x)),r||u.x>o.position.z&&l(d)){let T=d;r&&(T=gIe(e,c,d,wte)),z.clone(t,e._strafeMousePosition),z.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,Lte(e,n,e._strafeStartPosition);return}let p=tn.fromPointNormal(u,f,Nwt);c=o.getPickRay(a,rIe);let g=ui.rayPlane(c,p,wte),m=o.getPickRay(s,Owt),A=ui.rayPlane(m,p,Mwt);if(!l(g)||!l(A)){e._looking=!0,Pf(e,t,n),z.clone(t,e._translateMousePosition);return}let y=h.subtract(g,A,Bwt),x=y.x;y.x=y.y,y.y=y.z,y.z=x;let b=h.magnitude(y);b>D.EPSILON6&&(h.normalize(y,y),o.move(y,b))}var AIe=new z,ZG=new An,e6=new h,Uwt=new h,yIe=new R,Vwt=new R,jwt=new h,Gwt=new tn(h.UNIT_X,0),Ite=new h,Rte=new de,xIe=new R,Hwt=new Le,Wwt=new $,t6=new h;function qwt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Pf(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Ywt(e,t,n)):Xwt(e,t,n)}function Ywt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,a=AIe;a.x=r.clientWidth/2,a.y=r.clientHeight/2;let s=o.getPickRay(a,ZG),c=h.UNIT_X,u=s.origin,f=s.direction,d,p=h.dot(c,f);if(Math.abs(p)>D.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Pf(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,e6);h.add(u,g,g);let m=i.mapProjection,A=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let y=m.unproject(g,Rte);A.cartographicToCartesian(y,g);let x=pt.eastNorthUpToFixedFrame(g,A,yIe),b=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=R.clone(o.transform,xIe);o._setTransform(x),Df(e,t,n,h.UNIT_Z),o._setTransform(E),e._globe=b,e._ellipsoid=T;let S=T.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function Xwt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,a,s,c=h.UNIT_X;if(z.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,e6);else{if(o.position.z<e._minimumPickingTerrainHeight&&(a=wg(e,t,e6)),!l(a)){s=o.getPickRay(t,ZG);let _=s.origin,C=s.direction,v,I=h.dot(c,C);if(Math.abs(I)>D.EPSILON6&&(v=-h.dot(c,_)/I),!l(v)||v<=0){e._looking=!0,Pf(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}a=h.multiplyByScalar(C,v,e6),h.add(_,a,a)}r&&(l(s)||(s=o.getPickRay(t,ZG)),pIe(e,s,a,a)),z.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=i.canvas,f=AIe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,s=o.getPickRay(f,ZG);let d=h.clone(h.ZERO,jwt);d.x=a.x;let p=tn.fromPointNormal(d,c,Gwt),g=ui.rayPlane(s,p,Uwt),m=o._projection,A=m.ellipsoid;h.fromElements(a.y,a.z,a.x,a);let y=m.unproject(a,Rte);A.cartographicToCartesian(y,a);let x=pt.eastNorthUpToFixedFrame(a,A,yIe),b;l(g)?(h.fromElements(g.y,g.z,g.x,g),y=m.unproject(g,Rte),A.cartographicToCartesian(y,g),b=pt.eastNorthUpToFixedFrame(g,A,Vwt)):b=x;let T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=h.UNIT_Z,w=R.clone(o.transform,xIe);o._setTransform(x);let P=h.cross(h.UNIT_Z,h.normalize(o.position,Ite),Ite),O=h.dot(o.right,P);if(Df(e,t,n,S,!1,!0),o._setTransform(b),O<0){let _=n.startPosition.y-n.endPosition.y;(r&&_<0||!r&&_>0)&&(S=void 0);let C=o.constrainedAxis;o.constrainedAxis=void 0,Df(e,t,n,S,!0,!1),o.constrainedAxis=C}else Df(e,t,n,S,!0,!1);if(l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,t6);h.equalsEpsilon(_,h.ZERO,D.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,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(w),e._globe=T,e._ellipsoid=E;let B=E.maximumRadius;e._rotateFactor=1/B,e._rotateRateRangeAdjustment=B;let L=h.clone(o.positionWC,Ite);if(e.enableCollisionDetection&&kte(e,!0),!h.equals(o.positionWC,L)){o._setTransform(b),o.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let C=h.angleBetween(L,o.position),v=h.cross(L,o.position,L);h.normalize(v,v);let I=Le.fromAxisAngle(v,C,Hwt),M=$.fromQuaternion(I,Wwt);$.multiplyByVector(M,o.direction,o.direction),$.multiplyByVector(M,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(w)}}var bIe=new z,TIe=new An,CIe=new h;function Kwt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,a=e._cameraUnderground,s;a?s=t:(s=bIe,s.x=r.clientWidth/2,s.y=r.clientHeight/2);let c=o.getPickRay(s,TIe),u=c.origin,f=c.direction,d=o.position.z,p;d<e._minimumPickingTerrainHeight&&(p=wg(e,s,CIe));let g;if(l(p)&&(g=h.distance(u,p)),a){let m=mIe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}Bte(e,t,n,e.zoomFactor,g)}function Qwt(e){let n=e._scene.camera;if(!R.equals(R.IDENTITY,n.transform))Hl(e,e.enableRotate,e.rotateEventTypes,Df,e.inertiaSpin,"_lastInertiaSpinMovement"),Hl(e,e.enableZoom,e.zoomEventTypes,vIe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Hl(e,e.enableTilt,e.tiltEventTypes,qwt,e.inertiaSpin,"_lastInertiaTiltMovement"),Hl(e,e.enableTranslate,e.translateEventTypes,zwt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Hl(e,e.enableZoom,e.zoomEventTypes,Kwt,e.inertiaZoom,"_lastInertiaZoomMovement"),Hl(e,e.enableLook,e.lookEventTypes,Pf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var $wt=new An,Jwt=new tn(h.UNIT_X,0),Zwt=new h,eIt=new h;function Lte(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,$wt),a=h.clone(o.direction,eIt);i.mode===ie.COLUMBUS_VIEW&&h.fromElements(a.z,a.x,a.y,a);let s=tn.fromPointNormal(n,a,Jwt),c=ui.rayPlane(r,s,Zwt);l(c)&&(a=h.subtract(n,c,a),i.mode===ie.COLUMBUS_VIEW&&h.fromElements(a.y,a.z,a.x,a),h.add(o.position,a,o.position))}var aIe=new h,EIe=new de,Ote=new h,Mte=new te,tIt=new h,nIt=new h,iIt=new h;function oIt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,a=e._ellipsoid;if(!R.equals(o.transform,R.IDENTITY)){Df(e,t,n);return}let s,c,u=a.geodeticSurfaceNormal(o.position,tIt);if(z.equals(t,e._rotateMousePosition)){if(e._looking)Pf(e,t,n,u);else if(e._rotating)Df(e,t,n);else if(e._strafing)_Ie(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;s=h.magnitude(e._rotateStartPosition),c=Ote,c.x=c.y=c.z=s,a=te.fromCartesian3(c,Mte),Pte(e,t,n,a)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=a.cartesianToCartographic(o.positionWC,EIe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=wg(e,n.startPosition,iIt);if(l(p)){let g=!1,m=o.getPickRay(n.startPosition,hIe);if(r)g=!0,gIe(e,m,p,p);else{let A=a.geodeticSurfaceNormal(p,nIt);Math.abs(h.dot(m.direction,A))<.05?g=!0:g=h.magnitude(o.position)<h.magnitude(p)}g?(z.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,Lte(e,n,e._strafeStartPosition)):(s=h.magnitude(p),c=Ote,c.x=c.y=c.z=s,a=te.fromCartesian3(c,Mte),Pte(e,t,n,a),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Pf(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,aIe))?(Pte(e,t,n,e._ellipsoid),h.clone(aIe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Df(e,t,n)):(e._looking=!0,Pf(e,t,n,u));z.clone(t,e._rotateMousePosition)}function Df(e,t,n,i,o,r){o=o??!1,r=r??!1;let a=e._scene,s=a.camera,c=a.canvas,u=s.constrainedAxis;l(i)&&(s.constrainedAxis=i);let f=h.magnitude(s.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=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 m=d*p*Math.PI*2,A=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let y=e.maximumTiltAngle,x=h.dot(s.direction,i),b=Math.PI-Math.acos(x)+A;b>y&&(A-=b-y)}o||s.rotateRight(m),r||s.rotateUp(A),s.constrainedAxis=u}var Dte=se.clone(se.UNIT_W),sIe=se.clone(se.UNIT_W),$G=new h,VS=new h,JG=new h,cIe=new h,rIt=new z,aIt=new z,sIt=new z,cIt=new z,lIt=new An;function Pte(e,t,n,i){let o=e._scene,r=o.camera,a=z.clone(n.startPosition,rIt),s=z.clone(n.endPosition,aIt),c=i.cartesianToCartographic(r.positionWC,EIe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,Dte),!l(e._globe)&&!z.equalsEpsilon(a,e._panLastMousePosition)&&(u=wg(e,a,Dte)),!l(e._globe)&&l(u))){let d=h.subtract(u,r.positionWC,VS),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,d),VS),g=h.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,cIt),A=z.subtract(s,a,sIt),y=h.multiplyByScalar(r.rightWC,A.x*m.x,VS),x=h.normalize(r.positionWC,dIe),b=r.getPickRay(s,lIt).direction,T=h.subtract(b,h.projectVector(b,r.rightWC,JG),JG),E=h.angleBetween(T,r.directionWC),S=1;l(r.frustum.fov)&&(S=Math.max(Math.tan(E),.1));let w=Math.abs(h.dot(r.directionWC,x)),P=-A.y*m.y*2/Math.sqrt(S)*(1-w),O=h.multiplyByScalar(b,P,JG);w=Math.abs(h.dot(r.upWC,x));let B=h.multiplyByScalar(r.upWC,-A.y*(1-w)*m.y,cIe);f=h.add(u,y,sIe),f=h.add(f,O,f),f=h.add(f,B,f),h.clone(f,e._panLastWorldPosition),z.clone(s,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(a,i,Dte),f=r.pickEllipsoid(s,i,sIe)),!l(u)||!l(f)){e._rotating=!0,Df(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let d=r.constrainedAxis,p=h.mostOrthogonalAxis(d,$G);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,VS),m=h.magnitude(u),A=h.dot(d,u),y=Math.acos(A/m),x=h.multiplyByScalar(d,A,JG);h.subtract(u,x,x),h.normalize(x,x);let b=h.magnitude(f),T=h.dot(d,f),E=Math.acos(T/b),S=h.multiplyByScalar(d,T,cIe);h.subtract(f,S,S),h.normalize(S,S);let w=Math.acos(h.dot(x,p));h.dot(x,g)<0&&(w=D.TWO_PI-w);let P=Math.acos(h.dot(S,p));h.dot(S,g)<0&&(P=D.TWO_PI-P);let O=w-P,B;h.equalsEpsilon(d,r.position,D.EPSILON2)?B=r.right:B=h.cross(d,r.position,$G);let L=h.cross(d,B,$G),_=h.dot(L,h.subtract(u,d,VS)),C=h.dot(L,h.subtract(f,d,VS)),v;_>0&&C>0?v=E-y:_>0&&C<=0?h.dot(r.position,d)>0?v=-y-E:v=y+E:v=y-E,r.rotateRight(O),r.rotateUp(v)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,$G);if(d<1&&!h.equalsEpsilon(p,h.ZERO,D.EPSILON14)){let g=Math.acos(d);r.rotate(p,g)}}}var uIt=new h,fIt=new de,lIe=0;function vIe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,a=r.camera,s=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=bIe,u.x=s.clientWidth/2,u.y=s.clientHeight/2);let f=a.getPickRay(u,TIe),d,p=o.cartesianToCartographic(a.position,fIt).height,g=Math.abs(lIe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=wg(e,u,CIe));let A;if(l(d)&&(A=h.distance(f.origin,d)),!l(e._globe)&&l(A)&&a.getMagnitude()<A&&(d=void 0,A=void 0),l(A)&&(lIe=A),c){let x=mIe(e,f,p);l(A)?A=Math.min(A,x):A=x}l(A)||(A=p);let y=h.normalize(a.position,uIt);Bte(e,t,n,e.zoomFactor,A,h.dot(y,a.direction))}var SIe=new z,n6=new An,DR=new h,dIt=new h,wIe=new R,hIt=new R,IIe=new R,mIt=new Le,pIt=new $,Nte=new de,Fte=new h;function gIt(e,t,n){let o=e._scene.camera;if(!R.equals(o.transform,R.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let s=e._ellipsoid.geodeticSurfaceNormal(o.position,Fte);Pf(e,t,n,s);return}let a=e._ellipsoid.cartesianToCartographic(o.position,Nte);e._tiltOnEllipsoid||a.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,AIt(e,t,n)):yIt(e,t,n)}var _It=new de;function AIt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,a=e.minimumZoomDistance*.25,s=i.cartesianToCartographic(r.positionWC,_It).height;if(s-a-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=SIe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,n6),d,p=ui.rayEllipsoid(f,i);if(l(p))d=An.getPoint(f,p.start,DR);else if(s>e._minimumTrackBallHeight){let b=ui.grazingAltitudeLocation(f,i);if(!l(b))return;let T=i.cartesianToCartographic(b,Nte);T.height=0,d=i.cartographicToCartesian(T,DR)}else{e._looking=!0;let b=e._ellipsoid.geodeticSurfaceNormal(r.position,Fte);Pf(e,t,n,b),z.clone(t,e._tiltCenterMousePosition);return}let g=pt.eastNorthUpToFixedFrame(d,i,wIe),m=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let y=R.clone(r.transform,IIe);r._setTransform(g),Df(e,t,n,h.UNIT_Z),r._setTransform(y),e._globe=m,e._ellipsoid=A;let x=A.maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x}function yIt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,a=e._cameraUnderground,s,c,u;if(z.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,DR);else{if(s=wg(e,t,DR),!l(s)){if(c=r.getPickRay(t,n6),u=ui.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,Nte).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(r.position,Fte);Pf(e,t,n,C),z.clone(t,e._tiltCenterMousePosition)}return}s=An.getPoint(c,u.start,DR)}a&&(l(c)||(c=r.getPickRay(t,n6)),pIe(e,c,s,s)),z.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let f=o.canvas,d=SIe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=r.getPickRay(d,n6);let p=h.magnitude(s),g=h.fromElements(p,p,p,Ote),m=te.fromCartesian3(g,Mte);if(u=ui.rayEllipsoid(c,m),!l(u))return;let A=h.magnitude(c.origin)>p?u.start:u.stop,y=An.getPoint(c,A,dIt),x=pt.eastNorthUpToFixedFrame(s,i,wIe),b=pt.eastNorthUpToFixedFrame(y,m,hIt),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=h.UNIT_Z,w=R.clone(r.transform,IIe);r._setTransform(b);let P=h.cross(y,r.positionWC,t6);if(h.dot(r.rightWC,P)<0){let _=n.startPosition.y-n.endPosition.y;(a&&_<0||!a&&_>0)&&(S=void 0);let C=r.constrainedAxis;r.constrainedAxis=void 0,Df(e,t,n,S,!0,!1),r.constrainedAxis=C}else Df(e,t,n,S,!0,!1);if(r._setTransform(x),Df(e,t,n,S,!1,!0),l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,t6);h.equalsEpsilon(_,h.ZERO,D.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,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(w),e._globe=T,e._ellipsoid=E;let B=E.maximumRadius;e._rotateFactor=1/B,e._rotateRateRangeAdjustment=B;let L=h.clone(r.positionWC,t6);if(e.enableCollisionDetection&&kte(e,!0),!h.equals(r.positionWC,L)){r._setTransform(b),r.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let C=h.angleBetween(L,r.position),v=h.cross(L,r.position,L);h.normalize(v,v);let I=Le.fromAxisAngle(v,C,mIt),M=$.fromQuaternion(I,pIt);$.multiplyByVector(M,r.direction,r.direction),$.multiplyByVector(M,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(w)}}var xIt=new z,bIt=new z,uIe=new An,fIe=new An,TIt=new h,CIt=new h;function Pf(e,t,n,i){let r=e._scene.camera,a=xIt;a.x=n.startPosition.x,a.y=0;let s=bIt;s.x=n.endPosition.x,s.y=0;let c=r.getPickRay(a,uIe),u=r.getPickRay(s,fIe),f=0,d,p;r.frustum instanceof fn?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(m)?r.look(m,-f):r.lookLeft(f),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,c=r.getPickRay(a,uIe),u=r.getPickRay(s,fIe),f=0,r.frustum instanceof fn?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let A=r.direction,y=h.negate(i,TIt),x=h.equalsEpsilon(A,i,D.EPSILON2),b=h.equalsEpsilon(A,y,D.EPSILON2);if(!x&&!b){g=h.dot(A,i);let T=D.acosClamped(g);f>0&&f>T&&(f=T-D.EPSILON4),g=h.dot(A,y),T=D.acosClamped(g),f<0&&-f>T&&(f=-T+D.EPSILON4);let E=h.cross(i,A,CIt);r.look(E,f)}else(x&&f<0||b&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function EIt(e){Hl(e,e.enableRotate,e.rotateEventTypes,oIt,e.inertiaSpin,"_lastInertiaSpinMovement"),Hl(e,e.enableZoom,e.zoomEventTypes,vIe,e.inertiaZoom,"_lastInertiaZoomMovement"),Hl(e,e.enableTilt,e.tiltEventTypes,gIt,e.inertiaSpin,"_lastInertiaTiltMovement"),Hl(e,e.enableLook,e.lookEventTypes,Pf)}var vIt=new R,SIt=new de;function kte(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===ie.SCENE2D||i===ie.MORPHING)return;let o=n.camera,r=n.ellipsoid??te.WGS84,a=n.mapProjection,s,c;R.equals(o.transform,R.IDENTITY)||(s=R.clone(o.transform,vIt),c=h.magnitude(o.position),o._setTransform(R.IDENTITY));let u=SIt;i===ie.SCENE3D?r.cartesianToCartographic(o.position,u):a.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===ie.SCENE3D?r.cartographicToCartesian(u,o.position):a.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(s)&&(o._setTransform(s),f&&(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)))}PR.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ie.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var wIt=new h,IIt=new h;PR.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;R.equals(t.transform,R.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??te.default):(this._globe=void 0,this._ellipsoid=te.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=ho.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=ho.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=ho.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let a=this._ellipsoid.maximumRadius;this._rotateFactor=1/a,this._rotateRateRangeAdjustment=a,this._adjustedHeightForTerrain=!1;let s=h.clone(t.positionWC,wIt),c=h.clone(t.directionWC,IIt);if(i===ie.SCENE2D?Swt(this):i===ie.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,Qwt(this)):i===ie.SCENE3D&&(this._horizontalRotationAxis=void 0,EIt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(s,t.positionWC)||!h.equals(c,t.directionWC);kte(this,u)}this._aggregator.reset()};PR.prototype.isDestroyed=function(){return!1};PR.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),fe(this)};var o6=PR;var r6=`uniform sampler2D colorTexture;
  13396. uniform sampler2D colorTexture2;
  13397. uniform vec2 center;
  13398. uniform float radius;
  13399. in vec2 v_textureCoordinates;
  13400. void main()
  13401. {
  13402. vec4 color0 = texture(colorTexture, v_textureCoordinates);
  13403. vec4 color1 = texture(colorTexture2, v_textureCoordinates);
  13404. float x = length(gl_FragCoord.xy - center) / radius;
  13405. float t = smoothstep(0.5, 0.8, x);
  13406. out_FragColor = mix(color0 + color1, color1, t);
  13407. }
  13408. `;var a6=`uniform sampler2D colorTexture;
  13409. uniform float avgLuminance;
  13410. uniform float threshold;
  13411. uniform float offset;
  13412. in vec2 v_textureCoordinates;
  13413. float key(float avg)
  13414. {
  13415. float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));
  13416. return max(0.0, guess) + 0.1;
  13417. }
  13418. // See section 9. "The bright-pass filter" of Realtime HDR Rendering
  13419. // http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf
  13420. void main()
  13421. {
  13422. vec4 color = texture(colorTexture, v_textureCoordinates);
  13423. vec3 xyz = czm_RGBToXYZ(color.rgb);
  13424. float luminance = xyz.r;
  13425. float scaledLum = key(avgLuminance) * luminance / avgLuminance;
  13426. float brightLum = max(scaledLum - threshold, 0.0);
  13427. float brightness = brightLum / (offset + brightLum);
  13428. xyz.r = brightness;
  13429. out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);
  13430. }
  13431. `;function Ig(){this._sceneFramebuffer=new BS;let e=.125,t=new Array(6);t[0]=new Ro({fragmentShader:Sf,textureScale:e,forcePowerOfTwo:!0,sampleMode:Fd.LINEAR});let n=t[1]=new Ro({fragmentShader:a6,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new z,t[2]=new Ro({fragmentShader:jb,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 Ro({fragmentShader:jb,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 Ro({fragmentShader:Sf,sampleMode:Fd.LINEAR}),this._uCenter=new z,this._uRadius=void 0,t[5]=new Ro({fragmentShader:r6,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new wf({stages:t});let o=new kS(this),r=t.length;for(let a=0;a<r;++a)t[a]._textureCache=o;this._textureCache=o,this.length=t.length}Ig.prototype.get=function(e){return this._stages.get(e)};Ig.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 DIt=new se,DIe=new z,PIt=new z,PIe=new R;function RIt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,a=i.viewProjection,s=i.projection,c=R.computeViewportTransformation(n,0,1,PIe),u=R.multiplyByPoint(r,o,DIt),f=pt.pointToGLWindowCoordinates(a,c,o,DIe);u.x+=D.SOLAR_RADIUS;let d=pt.pointToGLWindowCoordinates(s,c,u,u),p=z.magnitude(z.subtract(d,f,d))*30*2,g=PIt;g.x=p,g.y=p,e._uCenter=z.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,A=t.drawingBufferHeight,y=e._stages,x=y.get(0),b=x.outputTexture.width,T=x.outputTexture.height,E=new Je;E.width=b,E.height=T,c=R.computeViewportTransformation(E,0,1,PIe),f=pt.pointToGLWindowCoordinates(a,c,o,DIe),g.x*=b/m,g.y*=T/A;let S=x.scissorRectangle;S.x=Math.max(f.x-g.x*.5,0),S.y=Math.max(f.y-g.y*.5,0),S.width=Math.min(g.x,m),S.height=Math.min(g.y,A);for(let w=1;w<4;++w)Je.clone(S,y.get(w).scissorRectangle)}Ig.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Ig.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),RIt(this,t,n),o};Ig.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)};Ig.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Sf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Ig.prototype.isDestroyed=function(){return!1};Ig.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),fe(this)};var s6=Ig;function RIe(){this._cachedShowFrustumsShaders={}}function OIt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function MIt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=He.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let a=r.length,s="";s+=`uniform vec3 debugShowCommandsColor;
  13432. `,s+=`uniform vec3 debugShowFrustumsColor;
  13433. `,s+=`void main()
  13434. {
  13435. czm_Debug_main();
  13436. `;let c;if(a>0)for(c=0;c<a;++c)s+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor;
  13437. `,s+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor;
  13438. `;else s+=` out_FragColor.rgb *= debugShowCommandsColor;
  13439. `,s+=` out_FragColor.rgb *= debugShowFrustumsColor;
  13440. `;s+="}",o.sources.push(s);let u=OIt(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var RR=new U;function BIt(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=U.fromRandom()),t._debugColor):U.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(RR.red=t.debugOverlappingFrustums&1?1:0,RR.green=t.debugOverlappingFrustums&2?1:0,RR.blue=t.debugOverlappingFrustums&4?1:0,RR.alpha=1,RR):U.WHITE}),n}var LIt=new tt;RIe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=MIt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=tt.shallowClone(t,LIt);r.shaderProgram=o,r.uniformMap=BIt(e,t),r.execute(e.context,n)};var c6=RIe;function Qb(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new $t}Qb.fromKeyframeNode=function(e,t,n,i){let o=new Qb(e,t,n),{spatialNode:r,content:a}=i;return o._metadata=NIt(e,a,n),o._orientedBoundingBox=kIt(e,r,n,o._orientedBoundingBox),o};function NIt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,a={};for(let s=0;s<i.length;s++){let c=i[s],u=ht.getComponentCount(o[s]),f=r[s].slice(n*u,(n+1)*u);a[c]=f}return a}var OIe=new h,FIt=new h;function kIt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,a=Math.floor(n/r),s=n-a*r,c=Math.floor(s/o.x),u=s-c*o.x,f=h.fromElements(u,c,a,OIe),d=h.divideComponents(h.subtract(f,e._paddingBefore,OIe),e.dimensions,FIt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(Qb.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()}}});Qb.prototype.hasProperty=function(e){return l(this._metadata[e])};Qb.prototype.getNames=function(){return Object.keys(this._metadata)};Qb.prototype.getProperty=function(e){return this._metadata[e]};var l6=Qb;function zIt(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),o=i.createLinearGradient(0,0,n.width,0),r=1/(e.length-1);for(let c=0;c<e.length;c++){let u=e[c],f=c*r,d=u.toCssColorString();o.addColorStop(f,d)}i.fillStyle=o,i.fillRect(0,0,n.width,n.height);let a=i.getImageData(0,0,n.width,n.height);return new Uint8Array(a.data.buffer)}var u6=zIt;var MIe={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"};Object.freeze(MIe);var Dg=MIe;function UIt(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 f6=UIt;function jS(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}jS.prototype.getTexture=function(e){return this._textures[e]};function VIt(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})}jS.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):VIt(this,e,t)};function jIt(e,t,n){let{id:i,textureUniform:o,image:r}=t,a=n.webgl2?d6(o,r,n):GIt(o,r,n),s=e._textures[i];l(s)&&s!==n.defaultTexture&&s.destroy(),e._textures[i]=a}function d6(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?LIe(e,n):new Dt({context:n,source:t,sampler:o});return BIe(o)&&r.generateMipmap(),r}function GIt(e,t,n){let{typedArray:i,sampler:o}=e,r=BIe(o),a=o.wrapS===un.REPEAT||o.wrapS===un.MIRRORED_REPEAT||o.wrapT===un.REPEAT||o.wrapT===un.MIRRORED_REPEAT,{width:s,height:c}=l(i)?e:t,u=[s,c].every(D.isPowerOfTwo);if((r||a)&&!u)if(l(i)){if(e.pixelDatatype===je.UNSIGNED_BYTE){let d=f6(i,s,c),p=cx(d);return d6({sampler:o},p,n)}}else{let d=cx(t);return d6(e,d,n)}else return d6(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):a&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),LIe(e,n)}function BIe(e){return[Vt.NEAREST_MIPMAP_NEAREST,Vt.NEAREST_MIPMAP_LINEAR,Vt.LINEAR_MIPMAP_NEAREST,Vt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function LIe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:a,sampler:s}=e;return new Dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:a,width:o,height:r},sampler:s,flipY:!1})}jS.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];jIt(this,o,t)}n.length=0};jS.prototype.isDestroyed=function(){return!1};jS.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 fe(this)};var h6=jS;function OR(e){e=e??G.EMPTY_OBJECT,this.mode=e.mode??Y_.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??G.EMPTY_OBJECT,this.varyings=e.varyings??G.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Cx.INHERIT,this._textureManager=new h6,this._defaultTexture=void 0,this.uniformMap=HIt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},YIt(this),XIt(this)}function HIt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===Dg.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=WIt(e,i)):n[i]=qIt(e,i)}return n}function WIt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function qIt(e,t){return function(){return e.uniforms[t].value}}function $b(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function YIt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,$b(r,t,o),o=e.usedVariablesVertex.featureIdSet,$b(r,n,o),o=e.usedVariablesVertex.metadataSet,$b(r,i,o));let a=e.fragmentShaderText;if(l(a)){o=e.usedVariablesFragment.attributeSet,$b(a,t,o),o=e.usedVariablesFragment.featureIdSet,$b(a,n,o),o=e.usedVariablesFragment.metadataSet,$b(a,i,o);let s=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;$b(a,s,c)}}function NIe(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 cl(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${NIe(t)} is not available in the ${i} shader. Did you mean ${NIe(n)} instead?`;throw new _e(o)}}function XIt(e){let t=e.usedVariablesVertex.attributeSet;cl(t,"position","positionMC","vertex"),cl(t,"normal","normalMC","vertex"),cl(t,"tangent","tangentMC","vertex"),cl(t,"bitangent","bitangentMC","vertex"),cl(t,"positionWC","positionMC","vertex"),cl(t,"positionEC","positionMC","vertex"),cl(t,"normalEC","normalMC","vertex"),cl(t,"tangentEC","tangentMC","vertex"),cl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;cl(n,"position","positionEC","fragment"),cl(n,"normal","normalEC","fragment"),cl(n,"tangent","tangentEC","fragment"),cl(n,"bitangent","bitangentEC","fragment"),cl(n,"normalMC","normalEC","fragment"),cl(n,"tangentMC","tangentEC","fragment"),cl(n,"bitangentMC","bitangentEC","fragment")}OR.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===Dg.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};OR.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};OR.prototype.isDestroyed=function(){return!1};OR.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),fe(this)};var Pg=OR;function KIt(e){e=e??G.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??Xe.RGBA,this.pixelDatatype=e.pixelDatatype??je.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?un.REPEAT:un.CLAMP_TO_EDGE;this.sampler=new jt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var m6=KIt;function QIt(e){let{names:t,types:n,componentTypes:i,minimumValues:o,maximumValues:r}=e;for(let a=0;a<t.length;a++){if(!$It(o?.[a],r?.[a]))continue;let s=JIt(t[a],n[a],i[a],o[a],r[a]);if(l(s))return s}}function $It(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function JIt(e,t,n,i,o){if(t===ht.VEC4&&n===Rt.FLOAT32)return ZIt(e,i,o);if(t===ht.SCALAR&&n===Rt.FLOAT32)return eDt(e,i,o)}function ZIt(e,t,n){let i=Math.min(...t),o=Math.max(...n);if(!(i<0||o>1))return new Pg({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
  13441. {
  13442. material.diffuse = fsInput.metadata.${e}.rgb;
  13443. material.alpha = fsInput.metadata.${e}.a;
  13444. }`})}function eDt(e,t,n){let o=u6([new U(.267,.004,.329),new U(.282,.14,.457),new U(.254,.265,.53),new U(.207,.372,.553),new U(.164,.471,.558),new U(.128,.567,.551),new U(.135,.659,.518),new U(.194,.741,.443),new U(.282,.819,.369),new U(.396,.898,.301),new U(.538,.965,.236),new U(.741,.998,.149),new U(.993,1,.144)],128),r=new m6({typedArray:o,width:128,height:1});return new Pg({uniforms:{u_colorMap:{type:Dg.SAMPLER_2D,value:r},u_minimumValue:{type:Dg.FLOAT,value:t[0]},u_maximumValue:{type:Dg.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
  13445. {
  13446. float value = fsInput.metadata.${e};
  13447. vec3 voxelNormal = fsInput.attributes.normalEC;
  13448. float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC));
  13449. float lighting = 0.5 + 0.5 * diffuse;
  13450. if (value >= u_minimumValue && value <= u_maximumValue) {
  13451. float lerp = (value - u_minimumValue) / (u_maximumValue - u_minimumValue);
  13452. material.diffuse = texture(u_colorMap, vec2(lerp, 0.5)).rgb * lighting;
  13453. material.alpha = 1.0;
  13454. }
  13455. }`})}var MR=QIt;function tDt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:a,maximumValues:s}=t._provider,c=o.length,u=l(a)&&l(s);n.addDefine("METADATA_COUNT",c,he.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,he.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],v=p6(o[_]),I=`PropertyStatistics_${C}`,M=`PropertyStatistics_${C}`;n.addStruct(I,M,he.FRAGMENT),n.addStructField(I,v,"min"),n.addStructField(I,v,"max")}let f="MetadataStatistics",d="MetadataStatistics",p="metadataStatistics";n.addStruct(f,d,he.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],v=`PropertyStatistics_${C}`,I=C;n.addStructField(f,v,I)}let g="Metadata",m="Metadata",A="metadata";n.addStruct(g,m,he.FRAGMENT);for(let _=0;_<c;_++){let C=p6(o[_]);n.addStructField(g,C,i[_])}let y="Attributes",x="Attributes",b="attributes";n.addStruct(y,x,he.FRAGMENT),n.addStructField(y,"vec3","positionEC"),n.addStructField(y,"vec3","normalEC");let T="Voxel",E="Voxel",S="voxel";n.addStruct(T,E,he.FRAGMENT),n.addStructField(T,"vec3","viewDirUv"),n.addStructField(T,"float","travelDistance"),n.addStructField(T,"int","stepCount"),n.addStructField(T,"int","tileIndex"),n.addStructField(T,"int","sampleIndex"),n.addStructField(T,"float","distanceToDepthBuffer");let w="FragmentInput";n.addStruct(w,"FragmentInput",he.FRAGMENT),n.addStructField(w,d,p),n.addStructField(w,m,A),n.addStructField(w,x,b),n.addStructField(w,E,S);let O="Properties",B="Properties",L="properties";n.addStruct(O,B,he.FRAGMENT);for(let _=0;_<c;_++){let C=p6(o[_]);n.addStructField(O,C,i[_])}{let _="clearProperties";n.addFunction(_,`${B} clearProperties()`,he.FRAGMENT),n.addFunctionLines(_,[`${B} ${L};`]);for(let C=0;C<c;C++){let v=p6(o[C],r[C]);n.addFunctionLines(_,[`${L}.${i[C]} = ${v}(0.0);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="sumProperties";n.addFunction(_,`${B} sumProperties(${B} propertiesA, ${B} propertiesB)`,he.FRAGMENT),n.addFunctionLines(_,[`${B} ${L};`]);for(let C=0;C<c;C++){let v=i[C];n.addFunctionLines(_,[`${L}.${v} = propertiesA.${v} + propertiesB.${v};`])}n.addFunctionLines(_,[`return ${L};`])}{let _="scaleProperties";n.addFunction(_,`${B} scaleProperties(${B} ${L}, float scale)`,he.FRAGMENT),n.addFunctionLines(_,[`${B} scaledProperties = ${L};`]);for(let C=0;C<c;C++)n.addFunctionLines(_,[`scaledProperties.${i[C]} *= scale;`]);n.addFunctionLines(_,["return scaledProperties;"])}{let _="mixProperties";n.addFunction(_,`${B} mixProperties(${B} propertiesA, ${B} propertiesB, float mixFactor)`,he.FRAGMENT),n.addFunctionLines(_,[`${B} ${L};`]);for(let C=0;C<c;C++){let v=i[C];n.addFunctionLines(_,[`${L}.${v} = mix(propertiesA.${v}, propertiesB.${v}, mixFactor);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="copyPropertiesToMetadata";n.addFunction(_,`void copyPropertiesToMetadata(in ${B} ${L}, inout ${m} ${A})`,he.FRAGMENT);for(let C=0;C<c;C++){let v=i[C];n.addFunctionLines(_,[`${A}.${v} = ${L}.${v};`])}}if(u){let _="setStatistics";n.addFunction(_,`void setStatistics(inout ${d} ${p})`,he.FRAGMENT);for(let C=0;C<c;C++){let v=i[C],I=o[C],M=ht.getComponentCount(I);for(let N=0;N<M;N++){let j=iDt(I,N),k=a[C][N],V=s[C][N];!l(k)||!l(V)||n.addFunctionLines(_,[`${p}.${v}.min${j} = ${FIe(k)};`,`${p}.${v}.max${j} = ${FIe(V)};`])}}}{let _="getPropertiesFromMegatextureAtUv";n.addFunction(_,`${B} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,he.FRAGMENT),n.addFunctionLines(_,[`${B} ${L};`]);for(let C=0;C<c;C++){let v=o[C],I=r[C],M=nDt(v,I);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${M};`])}n.addFunctionLines(_,[`return ${L};`])}}function p6(e){if(e===ht.SCALAR)return"float";if(e===ht.VEC2)return"vec2";if(e===ht.VEC3)return"vec3";if(e===ht.VEC4)return"vec4"}function nDt(e){if(e===ht.SCALAR)return".r";if(e===ht.VEC2)return".ra";if(e===ht.VEC3)return".rgb";if(e===ht.VEC4)return""}function FIe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function iDt(e,t){return e===ht.SCALAR?"":`[${t}]`}var g6=tDt;function am(e){let{planes:t,modelMatrix:n=R.IDENTITY,unionClippingRegions:i=!1}=e??G.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=R.clone(n),this.planeAdded=new ye,this.planeRemoved=new ye,this._unionClippingRegions=i,this._testIntersection=i?kIe:zIe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let o=0;o<t.length;++o)this.add(t[o])}function kIe(e){return e===qt.OUTSIDE}function zIe(e){return e===qt.INSIDE}Object.defineProperties(am.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?kIe:zIe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});am.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};am.prototype.get=function(e){return this._planes[e]};function UIe(e,t){for(let n=0;n<e.length;++n)if(tn.equals(e[n],t))return n;return-1}am.prototype.contains=function(e){return UIe(this._planes,e)!==-1};am.prototype.remove=function(e){let t=this._planes,n=UIe(t,e);if(n===-1)return!1;e instanceof ss&&(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 ss&&(r.index=o)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};am.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ss&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var oDt=new tn(h.fromElements(1,0,0),0);function rDt(e,t){let n=e._float32View,i=e._planes,o=0;for(let r=0;r<i.length;++r){let{normal:a,distance:s}=sDt(i[r],t,oDt);n[o]=a.x,n[o+1]=a.y,n[o+2]=a.z,n[o+3]=s,o+=4}}var zte=new se,aDt=new h;function sDt(e,t,n){let{normal:i,distance:o}=e,r=se.fromElements(i.x,i.y,i.z,o,zte),a=R.multiplyByVector(t,r,zte),s=h.fromCartesian4(a,aDt);return a=se.divideByScalar(a,h.magnitude(s),zte),tn.fromCartesian4(a,n)}function VIe(e,t){return t.x=Math.min(e,Mt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var cDt=new z;am.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let a=n.width*n.height;(a<i||i<.25*a)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let a=VIe(i,cDt);a.y*=2,n=new Dt({context:e.context,width:a.x,height:a.y,pixelFormat:Xe.RGBA,pixelDatatype:je.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4),this._clippingPlanesTexture=n}let{width:o,height:r}=n;rDt(this,t),n.copyFrom({source:{width:o,height:r,arrayBufferView:this._float32View}})};am.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=e.length,r=VIe(o,n);return r.y*=2,r};am.prototype.isDestroyed=function(){return!1};am.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),fe(this)};var ly=am;var _6=`struct Ray {
  13456. vec3 pos;
  13457. vec3 dir;
  13458. };
  13459. float minComponent(in vec3 v) {
  13460. return min(min(v.x, v.y), v.z);
  13461. }
  13462. float maxComponent(in vec3 v) {
  13463. return max(max(v.x, v.y), v.z);
  13464. }
  13465. `;var A6=`// See Intersection.glsl for the definition of intersectScene
  13466. // See IntersectionUtils.glsl for the definition of nextIntersection
  13467. // See convertLocalToBoxUv.glsl, convertLocalToCylinderUv.glsl, or convertLocalToEllipsoidUv.glsl
  13468. // for the definitions of convertLocalToShapeSpaceDerivative and getTileAndUvCoordinate.
  13469. // The appropriate functions are selected based on the VoxelPrimitive shape type,
  13470. // and added to the shader in Scene/VoxelRenderResources.js.
  13471. // See Octree.glsl for the definitions of TraversalData, SampleData,
  13472. // traverseOctreeFromBeginning, and traverseOctreeFromExisting
  13473. // See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture
  13474. #define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops
  13475. #if defined(PICKING_VOXEL)
  13476. #define ALPHA_ACCUM_MAX 0.1
  13477. #else
  13478. #define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0
  13479. #endif
  13480. uniform mat4 u_transformPositionViewToLocal;
  13481. uniform mat3 u_transformDirectionViewToLocal;
  13482. uniform vec3 u_cameraPositionLocal;
  13483. uniform vec3 u_cameraDirectionLocal;
  13484. uniform float u_stepSize;
  13485. #if defined(PICKING)
  13486. uniform vec4 u_pickColor;
  13487. #endif
  13488. vec3 getSampleSize(in int level) {
  13489. vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions);
  13490. vec3 sampleSizeUv = 1.0 / sampleCount;
  13491. return scaleShapeUvToShapeSpace(sampleSizeUv);
  13492. }
  13493. #define MINIMUM_STEP_SCALAR (0.02)
  13494. #define SHIFT_FRACTION (0.001)
  13495. /**
  13496. * Given a coordinate within a tile, and sample spacings along a ray through
  13497. * the coordinate, find the distance to the points where the ray entered and
  13498. * exited the voxel cell, along with the surface normals at those points.
  13499. * The surface normals are returned in shape space coordinates.
  13500. */
  13501. RayShapeIntersection getVoxelIntersection(in vec3 tileUv, in vec3 sampleSizeAlongRay) {
  13502. vec3 voxelCoord = tileUv * vec3(u_dimensions);
  13503. vec3 directions = sign(sampleSizeAlongRay);
  13504. vec3 positiveDirections = max(directions, 0.0);
  13505. vec3 entryCoord = mix(ceil(voxelCoord), floor(voxelCoord), positiveDirections);
  13506. vec3 exitCoord = entryCoord + directions;
  13507. vec3 distanceFromEntry = -abs((entryCoord - voxelCoord) * sampleSizeAlongRay);
  13508. float lastEntry = maxComponent(distanceFromEntry);
  13509. bvec3 isLastEntry = equal(distanceFromEntry, vec3(lastEntry));
  13510. vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
  13511. vec4 entry = vec4(entryNormal, lastEntry);
  13512. vec3 distanceToExit = abs((exitCoord - voxelCoord) * sampleSizeAlongRay);
  13513. float firstExit = minComponent(distanceToExit);
  13514. bvec3 isFirstExit = equal(distanceToExit, vec3(firstExit));
  13515. vec3 exitNormal = vec3(isFirstExit) * directions;
  13516. vec4 exit = vec4(exitNormal, firstExit);
  13517. return RayShapeIntersection(entry, exit);
  13518. }
  13519. vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) {
  13520. vec3 gradient = viewRay.dir * jacobianT;
  13521. vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;
  13522. RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);
  13523. // Transform normal from shape space to Cartesian space to eye space
  13524. vec3 voxelNormal = jacobianT * voxelIntersection.entry.xyz;
  13525. voxelNormal = normalize(czm_normal * voxelNormal);
  13526. // Compare with the shape intersection, to choose the appropriate normal
  13527. vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w);
  13528. vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry);
  13529. float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize;
  13530. float shift = fixedStep * SHIFT_FRACTION;
  13531. float dt = voxelIntersection.exit.w + shift;
  13532. if ((currentT + dt) > shapeIntersection.exit.w) {
  13533. // Stop at end of shape
  13534. dt = shapeIntersection.exit.w - currentT + shift;
  13535. }
  13536. float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift);
  13537. return vec4(entry.xyz, stepSize);
  13538. }
  13539. vec2 packIntToVec2(int value) {
  13540. float shifted = float(value) / 255.0;
  13541. float lowBits = fract(shifted);
  13542. float highBits = floor(shifted) / 255.0;
  13543. return vec2(highBits, lowBits);
  13544. }
  13545. vec2 packFloatToVec2(float value) {
  13546. float lowBits = fract(value);
  13547. float highBits = floor(value) / 255.0;
  13548. return vec2(highBits, lowBits);
  13549. }
  13550. int getSampleIndex(in SampleData sampleData) {
  13551. // tileUv = 1.0 is a valid coordinate but sampleIndex = u_inputDimensions is not.
  13552. // (tileUv = 1.0 corresponds to the far edge of the last sample, at index = u_inputDimensions - 1).
  13553. // Clamp to [0, voxelDimensions - 0.5) to avoid numerical error before flooring
  13554. vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5);
  13555. vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate);
  13556. ivec3 sampleIndex = ivec3(floor(inputCoordinate));
  13557. // Convert to a 1D index for lookup in a 1D data array
  13558. return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z);
  13559. }
  13560. /**
  13561. * Compute the view ray at the current fragment, in the local coordinates of the shape.
  13562. */
  13563. Ray getViewRayLocal() {
  13564. vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
  13565. vec3 origin;
  13566. vec3 direction;
  13567. if (czm_orthographicIn3D == 1.0) {
  13568. eyeCoordinates.z = 0.0;
  13569. origin = (u_transformPositionViewToLocal * eyeCoordinates).xyz;
  13570. direction = u_cameraDirectionLocal;
  13571. } else {
  13572. origin = u_cameraPositionLocal;
  13573. direction = u_transformDirectionViewToLocal * normalize(eyeCoordinates.xyz);
  13574. }
  13575. return Ray(origin, direction);
  13576. }
  13577. Ray getViewRayEC() {
  13578. vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
  13579. vec3 viewPosEC = (czm_orthographicIn3D == 1.0)
  13580. ? vec3(eyeCoordinates.xy, 0.0)
  13581. : vec3(0.0);
  13582. vec3 viewDirEC = normalize(eyeCoordinates.xyz);
  13583. return Ray(viewPosEC, viewDirEC);
  13584. }
  13585. void main()
  13586. {
  13587. Ray viewRayLocal = getViewRayLocal();
  13588. Ray viewRayEC = getViewRayEC();
  13589. Intersections ix;
  13590. vec2 screenCoord = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
  13591. RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayLocal, viewRayEC, ix);
  13592. // Exit early if the scene was completely missed.
  13593. if (shapeIntersection.entry.w == NO_HIT) {
  13594. discard;
  13595. }
  13596. float currentT = shapeIntersection.entry.w;
  13597. float endT = shapeIntersection.exit.w;
  13598. vec3 positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
  13599. TileAndUvCoordinate tileAndUv = getTileAndUvCoordinate(positionEC);
  13600. vec3 positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
  13601. mat3 jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);
  13602. // Traverse the tree from the start position
  13603. TraversalData traversalData;
  13604. SampleData sampleDatas[SAMPLE_COUNT];
  13605. traverseOctreeFromBeginning(tileAndUv, traversalData, sampleDatas);
  13606. vec4 step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT);
  13607. FragmentInput fragmentInput;
  13608. #if defined(STATISTICS)
  13609. setStatistics(fragmentInput.metadataStatistics);
  13610. #endif
  13611. czm_modelMaterial materialOutput;
  13612. vec4 colorAccum = vec4(0.0);
  13613. for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
  13614. // Read properties from the megatexture based on the traversal state
  13615. Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);
  13616. // Prepare the custom shader inputs
  13617. copyPropertiesToMetadata(properties, fragmentInput.metadata);
  13618. fragmentInput.attributes.positionEC = positionEC;
  13619. // Re-normalize normals: some shape intersections may have been scaled to encode positive/negative shapes
  13620. fragmentInput.attributes.normalEC = normalize(step.xyz);
  13621. fragmentInput.voxel.viewDirUv = viewRayLocal.dir;
  13622. fragmentInput.voxel.travelDistance = step.w;
  13623. fragmentInput.voxel.stepCount = stepCount;
  13624. fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
  13625. fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]);
  13626. fragmentInput.voxel.distanceToDepthBuffer = ix.distanceToDepthBuffer - currentT;
  13627. // Run the custom shader
  13628. fragmentMain(fragmentInput, materialOutput);
  13629. // Sanitize the custom shader output
  13630. vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
  13631. color.rgb = max(color.rgb, vec3(0.0));
  13632. color.a = clamp(color.a, 0.0, 1.0);
  13633. // Pre-multiplied alpha blend
  13634. colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);
  13635. // Stop traversing if the alpha has been fully saturated
  13636. if (colorAccum.a > ALPHA_ACCUM_MAX) {
  13637. colorAccum.a = ALPHA_ACCUM_MAX;
  13638. break;
  13639. }
  13640. if (step.w == 0.0) {
  13641. // Shape is infinitely thin. The ray may have hit the edge of a
  13642. // foreground voxel. Step ahead slightly to check for more voxels
  13643. step.w = 0.001;
  13644. }
  13645. // Keep raymarching
  13646. currentT += step.w;
  13647. // Check if there's more intersections.
  13648. if (currentT > endT) {
  13649. #if (INTERSECTION_COUNT == 1)
  13650. break;
  13651. #else
  13652. shapeIntersection = nextIntersection(ix);
  13653. if (shapeIntersection.entry.w == NO_HIT) {
  13654. break;
  13655. } else {
  13656. // Found another intersection. Resume raymarching there
  13657. currentT = shapeIntersection.entry.w;
  13658. endT = shapeIntersection.exit.w;
  13659. }
  13660. #endif
  13661. }
  13662. positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
  13663. tileAndUv = getTileAndUvCoordinate(positionEC);
  13664. positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
  13665. jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);
  13666. // Traverse the tree from the current ray position.
  13667. // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.
  13668. traverseOctreeFromExisting(tileAndUv, traversalData, sampleDatas);
  13669. step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT);
  13670. }
  13671. // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]
  13672. colorAccum.a /= ALPHA_ACCUM_MAX;
  13673. #if defined(PICKING)
  13674. // If alpha is 0.0 there is nothing to pick
  13675. if (colorAccum.a == 0.0) {
  13676. discard;
  13677. }
  13678. out_FragColor = u_pickColor;
  13679. #elif defined(PICKING_VOXEL)
  13680. // If alpha is 0.0 there is nothing to pick
  13681. if (colorAccum.a == 0.0) {
  13682. discard;
  13683. }
  13684. vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex);
  13685. vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0]));
  13686. out_FragColor = vec4(megatextureId, sampleIndex);
  13687. #else
  13688. out_FragColor = colorAccum;
  13689. #endif
  13690. }
  13691. `;var y6=`in vec2 position;
  13692. uniform vec4 u_ndcSpaceAxisAlignedBoundingBox;
  13693. void main() {
  13694. vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy;
  13695. vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw;
  13696. vec2 translation = 0.5 * (aabbMax + aabbMin);
  13697. vec2 scale = 0.5 * (aabbMax - aabbMin);
  13698. gl_Position = vec4(position * scale + translation, 0.0, 1.0);
  13699. }
  13700. `;var x6=`/* Intersection defines
  13701. #define INTERSECTION_COUNT ###
  13702. */
  13703. #define NO_HIT (-czm_infinity)
  13704. #define INF_HIT (czm_infinity * 0.5)
  13705. struct RayShapeIntersection {
  13706. vec4 entry;
  13707. vec4 exit;
  13708. };
  13709. vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1)
  13710. {
  13711. if (intersect0.w == NO_HIT) {
  13712. return intersect1;
  13713. } else if (intersect1.w == NO_HIT) {
  13714. return intersect0;
  13715. }
  13716. return (intersect0.w <= intersect1.w) ? intersect0 : intersect1;
  13717. }
  13718. vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1)
  13719. {
  13720. return (intersect0.w >= intersect1.w) ? intersect0 : intersect1;
  13721. }
  13722. RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1)
  13723. {
  13724. bool missed = (intersect0.entry.w == NO_HIT) ||
  13725. (intersect1.entry.w == NO_HIT) ||
  13726. (intersect0.exit.w < intersect1.entry.w) ||
  13727. (intersect0.entry.w > intersect1.exit.w);
  13728. if (missed) {
  13729. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  13730. return RayShapeIntersection(miss, miss);
  13731. }
  13732. vec4 entry = intersectionMax(intersect0.entry, intersect1.entry);
  13733. vec4 exit = intersectionMin(intersect0.exit, intersect1.exit);
  13734. return RayShapeIntersection(entry, exit);
  13735. }
  13736. struct Intersections {
  13737. // Don't access these member variables directly - call the functions instead.
  13738. // Store an array of ray-surface intersections. Each intersection is composed of:
  13739. // .xyz for the surface normal at the intersection point
  13740. // .w for the T value
  13741. // The scale of the normal encodes the shape intersection type:
  13742. // length(intersection.xyz) = 1: positive shape entry
  13743. // length(intersection.xyz) = 2: positive shape exit
  13744. // length(intersection.xyz) = 3: negative shape entry
  13745. // length(intersection.xyz) = 4: negative shape exit
  13746. // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,
  13747. // so we need twice as many to track ray-*surface* intersections
  13748. vec4 intersections[INTERSECTION_COUNT * 2];
  13749. float distanceToDepthBuffer;
  13750. #if (INTERSECTION_COUNT > 1)
  13751. // Maintain state for future nextIntersection calls
  13752. int index;
  13753. int surroundCount;
  13754. bool surroundIsPositive;
  13755. #endif
  13756. };
  13757. RayShapeIntersection getFirstIntersection(in Intersections ix)
  13758. {
  13759. return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);
  13760. }
  13761. vec4 encodeIntersectionType(vec4 intersection, int index, bool entry)
  13762. {
  13763. float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;
  13764. return vec4(intersection.xyz * scale, intersection.w);
  13765. }
  13766. // Use defines instead of real functions because WebGL1 cannot access array with non-constant index.
  13767. #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))
  13768. #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)
  13769. #define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter))
  13770. #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)
  13771. #if (INTERSECTION_COUNT > 1)
  13772. void initializeIntersections(inout Intersections ix) {
  13773. // Sort the intersections from min T to max T with bubble sort.
  13774. // Note: If this sorting function changes, some of the intersection test may
  13775. // need to be updated. Search for "bubble sort" to find those areas.
  13776. const int sortPasses = INTERSECTION_COUNT * 2 - 1;
  13777. for (int n = sortPasses; n > 0; --n) {
  13778. for (int i = 0; i < sortPasses; ++i) {
  13779. // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot
  13780. // loop with non-constant condition, so it has to break early instead
  13781. if (i >= n) { break; }
  13782. vec4 intersect0 = ix.intersections[i + 0];
  13783. vec4 intersect1 = ix.intersections[i + 1];
  13784. bool inOrder = intersect0.w <= intersect1.w;
  13785. ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;
  13786. ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;
  13787. }
  13788. }
  13789. // Prepare initial state for nextIntersection
  13790. ix.index = 0;
  13791. ix.surroundCount = 0;
  13792. ix.surroundIsPositive = false;
  13793. }
  13794. #endif
  13795. #if (INTERSECTION_COUNT > 1)
  13796. RayShapeIntersection nextIntersection(inout Intersections ix) {
  13797. vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);
  13798. RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);
  13799. const int passCount = INTERSECTION_COUNT * 2;
  13800. if (ix.index == passCount) {
  13801. return shapeIntersection;
  13802. }
  13803. for (int i = 0; i < passCount; ++i) {
  13804. // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot
  13805. // loop with non-constant condition, so it has to continue instead.
  13806. if (i < ix.index) {
  13807. continue;
  13808. }
  13809. ix.index = i + 1;
  13810. surfaceIntersection = ix.intersections[i];
  13811. int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
  13812. bool currShapeIsPositive = intersectionType < 2;
  13813. bool enter = intersectionType % 2 == 0;
  13814. ix.surroundCount += enter ? +1 : -1;
  13815. ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;
  13816. // entering positive or exiting negative
  13817. if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
  13818. shapeIntersection.entry = surfaceIntersection;
  13819. }
  13820. // exiting positive or entering negative after being inside positive
  13821. bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
  13822. bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
  13823. if (exitPositive || enterNegativeFromPositive) {
  13824. shapeIntersection.exit = surfaceIntersection;
  13825. // entry and exit have been found, so the loop can stop
  13826. if (exitPositive) {
  13827. // After exiting positive shape there is nothing left to intersect, so jump to the end index.
  13828. ix.index = passCount;
  13829. }
  13830. break;
  13831. }
  13832. }
  13833. return shapeIntersection;
  13834. }
  13835. #endif
  13836. // NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1
  13837. `;var b6=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
  13838. // setIntersectionPair, INF_HIT, NO_HIT
  13839. /* intersectDepth defines (set in Scene/VoxelRenderResources.js)
  13840. #define DEPTH_INTERSECTION_INDEX ###
  13841. */
  13842. void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
  13843. float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
  13844. float entry;
  13845. float exit;
  13846. if (logDepthOrDepth != 0.0) {
  13847. // Calculate how far the ray must travel before it hits the depth buffer.
  13848. vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
  13849. eyeCoordinateDepth /= eyeCoordinateDepth.w;
  13850. entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir);
  13851. exit = +INF_HIT;
  13852. } else {
  13853. // There's no depth at this location.
  13854. entry = NO_HIT;
  13855. exit = NO_HIT;
  13856. }
  13857. ix.distanceToDepthBuffer = entry;
  13858. #if defined(DEPTH_TEST)
  13859. setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit));
  13860. #endif
  13861. }
  13862. `;var T6=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,
  13863. // NO_HIT, setShapeIntersection
  13864. /* Clipping plane defines (set in Scene/VoxelRenderResources.js)
  13865. #define CLIPPING_PLANES_UNION
  13866. #define CLIPPING_PLANES_COUNT
  13867. #define CLIPPING_PLANES_INTERSECTION_INDEX
  13868. */
  13869. uniform sampler2D u_clippingPlanesTexture;
  13870. uniform mat4 u_clippingPlanesMatrix;
  13871. // Plane is in Hessian Normal Form
  13872. vec4 intersectPlane(in Ray ray, in vec4 plane) {
  13873. vec3 n = plane.xyz; // normal
  13874. float w = plane.w; // -dot(pointOnPlane, normal)
  13875. float a = dot(ray.pos, n);
  13876. float b = dot(ray.dir, n);
  13877. float t = -(w + a) / b;
  13878. return vec4(n, t);
  13879. }
  13880. #ifdef CLIPPING_PLANES
  13881. void intersectClippingPlanes(in Ray ray, inout Intersections ix) {
  13882. vec4 backSide = vec4(-ray.dir, -INF_HIT);
  13883. vec4 farSide = vec4(ray.dir, +INF_HIT);
  13884. RayShapeIntersection clippingVolume;
  13885. #if (CLIPPING_PLANES_COUNT == 1)
  13886. // Union and intersection are the same when there's one clipping plane, and the code
  13887. // is more simplified.
  13888. vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0);
  13889. vec4 intersection = intersectPlane(ray, planeUv);
  13890. bool reflects = dot(ray.dir, intersection.xyz) < 0.0;
  13891. clippingVolume.entry = reflects ? backSide : intersection;
  13892. clippingVolume.exit = reflects ? intersection : farSide;
  13893. setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
  13894. #elif defined(CLIPPING_PLANES_UNION)
  13895. vec4 firstTransmission = vec4(ray.dir, +INF_HIT);
  13896. vec4 lastReflection = vec4(-ray.dir, -INF_HIT);
  13897. for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
  13898. vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i);
  13899. vec4 intersection = intersectPlane(ray, planeUv);
  13900. if (dot(ray.dir, planeUv.xyz) > 0.0) {
  13901. firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;
  13902. } else {
  13903. lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;
  13904. }
  13905. }
  13906. clippingVolume.entry = backSide;
  13907. clippingVolume.exit = lastReflection;
  13908. setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);
  13909. clippingVolume.entry = firstTransmission;
  13910. clippingVolume.exit = farSide;
  13911. setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);
  13912. #else // intersection
  13913. vec4 lastTransmission = vec4(ray.dir, -INF_HIT);
  13914. vec4 firstReflection = vec4(-ray.dir, +INF_HIT);
  13915. for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
  13916. vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i);
  13917. vec4 intersection = intersectPlane(ray, planeUv);
  13918. if (dot(ray.dir, planeUv.xyz) > 0.0) {
  13919. lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;
  13920. } else {
  13921. firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;
  13922. }
  13923. }
  13924. if (lastTransmission.w < firstReflection.w) {
  13925. clippingVolume.entry = lastTransmission;
  13926. clippingVolume.exit = firstReflection;
  13927. } else {
  13928. clippingVolume.entry = vec4(-ray.dir, NO_HIT);
  13929. clippingVolume.exit = vec4(ray.dir, NO_HIT);
  13930. }
  13931. setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
  13932. #endif
  13933. }
  13934. #endif
  13935. `;var BR=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,
  13936. // RayShapeIntersection
  13937. vec4 transformNormalToEC(in vec4 intersection) {
  13938. return vec4(normalize(czm_normal * intersection.xyz), intersection.w);
  13939. }
  13940. RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) {
  13941. return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit));
  13942. }
  13943. vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {
  13944. float normalSign = positiveNormal ? 1.0 : -1.0;
  13945. vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;
  13946. vec2 position = ray.pos.xy;
  13947. vec2 direction = ray.dir.xy;
  13948. float approachRate = dot(direction, planeNormal);
  13949. float distance = -dot(position, planeNormal);
  13950. float t = (approachRate == 0.0)
  13951. ? NO_HIT
  13952. : distance / approachRate;
  13953. return vec4(planeNormal, 0.0, t);
  13954. }
  13955. RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal)
  13956. {
  13957. vec4 intersection = intersectLongitude(ray, angle, positiveNormal);
  13958. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  13959. bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0);
  13960. if (!hitFront) {
  13961. return RayShapeIntersection(intersection, farSide);
  13962. } else {
  13963. return RayShapeIntersection(-1.0 * farSide, intersection);
  13964. }
  13965. }
  13966. void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])
  13967. {
  13968. intersections[0] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false));
  13969. intersections[1] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.y, true));
  13970. }
  13971. bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {
  13972. float normalSign = positiveNormal ? 1.0 : -1.0;
  13973. vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign;
  13974. vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy;
  13975. return dot(hit, planeDirection) > 0.0;
  13976. }
  13977. void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {
  13978. vec4 intersection = intersectLongitude(ray, angle, true);
  13979. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  13980. bool hitPositiveSide = hitPositiveHalfPlane(ray, intersection, true);
  13981. farSide = transformNormalToEC(farSide);
  13982. if (hitPositiveSide) {
  13983. intersection = transformNormalToEC(intersection);
  13984. intersections[0].entry = -1.0 * farSide;
  13985. intersections[0].exit = vec4(-1.0 * intersection.xyz, intersection.w);
  13986. intersections[1].entry = intersection;
  13987. intersections[1].exit = farSide;
  13988. } else {
  13989. vec4 miss = vec4(normalize(czm_normal * ray.dir), NO_HIT);
  13990. intersections[0].entry = -1.0 * farSide;
  13991. intersections[0].exit = farSide;
  13992. intersections[1].entry = miss;
  13993. intersections[1].exit = miss;
  13994. }
  13995. }
  13996. RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)
  13997. {
  13998. // Note: works for maxAngle > minAngle + pi, where the "regular wedge"
  13999. // is actually a negative volume.
  14000. // Compute intersections with the two planes.
  14001. // Normals will point toward the "outside" (negative space)
  14002. vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);
  14003. vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);
  14004. // Choose intersection with smallest T as the "first", the other as "last"
  14005. // Note: first or last could be in the "shadow" wedge, beyond the tip
  14006. bool inOrder = intersect1.w <= intersect2.w;
  14007. vec4 first = inOrder ? intersect1 : intersect2;
  14008. vec4 last = inOrder ? intersect2 : intersect1;
  14009. bool firstIsAhead = first.w >= 0.0;
  14010. bool startedInsideFirst = dot(ray.pos.xy, first.xy) < 0.0;
  14011. bool exitFromInside = firstIsAhead == startedInsideFirst;
  14012. bool lastIsAhead = last.w > 0.0;
  14013. bool startedOutsideLast = dot(ray.pos.xy, last.xy) >= 0.0;
  14014. bool enterFromOutside = lastIsAhead == startedOutsideLast;
  14015. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  14016. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  14017. if (exitFromInside && enterFromOutside) {
  14018. // Ray crosses both faces of negative wedge, exiting then entering the positive shape
  14019. return transformNormalsToEC(RayShapeIntersection(first, last));
  14020. } else if (!exitFromInside && enterFromOutside) {
  14021. // Ray starts inside wedge. last is in shadow wedge, and first is actually the entry
  14022. return transformNormalsToEC(RayShapeIntersection(-1.0 * farSide, first));
  14023. } else if (exitFromInside && !enterFromOutside) {
  14024. // First intersection was in the shadow wedge, so last is actually the exit
  14025. return transformNormalsToEC(RayShapeIntersection(last, farSide));
  14026. } else { // !exitFromInside && !enterFromOutside
  14027. // Both intersections were in the shadow wedge
  14028. return transformNormalsToEC(RayShapeIntersection(miss, miss));
  14029. }
  14030. }
  14031. `;var C6=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection,
  14032. // NO_HIT, Intersections
  14033. /* Box defines (set in Scene/VoxelBoxShape.js)
  14034. #define BOX_INTERSECTION_INDEX ### // always 0
  14035. */
  14036. uniform sampler2D u_renderBoundPlanesTexture;
  14037. RayShapeIntersection intersectBoundPlanes(in Ray ray) {
  14038. vec4 lastEntry = vec4(ray.dir, -INF_HIT);
  14039. vec4 firstExit = vec4(-ray.dir, +INF_HIT);
  14040. for (int i = 0; i < 6; i++) {
  14041. vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
  14042. vec4 intersection = intersectPlane(ray, boundPlane);
  14043. if (dot(ray.dir, boundPlane.xyz) < 0.0) {
  14044. lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
  14045. } else {
  14046. firstExit = intersection.w < firstExit.w ? intersection: firstExit;
  14047. }
  14048. }
  14049. if (lastEntry.w < firstExit.w) {
  14050. return RayShapeIntersection(lastEntry, firstExit);
  14051. } else {
  14052. return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
  14053. }
  14054. }
  14055. void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix)
  14056. {
  14057. RayShapeIntersection intersection = intersectBoundPlanes(rayEC);
  14058. setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
  14059. }
  14060. `;var E6=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections,
  14061. // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection,
  14062. // intersectIntersections
  14063. // See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
  14064. // intersectFlippedWedge, intersectRegularWedge
  14065. /* Cylinder defines (set in Scene/VoxelCylinderShape.js)
  14066. #define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN
  14067. #define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT
  14068. #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE
  14069. #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF
  14070. #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF
  14071. #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO
  14072. #define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX
  14073. #define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN
  14074. #define CYLINDER_INTERSECTION_INDEX_ANGLE
  14075. */
  14076. // Cylinder uniforms
  14077. uniform vec2 u_cylinderRenderRadiusMinMax;
  14078. #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
  14079. uniform vec2 u_cylinderRenderAngleMinMax;
  14080. #endif
  14081. uniform sampler2D u_renderBoundPlanesTexture;
  14082. RayShapeIntersection intersectBoundPlanes(in Ray ray) {
  14083. vec4 lastEntry = vec4(ray.dir, -INF_HIT);
  14084. vec4 firstExit = vec4(-ray.dir, +INF_HIT);
  14085. for (int i = 0; i < 2; i++) {
  14086. vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
  14087. vec4 intersection = intersectPlane(ray, boundPlane);
  14088. if (dot(ray.dir, boundPlane.xyz) < 0.0) {
  14089. lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
  14090. } else {
  14091. firstExit = intersection.w < firstExit.w ? intersection: firstExit;
  14092. }
  14093. }
  14094. if (lastEntry.w < firstExit.w) {
  14095. return RayShapeIntersection(lastEntry, firstExit);
  14096. } else {
  14097. return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
  14098. }
  14099. }
  14100. /**
  14101. * Find the intersection of a ray with a right cylindrical surface of a given radius
  14102. * about the z-axis.
  14103. */
  14104. RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex)
  14105. {
  14106. vec2 position = ray.pos.xy;
  14107. vec2 direction = ray.dir.xy;
  14108. float a = dot(direction, direction);
  14109. float b = dot(position, direction);
  14110. float c = dot(position, position) - radius * radius;
  14111. float determinant = b * b - a * c;
  14112. if (determinant < 0.0) {
  14113. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  14114. return RayShapeIntersection(miss, miss);
  14115. }
  14116. determinant = sqrt(determinant);
  14117. float t1 = (-b - determinant) / a;
  14118. float t2 = (-b + determinant) / a;
  14119. float signFlip = convex ? 1.0 : -1.0;
  14120. vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0);
  14121. vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0);
  14122. // Return normals in eye coordinates
  14123. vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1);
  14124. vec4 intersect2 = vec4(normalize(czm_normal * normal2), t2);
  14125. return RayShapeIntersection(intersect1, intersect2);
  14126. }
  14127. /**
  14128. * Find the intersection of a ray with a right cylindrical solid of given
  14129. * radius and height bounds. NOTE: The shape is assumed to be convex.
  14130. */
  14131. RayShapeIntersection intersectBoundedCylinder(in Ray ray, in Ray rayEC, in float radius)
  14132. {
  14133. RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
  14134. RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC);
  14135. return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
  14136. }
  14137. void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix)
  14138. {
  14139. RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y);
  14140. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);
  14141. if (outerIntersect.entry.w == NO_HIT) {
  14142. return;
  14143. }
  14144. #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
  14145. // When the cylinder is perfectly thin it's necessary to sandwich the
  14146. // inner cylinder intersection inside the outer cylinder intersection.
  14147. // Without this special case,
  14148. // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
  14149. // [outerMin, innerMin, outerMax, innerMax] which will cause the back
  14150. // side of the cylinder to be invisible because it will think the ray
  14151. // is still inside the inner (negative) cylinder after exiting the
  14152. // outer (positive) cylinder.
  14153. // With this special case,
  14154. // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
  14155. // [outerMin, innerMin, innerMax, outerMax] which will work correctly.
  14156. // Note: If initializeIntersections() changes its sorting function
  14157. // from bubble sort to something else, this code may need to change.
  14158. RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);
  14159. setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter
  14160. setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
  14161. setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
  14162. setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit
  14163. #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)
  14164. RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false);
  14165. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);
  14166. #endif
  14167. #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)
  14168. RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax);
  14169. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
  14170. #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)
  14171. RayShapeIntersection wedgeIntersects[2];
  14172. intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax, wedgeIntersects);
  14173. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
  14174. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
  14175. #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
  14176. RayShapeIntersection wedgeIntersects[2];
  14177. intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x, wedgeIntersects);
  14178. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
  14179. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
  14180. #endif
  14181. }
  14182. `;var v6=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections,
  14183. // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection
  14184. // See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
  14185. // intersectFlippedWedge, intersectRegularWedge
  14186. /* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
  14187. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE
  14188. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
  14189. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF
  14190. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF
  14191. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF
  14192. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF
  14193. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF
  14194. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF
  14195. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF
  14196. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF
  14197. #define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE
  14198. #define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX
  14199. #define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN
  14200. #define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX
  14201. #define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN
  14202. */
  14203. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
  14204. uniform vec2 u_ellipsoidRenderLongitudeMinMax;
  14205. #endif
  14206. uniform float u_eccentricitySquared;
  14207. uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
  14208. uniform vec2 u_clipMinMaxHeight; // Values are negative: clipHeight - maxShapeHeight
  14209. RayShapeIntersection intersectZPlane(in Ray ray, in float z) {
  14210. float t = -ray.pos.z / ray.dir.z;
  14211. bool startsOutside = sign(ray.pos.z) == sign(z);
  14212. bool entry = (t >= 0.0) != startsOutside;
  14213. vec4 intersect = vec4(0.0, 0.0, z, t);
  14214. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  14215. if (entry) {
  14216. return RayShapeIntersection(intersect, farSide);
  14217. } else {
  14218. return RayShapeIntersection(-1.0 * farSide, intersect);
  14219. }
  14220. }
  14221. RayShapeIntersection intersectHeight(in Ray ray, in float height, in bool convex)
  14222. {
  14223. // Scale the ray by the ellipsoid axes to make it a unit sphere
  14224. // Note: approximating ellipsoid + height as an ellipsoid
  14225. vec3 radiiCorrection = vec3(1.0) / (u_ellipsoidRadii + height);
  14226. vec3 position = ray.pos * radiiCorrection;
  14227. vec3 direction = ray.dir * radiiCorrection;
  14228. float a = dot(direction, direction); // ~ 1.0 (or maybe 4.0 if ray is scaled)
  14229. float b = dot(direction, position); // roughly inside [-1.0, 1.0] when zoomed in
  14230. float c = dot(position, position) - 1.0; // ~ 0.0 when zoomed in.
  14231. float determinant = b * b - a * c; // ~ b * b when zoomed in
  14232. if (determinant < 0.0) {
  14233. vec4 miss = vec4(normalize(direction), NO_HIT);
  14234. return RayShapeIntersection(miss, miss);
  14235. }
  14236. determinant = sqrt(determinant);
  14237. // Compute larger root using standard formula
  14238. float signB = b < 0.0 ? -1.0 : 1.0;
  14239. // The other root may suffer from subtractive cancellation in the standard formula.
  14240. // Compute it from the first root instead.
  14241. float t1 = (-b - signB * determinant) / a;
  14242. float t2 = c / (a * t1);
  14243. float tmin = min(t1, t2);
  14244. float tmax = max(t1, t2);
  14245. float directionScale = convex ? 1.0 : -1.0;
  14246. vec3 d1 = directionScale * (position + tmin * direction);
  14247. vec3 d2 = directionScale * (position + tmax * direction);
  14248. // Return normals in eye coordinates. Use spherical approximation for the normal.
  14249. vec3 normal1 = normalize(czm_normal * d1);
  14250. vec3 normal2 = normalize(czm_normal * d2);
  14251. return RayShapeIntersection(vec4(normal1, tmin), vec4(normal2, tmax));
  14252. }
  14253. /**
  14254. * Given a circular cone around the z-axis, with apex at the origin,
  14255. * find the parametric distance(s) along a ray where that ray intersects
  14256. * the cone.
  14257. * The cone opening angle is described by the squared cosine of
  14258. * its half-angle (the angle between the Z-axis and the surface)
  14259. */
  14260. vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle)
  14261. {
  14262. vec3 o = ray.pos;
  14263. vec3 d = ray.dir;
  14264. float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle;
  14265. float aSin = d.z * d.z * sinSqrHalfAngle;
  14266. float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle;
  14267. float a = aSin + aCos;
  14268. float bSin = d.z * o.z * sinSqrHalfAngle;
  14269. float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle;
  14270. float b = bSin + bCos;
  14271. float cSin = o.z * o.z * sinSqrHalfAngle;
  14272. float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle;
  14273. float c = cSin + cCos;
  14274. // determinant = b * b - a * c. But bSin * bSin = aSin * cSin.
  14275. // Avoid subtractive cancellation by expanding to eliminate these terms
  14276. float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos;
  14277. if (determinant < 0.0) {
  14278. return vec2(NO_HIT);
  14279. } else if (a == 0.0) {
  14280. // Ray is parallel to cone surface
  14281. return (b == 0.0)
  14282. ? vec2(NO_HIT) // Ray is on cone surface
  14283. : vec2(-0.5 * c / b, NO_HIT);
  14284. }
  14285. determinant = sqrt(determinant);
  14286. // Compute larger root using standard formula
  14287. float signB = b < 0.0 ? -1.0 : 1.0;
  14288. float t1 = (-b - signB * determinant) / a;
  14289. // The other root may suffer from subtractive cancellation in the standard formula.
  14290. // Compute it from the first root instead.
  14291. float t2 = c / (a * t1);
  14292. float tmin = min(t1, t2);
  14293. float tmax = max(t1, t2);
  14294. return vec2(tmin, tmax);
  14295. }
  14296. /**
  14297. * Given a point on a conical surface, find the surface normal at that point.
  14298. */
  14299. vec3 getConeNormal(in vec3 p, in bool convex) {
  14300. // Start with radial component pointing toward z-axis
  14301. vec2 radial = -abs(p.z) * normalize(p.xy);
  14302. // Z component points toward opening of cone
  14303. float zSign = (p.z < 0.0) ? -1.0 : 1.0;
  14304. float z = length(p.xy) * zSign;
  14305. // Flip normal if shape is convex
  14306. float flip = (convex) ? -1.0 : 1.0;
  14307. return normalize(vec3(radial, z) * flip);
  14308. }
  14309. /**
  14310. * Compute the shift between the ellipsoid origin and the apex of a cone of latitude
  14311. */
  14312. float getLatitudeConeShift(in float sinLatitude) {
  14313. // Find prime vertical radius of curvature:
  14314. // the distance along the ellipsoid normal to the intersection with the z-axis
  14315. float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
  14316. float primeVerticalRadius = u_ellipsoidRadii.x * inversesqrt(1.0 - x2);
  14317. // Compute a shift from the origin to the intersection of the cone with the z-axis
  14318. return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
  14319. }
  14320. void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
  14321. // Shift the ray to account for the latitude cone not being centered at the Earth center
  14322. ray.pos.z += getLatitudeConeShift(cosHalfAngle);
  14323. float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
  14324. vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
  14325. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  14326. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  14327. // Initialize output with no intersections
  14328. intersections[0].entry = -1.0 * farSide;
  14329. intersections[0].exit = farSide;
  14330. intersections[1].entry = miss;
  14331. intersections[1].exit = miss;
  14332. if (intersect.x == NO_HIT) {
  14333. return;
  14334. }
  14335. // Find the points of intersection
  14336. float tmin = intersect.x;
  14337. float tmax = intersect.y;
  14338. vec3 p0 = ray.pos + tmin * ray.dir;
  14339. vec3 p1 = ray.pos + tmax * ray.dir;
  14340. vec4 intersect0 = vec4(getConeNormal(p0, true), tmin);
  14341. vec4 intersect1 = vec4(getConeNormal(p1, true), tmax);
  14342. bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
  14343. bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
  14344. if (p0InShadowCone && p1InShadowCone) {
  14345. // no valid intersections
  14346. } else if (p0InShadowCone) {
  14347. intersections[0].exit = intersect1;
  14348. } else if (p1InShadowCone) {
  14349. intersections[0].entry = intersect0;
  14350. } else {
  14351. intersections[0].exit = intersect0;
  14352. intersections[1].entry = intersect1;
  14353. intersections[1].exit = farSide;
  14354. }
  14355. }
  14356. RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {
  14357. // Shift the ray to account for the latitude cone not being centered at the Earth center
  14358. ray.pos.z += getLatitudeConeShift(cosHalfAngle);
  14359. float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
  14360. vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
  14361. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  14362. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  14363. if (intersect.x == NO_HIT) {
  14364. return RayShapeIntersection(miss, miss);
  14365. }
  14366. // Find the points of intersection
  14367. float tmin = intersect.x;
  14368. float tmax = intersect.y;
  14369. vec3 p0 = ray.pos + tmin * ray.dir;
  14370. vec3 p1 = ray.pos + tmax * ray.dir;
  14371. vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin);
  14372. vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax);
  14373. bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
  14374. bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
  14375. if (p0InShadowCone && p1InShadowCone) {
  14376. return RayShapeIntersection(miss, miss);
  14377. } else if (p0InShadowCone) {
  14378. return RayShapeIntersection(intersect1, farSide);
  14379. } else if (p1InShadowCone) {
  14380. return RayShapeIntersection(-1.0 * farSide, intersect0);
  14381. } else {
  14382. return RayShapeIntersection(intersect0, intersect1);
  14383. }
  14384. }
  14385. void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { // Outer ellipsoid
  14386. RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
  14387. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);
  14388. // Exit early if the outer ellipsoid was missed.
  14389. if (outerIntersect.entry.w == NO_HIT) {
  14390. return;
  14391. }
  14392. // Inner ellipsoid
  14393. RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);
  14394. if (innerIntersect.entry.w == NO_HIT) {
  14395. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
  14396. } else {
  14397. // When the ellipsoid is large and thin it's possible for floating point math
  14398. // to cause the ray to intersect the inner ellipsoid before the outer ellipsoid.
  14399. // To prevent this from happening, clamp innerIntersect to outerIntersect and
  14400. // sandwich the inner ellipsoid intersection inside the outer ellipsoid intersection.
  14401. // Without this special case,
  14402. // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
  14403. // [outerMin, innerMin, outerMax, innerMax] which will cause the back
  14404. // side of the ellipsoid to be invisible because it will think the ray
  14405. // is still inside the inner (negative) ellipsoid after exiting the
  14406. // outer (positive) ellipsoid.
  14407. // With this special case,
  14408. // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
  14409. // [outerMin, innerMin, innerMax, outerMax] which will work correctly.
  14410. // Note: If initializeIntersections() changes its sorting function
  14411. // from bubble sort to something else, this code may need to change.
  14412. innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w);
  14413. innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w);
  14414. setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter
  14415. setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
  14416. setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
  14417. setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit
  14418. }
  14419. // Bottom cone
  14420. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
  14421. RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false);
  14422. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
  14423. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
  14424. RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0);
  14425. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
  14426. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
  14427. RayShapeIntersection bottomConeIntersections[2];
  14428. intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections);
  14429. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]);
  14430. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]);
  14431. #endif
  14432. // Top cone
  14433. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
  14434. RayShapeIntersection topConeIntersections[2];
  14435. intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections);
  14436. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]);
  14437. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]);
  14438. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
  14439. RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0);
  14440. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
  14441. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
  14442. RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false);
  14443. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
  14444. #endif
  14445. // Wedge
  14446. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
  14447. RayShapeIntersection wedgeIntersects[2];
  14448. intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects);
  14449. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
  14450. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
  14451. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
  14452. RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax);
  14453. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
  14454. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
  14455. RayShapeIntersection wedgeIntersects[2];
  14456. intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects);
  14457. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
  14458. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
  14459. #endif
  14460. }
  14461. `;var GS=`// Main intersection function for Voxel scenes.
  14462. // See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl
  14463. // for the definition of intersectShape. The appropriate function is selected
  14464. // based on the VoxelPrimitive shape type, and added to the shader in
  14465. // Scene/VoxelRenderResources.js.
  14466. // See also IntersectClippingPlane.glsl and IntersectDepth.glsl.
  14467. // See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,
  14468. // getFirstIntersection, initializeIntersections, nextIntersection.
  14469. /* Intersection defines (set in Scene/VoxelRenderResources.js)
  14470. #define INTERSECTION_COUNT ###
  14471. */
  14472. RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) {
  14473. // Do a ray-shape intersection to find the exact starting and ending points.
  14474. intersectShape(ray, rayEC, ix);
  14475. // Exit early if the positive shape was completely missed or behind the ray.
  14476. RayShapeIntersection intersection = getFirstIntersection(ix);
  14477. if (intersection.entry.w == NO_HIT) {
  14478. // Positive shape was completely missed - so exit early.
  14479. return intersection;
  14480. }
  14481. // Clipping planes
  14482. #if defined(CLIPPING_PLANES)
  14483. intersectClippingPlanes(ray, ix);
  14484. #endif
  14485. // Depth
  14486. intersectDepth(screenCoord, rayEC, ix);
  14487. // Find the first intersection that's in front of the ray
  14488. #if (INTERSECTION_COUNT > 1)
  14489. initializeIntersections(ix);
  14490. for (int i = 0; i < INTERSECTION_COUNT; ++i) {
  14491. intersection = nextIntersection(ix);
  14492. if (intersection.exit.w > 0.0) {
  14493. // Set start to 0.0 when ray is inside the shape.
  14494. intersection.entry.w = max(intersection.entry.w, 0.0);
  14495. break;
  14496. }
  14497. }
  14498. #else
  14499. // Set start to 0.0 when ray is inside the shape.
  14500. intersection.entry.w = max(intersection.entry.w, 0.0);
  14501. #endif
  14502. return intersection;
  14503. }
  14504. `;var S6=`uniform vec3 u_boxLocalToShapeUvScale;
  14505. uniform ivec4 u_cameraTileCoordinates;
  14506. uniform vec3 u_cameraTileUv;
  14507. uniform mat3 u_boxEcToXyz;
  14508. mat3 convertLocalToShapeSpaceDerivative(in vec3 positionLocal) {
  14509. // For BOX, local space = shape space, so the Jacobian is the identity matrix.
  14510. return mat3(1.0);
  14511. }
  14512. vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
  14513. return shapeUv / u_boxLocalToShapeUvScale;
  14514. }
  14515. vec3 convertEcToDeltaTile(in vec3 positionEC) {
  14516. vec3 dPosition = u_boxEcToXyz * positionEC;
  14517. return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w);
  14518. }
  14519. TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
  14520. vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
  14521. vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
  14522. ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
  14523. tileCoordinate = min(max(ivec3(0), tileCoordinate), ivec3((1 << u_cameraTileCoordinates.w) - 1));
  14524. ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
  14525. vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0);
  14526. return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
  14527. }
  14528. `;var w6=`uniform vec3 u_cylinderLocalToShapeUvScale; // x = radius scale, y = angle scale, z = height scale
  14529. uniform float u_cylinderShapeUvAngleRangeOrigin;
  14530. uniform mat3 u_cylinderEcToRadialTangentUp;
  14531. uniform ivec4 u_cameraTileCoordinates;
  14532. uniform vec3 u_cameraTileUv;
  14533. uniform vec3 u_cameraShapePosition; // (radial distance, angle, height) of camera in shape space
  14534. mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
  14535. vec3 radial = normalize(vec3(position.xy, 0.0));
  14536. vec3 z = vec3(0.0, 0.0, 1.0);
  14537. vec3 east = normalize(vec3(-position.y, position.x, 0.0));
  14538. return mat3(radial, east / length(position.xy), z);
  14539. }
  14540. vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
  14541. float radius = shapeUv.x / u_cylinderLocalToShapeUvScale.x;
  14542. float angle = shapeUv.y * czm_twoPi / u_cylinderLocalToShapeUvScale.y;
  14543. float height = shapeUv.z / u_cylinderLocalToShapeUvScale.z;
  14544. return vec3(radius, angle, height);
  14545. }
  14546. /**
  14547. * Computes the change in polar coordinates given a change in position.
  14548. * @param {vec2} dPosition The change in position in Cartesian coordinates.
  14549. * @param {float} cameraRadialDistance The radial distance of the camera from the origin.
  14550. * @return {vec2} The change in polar coordinates (radial distance, angle).
  14551. */
  14552. vec2 computePolarChange(in vec2 dPosition, in float cameraRadialDistance) {
  14553. float dAngle = atan(dPosition.y, cameraRadialDistance + dPosition.x);
  14554. // Find the direction of the radial axis at the output angle, in Cartesian coordinates
  14555. vec2 outputRadialAxis = vec2(cos(dAngle), sin(dAngle));
  14556. float sinHalfAngle = sin(dAngle / 2.0);
  14557. float versine = 2.0 * sinHalfAngle * sinHalfAngle;
  14558. float dRadial = dot(dPosition, outputRadialAxis) - cameraRadialDistance * versine;
  14559. return vec2(dRadial, dAngle);
  14560. }
  14561. vec3 convertEcToDeltaShape(in vec3 positionEC) {
  14562. // 1. Rotate to radial, tangent, and up coordinates
  14563. vec3 rtu = u_cylinderEcToRadialTangentUp * positionEC;
  14564. // 2. Compute change in angular and radial coordinates.
  14565. vec2 dPolar = computePolarChange(rtu.xy, u_cameraShapePosition.x);
  14566. return vec3(dPolar.xy, rtu.z);
  14567. }
  14568. vec3 convertEcToDeltaTile(in vec3 positionEC) {
  14569. vec3 deltaShape = convertEcToDeltaShape(positionEC);
  14570. // Convert to tileset coordinates in [0, 1]
  14571. float dx = u_cylinderLocalToShapeUvScale.x * deltaShape.x;
  14572. float dy = deltaShape.y / czm_twoPi;
  14573. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
  14574. // Wrap to ensure dy is not crossing through the unoccupied angle range, where
  14575. // angle to tile coordinate conversions would be more complicated
  14576. float cameraUvAngle = (u_cameraShapePosition.y + czm_pi) / czm_twoPi;
  14577. float cameraUvAngleShift = fract(cameraUvAngle - u_cylinderShapeUvAngleRangeOrigin);
  14578. float rawOutputUvAngle = cameraUvAngleShift + dy;
  14579. float rotation = floor(rawOutputUvAngle);
  14580. dy -= rotation;
  14581. #endif
  14582. dy *= u_cylinderLocalToShapeUvScale.y;
  14583. float dz = u_cylinderLocalToShapeUvScale.z * deltaShape.z;
  14584. // Convert to tile coordinate changes
  14585. return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
  14586. }
  14587. TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
  14588. vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
  14589. vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
  14590. ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
  14591. int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
  14592. tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
  14593. tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
  14594. #if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
  14595. ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
  14596. if (tileCoordinate.y < 0) {
  14597. tileCoordinate.y += (maxTileCoordinate + 1);
  14598. } else if (tileCoordinate.y > maxTileCoordinate) {
  14599. tileCoordinate.y -= (maxTileCoordinate + 1);
  14600. }
  14601. #else
  14602. tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
  14603. ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
  14604. #endif
  14605. vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
  14606. tileUv.x = clamp(tileUv.x, 0.0, 1.0);
  14607. #if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
  14608. // If there is only one tile spanning 2*PI angle, the coordinate wraps around
  14609. tileUv.y = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.y) : clamp(tileUv.y, 0.0, 1.0);
  14610. #else
  14611. tileUv.y = clamp(tileUv.y, 0.0, 1.0);
  14612. #endif
  14613. tileUv.z = clamp(tileUv.z, 0.0, 1.0);
  14614. return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
  14615. }
  14616. `;var I6=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
  14617. #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE
  14618. #define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
  14619. */
  14620. uniform vec3 u_cameraPositionCartographic; // (longitude, latitude, height) in radians and meters
  14621. uniform vec2 u_ellipsoidCurvatureAtLatitude;
  14622. uniform mat3 u_ellipsoidEcToEastNorthUp;
  14623. uniform vec3 u_ellipsoidRadii;
  14624. uniform vec2 u_evoluteScale; // (radii.x ^ 2 - radii.z ^ 2) * vec2(1.0, -1.0) / radii;
  14625. uniform vec3 u_ellipsoidInverseRadiiSquared;
  14626. #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
  14627. uniform float u_ellipsoidShapeUvLongitudeRangeOrigin;
  14628. #endif
  14629. uniform vec3 u_ellipsoidLocalToShapeUvScale; // x = longitude scale, y = latitude scale, z = height scale
  14630. uniform ivec4 u_cameraTileCoordinates;
  14631. uniform vec3 u_cameraTileUv;
  14632. // robust iterative solution without trig functions
  14633. // https://github.com/0xfaded/ellipse_demo/issues/1
  14634. // https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
  14635. // Extended to return radius of curvature along with the point
  14636. vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {
  14637. vec2 p = abs(pos);
  14638. vec2 inverseRadii = 1.0 / radii;
  14639. // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
  14640. // but store the cos and sin of t in a vec2 for efficiency.
  14641. // Initial guess: t = pi/4
  14642. vec2 tTrigs = vec2(0.7071067811865476);
  14643. // Initial guess of point on ellipsoid
  14644. vec2 v = radii * tTrigs;
  14645. // Center of curvature of the ellipse at v
  14646. vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
  14647. const int iterations = 3;
  14648. for (int i = 0; i < iterations; ++i) {
  14649. // Find the (approximate) intersection of p - evolute with the ellipsoid.
  14650. vec2 q = normalize(p - evolute) * length(v - evolute);
  14651. // Update the estimate of t.
  14652. tTrigs = (q + evolute) * inverseRadii;
  14653. tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
  14654. v = radii * tTrigs;
  14655. evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
  14656. }
  14657. return vec3(v * sign(pos), length(v - evolute));
  14658. }
  14659. mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
  14660. vec3 east = normalize(vec3(-position.y, position.x, 0.0));
  14661. // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z)
  14662. // (assume radii.y == radii.x) and find the nearest point on the ellipse and its normal
  14663. float distanceFromZAxis = length(position.xy);
  14664. vec2 posEllipse = vec2(distanceFromZAxis, position.z);
  14665. vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadii.xz);
  14666. vec2 surfacePoint = surfacePointAndRadius.xy;
  14667. vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquared.xz);
  14668. vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x));
  14669. float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0;
  14670. float height = heightSign * length(posEllipse - surfacePoint);
  14671. vec3 up = normalize(cross(east, north));
  14672. return mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
  14673. }
  14674. vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
  14675. // Convert from [0, 1] to radians [-pi, pi]
  14676. float longitude = shapeUv.x * czm_twoPi;
  14677. #if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
  14678. longitude /= u_ellipsoidLocalToShapeUvScale.x;
  14679. #endif
  14680. // Convert from [0, 1] to radians [-pi/2, pi/2]
  14681. float latitude = shapeUv.y * czm_pi;
  14682. #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
  14683. latitude /= u_ellipsoidLocalToShapeUvScale.y;
  14684. #endif
  14685. float height = shapeUv.z / u_ellipsoidLocalToShapeUvScale.z;
  14686. return vec3(longitude, latitude, height);
  14687. }
  14688. vec3 convertEcToDeltaShape(in vec3 positionEC) {
  14689. vec3 enu = u_ellipsoidEcToEastNorthUp * positionEC;
  14690. // 1. Compute the change in longitude from the camera to the ENU point
  14691. // First project the camera and ENU positions to the equatorial XY plane,
  14692. // positioning the camera on the +x axis, so that enu.x projects along the +y axis
  14693. float cosLatitude = cos(u_cameraPositionCartographic.y);
  14694. float sinLatitude = sin(u_cameraPositionCartographic.y);
  14695. float primeVerticalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.x;
  14696. vec2 cameraXY = vec2((primeVerticalRadius + u_cameraPositionCartographic.z) * cosLatitude, 0.0);
  14697. // Note precision loss in positionXY.x if length(enu) << length(cameraXY)
  14698. vec2 positionXY = cameraXY + vec2(-enu.y * sinLatitude + enu.z * cosLatitude, enu.x);
  14699. float dLongitude = atan(positionXY.y, positionXY.x);
  14700. // 2. Find the longitude component of positionXY, by rotating about Z until the y component is zero.
  14701. // Use the versine to compute the change in x directly from the change in angle:
  14702. // versine(angle) = 2 * sin^2(angle/2)
  14703. float sinHalfLongitude = sin(dLongitude / 2.0);
  14704. float dx = length(positionXY) * 2.0 * sinHalfLongitude * sinHalfLongitude;
  14705. // Rotate longitude component back to ENU North and Up, and remove from enu
  14706. enu += vec3(-enu.x, -dx * sinLatitude, dx * cosLatitude);
  14707. // 3. Compute the change in latitude from the camera to the ENU point.
  14708. // First project the camera and ENU positions to the meridional ZX plane,
  14709. // positioning the camera on the +Z axis, so that enu.y maps to the +X axis.
  14710. float meridionalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.y;
  14711. vec2 cameraZX = vec2(meridionalRadius + u_cameraPositionCartographic.z, 0.0);
  14712. vec2 positionZX = cameraZX + vec2(enu.z, enu.y);
  14713. float dLatitude = atan(positionZX.y, positionZX.x);
  14714. // 4. Compute the change in height above the ellipsoid
  14715. // Find the change in enu.z associated with rotating the point to the latitude of the camera
  14716. float sinHalfLatitude = sin(dLatitude / 2.0);
  14717. float dz = length(positionZX) * 2.0 * sinHalfLatitude * sinHalfLatitude;
  14718. // The remaining change in enu.z is the change in height above the ellipsoid
  14719. float dHeight = enu.z + dz;
  14720. return vec3(dLongitude, dLatitude, dHeight);
  14721. }
  14722. vec3 convertEcToDeltaTile(in vec3 positionEC) {
  14723. vec3 deltaShape = convertEcToDeltaShape(positionEC);
  14724. // Convert to tileset coordinates in [0, 1]
  14725. float dx = deltaShape.x / czm_twoPi;
  14726. #if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
  14727. // Wrap to ensure dx is not crossing through the unoccupied angle range, where
  14728. // angle to tile coordinate conversions would be more complicated
  14729. float cameraUvLongitude = (u_cameraPositionCartographic.x + czm_pi) / czm_twoPi;
  14730. float cameraUvLongitudeShift = fract(cameraUvLongitude - u_ellipsoidShapeUvLongitudeRangeOrigin);
  14731. float rawOutputUvLongitude = cameraUvLongitudeShift + dx;
  14732. float rotation = floor(rawOutputUvLongitude);
  14733. dx -= rotation;
  14734. dx *= u_ellipsoidLocalToShapeUvScale.x;
  14735. #endif
  14736. float dy = deltaShape.y / czm_pi;
  14737. #if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE))
  14738. dy *= u_ellipsoidLocalToShapeUvScale.y;
  14739. #endif
  14740. float dz = u_ellipsoidLocalToShapeUvScale.z * deltaShape.z;
  14741. // Convert to tile coordinate changes
  14742. return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
  14743. }
  14744. TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
  14745. vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
  14746. vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
  14747. ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
  14748. int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
  14749. tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
  14750. tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
  14751. #if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
  14752. ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
  14753. if (tileCoordinate.x < 0) {
  14754. tileCoordinate.x += (maxTileCoordinate + 1);
  14755. } else if (tileCoordinate.x > maxTileCoordinate) {
  14756. tileCoordinate.x -= (maxTileCoordinate + 1);
  14757. }
  14758. #else
  14759. tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
  14760. ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
  14761. #endif
  14762. vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
  14763. #if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
  14764. // If there is only one tile spanning 2*PI angle, the coordinate wraps around
  14765. tileUv.x = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.x) : clamp(tileUv.x, 0.0, 1.0);
  14766. #else
  14767. tileUv.x = clamp(tileUv.x, 0.0, 1.0);
  14768. #endif
  14769. tileUv.y = clamp(tileUv.y, 0.0, 1.0);
  14770. tileUv.z = clamp(tileUv.z, 0.0, 1.0);
  14771. return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
  14772. }
  14773. `;var D6=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js
  14774. #define OCTREE_FLAG_INTERNAL 0
  14775. #define OCTREE_FLAG_LEAF 1
  14776. #define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2
  14777. #define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops
  14778. uniform sampler2D u_octreeInternalNodeTexture;
  14779. uniform vec2 u_octreeInternalNodeTexelSizeUv;
  14780. uniform int u_octreeInternalNodeTilesPerRow;
  14781. #if (SAMPLE_COUNT > 1)
  14782. uniform sampler2D u_octreeLeafNodeTexture;
  14783. uniform vec2 u_octreeLeafNodeTexelSizeUv;
  14784. uniform int u_octreeLeafNodeTilesPerRow;
  14785. #endif
  14786. uniform ivec3 u_dimensions; // does not include padding, and is in the z-up orientation
  14787. uniform ivec3 u_inputDimensions; // includes padding, and is in the orientation of the input data
  14788. #if defined(PADDING)
  14789. uniform ivec3 u_paddingBefore;
  14790. #endif
  14791. struct OctreeNodeData {
  14792. int data;
  14793. int flag;
  14794. };
  14795. struct TraversalData {
  14796. ivec4 octreeCoords;
  14797. int parentOctreeIndex;
  14798. };
  14799. struct TileAndUvCoordinate {
  14800. ivec4 tileCoords;
  14801. vec3 tileUv;
  14802. };
  14803. struct SampleData {
  14804. int megatextureIndex;
  14805. ivec4 tileCoords;
  14806. vec3 tileUv;
  14807. vec3 inputCoordinate;
  14808. #if (SAMPLE_COUNT > 1)
  14809. float weight;
  14810. #endif
  14811. };
  14812. int normU8_toInt(in float value) {
  14813. return int(value * 255.0);
  14814. }
  14815. int normU8x2_toInt(in vec2 value) {
  14816. return int(value.x * 255.0) + 256 * int(value.y * 255.0);
  14817. }
  14818. float normU8x2_toFloat(in vec2 value) {
  14819. return float(normU8x2_toInt(value)) / 65535.0;
  14820. }
  14821. OctreeNodeData getOctreeNodeData(in vec2 octreeUv) {
  14822. vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);
  14823. OctreeNodeData data;
  14824. data.data = normU8x2_toInt(texData.xy);
  14825. data.flag = normU8x2_toInt(texData.zw);
  14826. return data;
  14827. }
  14828. OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {
  14829. int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;
  14830. int octreeCoordX = (parentOctreeIndex % u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;
  14831. int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;
  14832. vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
  14833. return getOctreeNodeData(octreeUv);
  14834. }
  14835. int getOctreeParentIndex(in int octreeIndex) {
  14836. int octreeCoordX = (octreeIndex % u_octreeInternalNodeTilesPerRow) * 9;
  14837. int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;
  14838. vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
  14839. vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);
  14840. int parentOctreeIndex = normU8x2_toInt(parentData.xy);
  14841. return parentOctreeIndex;
  14842. }
  14843. vec3 getTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
  14844. int levelDifference = tileAndUv.tileCoords.w - octreeCoords.w;
  14845. float scalar = exp2(-1.0 * float(levelDifference));
  14846. vec3 originShift = vec3(tileAndUv.tileCoords.xyz - (octreeCoords.xyz << levelDifference)) * scalar;
  14847. return tileAndUv.tileUv * scalar + originShift;
  14848. }
  14849. vec3 getClampedTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
  14850. vec3 tileUv = getTileUv(tileAndUv, octreeCoords);
  14851. return clamp(tileUv, vec3(0.0), vec3(1.0));
  14852. }
  14853. void addSampleCoordinates(in TileAndUvCoordinate tileAndUv, inout SampleData sampleData) {
  14854. vec3 tileUv = getClampedTileUv(tileAndUv, sampleData.tileCoords);
  14855. vec3 inputCoordinate = tileUv * vec3(u_dimensions);
  14856. #if defined(PADDING)
  14857. inputCoordinate += vec3(u_paddingBefore);
  14858. #endif
  14859. #if defined(Y_UP_METADATA_ORDER)
  14860. #if defined(SHAPE_BOX)
  14861. float inputY = inputCoordinate.y;
  14862. inputCoordinate.y = inputCoordinate.z;
  14863. // u_inputDimensions.z is the y-up dimension along the 3D Tiles y-axis.
  14864. inputCoordinate.z = float(u_inputDimensions.z) - inputY;
  14865. #elif defined(SHAPE_CYLINDER)
  14866. float angle = inputCoordinate.y;
  14867. float height = inputCoordinate.z;
  14868. #if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
  14869. // Account for the different 0-angle convention in glTF vs 3DTiles
  14870. if (sampleData.tileCoords.w == 0) {
  14871. float angleCount = float(u_inputDimensions.z);
  14872. angle = mod(angle + angleCount / 2.0, angleCount);
  14873. }
  14874. #endif
  14875. inputCoordinate.y = height;
  14876. inputCoordinate.z = angle;
  14877. #endif
  14878. #endif
  14879. sampleData.tileUv = tileUv;
  14880. sampleData.inputCoordinate = inputCoordinate;
  14881. }
  14882. void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {
  14883. sampleData.megatextureIndex = data.data;
  14884. sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)
  14885. ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
  14886. : octreeCoords;
  14887. }
  14888. #if (SAMPLE_COUNT > 1)
  14889. void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {
  14890. int leafIndex = data.data;
  14891. int leafNodeTexelCount = 2;
  14892. // Adding 0.5 moves to the center of the texel
  14893. float leafCoordXStart = float((leafIndex % u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
  14894. float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;
  14895. // Get an interpolation weight and a flag to determine whether to read the parent texture
  14896. vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);
  14897. vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);
  14898. float lerp = normU8x2_toFloat(leafData0.xy);
  14899. sampleDatas[0].weight = 1.0 - lerp;
  14900. sampleDatas[1].weight = lerp;
  14901. // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT
  14902. sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)
  14903. ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
  14904. : octreeCoords;
  14905. sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)
  14906. ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
  14907. : octreeCoords;
  14908. // Get megatexture indices for both samples
  14909. vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);
  14910. vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);
  14911. sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);
  14912. sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);
  14913. }
  14914. #endif
  14915. OctreeNodeData traverseOctreeDownwards(in ivec4 tileCoordinate, inout TraversalData traversalData) {
  14916. OctreeNodeData childData;
  14917. for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
  14918. // tileCoordinate.xyz is defined at the level of detail tileCoordinate.w.
  14919. // Find the corresponding coordinate at the level traversalData.octreeCoords.w
  14920. int level = traversalData.octreeCoords.w + 1;
  14921. int levelDifference = tileCoordinate.w - level;
  14922. ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
  14923. traversalData.octreeCoords = ivec4(coordinateAtLevel, level);
  14924. ivec3 childCoordinate = coordinateAtLevel & 1;
  14925. childData = getOctreeChildData(traversalData.parentOctreeIndex, childCoordinate);
  14926. if (childData.flag != OCTREE_FLAG_INTERNAL) {
  14927. // leaf tile - stop traversing
  14928. break;
  14929. }
  14930. traversalData.parentOctreeIndex = childData.data;
  14931. }
  14932. return childData;
  14933. }
  14934. /**
  14935. * Transform a given position to an octree tile coordinate and a position within that tile,
  14936. * and find the corresponding megatexture index and texture coordinates
  14937. */
  14938. void traverseOctreeFromBeginning(in TileAndUvCoordinate tileAndUv, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {
  14939. traversalData.octreeCoords = ivec4(0);
  14940. traversalData.parentOctreeIndex = 0;
  14941. OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));
  14942. if (nodeData.flag != OCTREE_FLAG_LEAF) {
  14943. nodeData = traverseOctreeDownwards(tileAndUv.tileCoords, traversalData);
  14944. }
  14945. #if (SAMPLE_COUNT == 1)
  14946. getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
  14947. addSampleCoordinates(tileAndUv, sampleDatas[0]);
  14948. #else
  14949. getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
  14950. addSampleCoordinates(tileAndUv, sampleDatas[0]);
  14951. addSampleCoordinates(tileAndUv, sampleDatas[1]);
  14952. #endif
  14953. }
  14954. bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) {
  14955. int levelDifference = tileCoordinate.w - octreeCoords.w;
  14956. if (levelDifference < 0) {
  14957. return false;
  14958. }
  14959. ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
  14960. return coordinateAtLevel == octreeCoords.xyz;
  14961. }
  14962. void traverseOctreeFromExisting(in TileAndUvCoordinate tileAndUv, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
  14963. ivec4 tileCoords = tileAndUv.tileCoords;
  14964. if (insideTile(tileCoords, traversalData.octreeCoords)) {
  14965. for (int i = 0; i < SAMPLE_COUNT; i++) {
  14966. addSampleCoordinates(tileAndUv, sampleDatas[i]);
  14967. }
  14968. return;
  14969. }
  14970. // Go up tree until we find a parent tile containing tileCoords.
  14971. // Assumes all parents are available all they way up to the root.
  14972. for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
  14973. traversalData.octreeCoords.xyz /= 2;
  14974. traversalData.octreeCoords.w -= 1;
  14975. if (insideTile(tileCoords, traversalData.octreeCoords)) {
  14976. break;
  14977. }
  14978. traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
  14979. }
  14980. // Go down tree
  14981. OctreeNodeData nodeData = traverseOctreeDownwards(tileCoords, traversalData);
  14982. #if (SAMPLE_COUNT == 1)
  14983. getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
  14984. addSampleCoordinates(tileAndUv, sampleDatas[0]);
  14985. #else
  14986. getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
  14987. addSampleCoordinates(tileAndUv, sampleDatas[0]);
  14988. addSampleCoordinates(tileAndUv, sampleDatas[1]);
  14989. #endif
  14990. }
  14991. `;var P6=`// See Octree.glsl for the definitions of SampleData
  14992. /* Megatexture defines (set in Scene/VoxelRenderResources.js)
  14993. #define SAMPLE_COUNT ###
  14994. #define PADDING
  14995. */
  14996. uniform ivec3 u_megatextureTileCounts; // number of tiles in the megatexture, along each axis
  14997. vec3 index1DTo3DTexCoord(int index)
  14998. {
  14999. int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y;
  15000. int iz = index / tilesPerZ;
  15001. int remainder = index - iz * tilesPerZ;
  15002. int iy = remainder / u_megatextureTileCounts.x;
  15003. int ix = remainder - iy * u_megatextureTileCounts.x;
  15004. return vec3(ix, iy, iz) / vec3(u_megatextureTileCounts);
  15005. }
  15006. Properties getPropertiesFromMegatexture(in SampleData sampleData) {
  15007. int tileIndex = sampleData.megatextureIndex;
  15008. vec3 voxelCoord = sampleData.inputCoordinate;
  15009. // UV coordinate of the lower corner of the tile in the megatexture
  15010. vec3 tileUvOffset = index1DTo3DTexCoord(tileIndex);
  15011. // Voxel location
  15012. vec3 tileDimensions = vec3(u_inputDimensions);
  15013. vec3 clampedVoxelCoord = clamp(voxelCoord, vec3(0.5), tileDimensions - vec3(0.5));
  15014. vec3 voxelUv = clampedVoxelCoord / tileDimensions / vec3(u_megatextureTileCounts);
  15015. return getPropertiesFromMegatextureAtUv(tileUvOffset + voxelUv);
  15016. }
  15017. // Convert an array of sample datas to a final weighted properties.
  15018. Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
  15019. #if (SAMPLE_COUNT == 1)
  15020. return getPropertiesFromMegatexture(sampleDatas[0]);
  15021. #else
  15022. // When more than one sample is taken the accumulator needs to start at 0
  15023. Properties properties = clearProperties();
  15024. for (int i = 0; i < SAMPLE_COUNT; ++i) {
  15025. float weight = sampleDatas[i].weight;
  15026. // Avoid reading the megatexture when the weight is 0 as it can be costly.
  15027. if (weight > 0.0) {
  15028. Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
  15029. tempProperties = scaleProperties(tempProperties, weight);
  15030. properties = sumProperties(properties, tempProperties);
  15031. }
  15032. }
  15033. return properties;
  15034. #endif
  15035. }
  15036. `;var jIe={Z_UP:0,Y_UP:1};Object.freeze(jIe);var Rg=jIe;function lDt(e){let t=new i_;this.shaderBuilder=t;let n=e._customShader,i=It(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let m in o)if(o.hasOwnProperty(m)){let A=o[m];t.addUniform(A.type,m,he.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",he.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,a=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=a;let s=e._shape.renderBoundPlanes,c=s?.length??0;this.renderBoundPlanes=s,this.renderBoundPlanesLength=c,t.addVertexLines([y6]),e.provider.metadataOrder===Rg.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,he.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,he.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,he.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,he.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",D6,_6,P6,x6,T6,b6]),a>0&&(t.addDefine("CLIPPING_PLANES",void 0,he.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",a,he.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,he.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,he.FRAGMENT),u==="BOX"?t.addFragmentLines([S6,C6,GS]):u==="CYLINDER"?t.addFragmentLines([w6,BR,E6,GS]):u==="ELLIPSOID"&&t.addFragmentLines([I6,BR,v6,GS]),t.addFragmentLines([A6]);let f=e._shape,d=f.shaderDefines;for(let m in d)if(d.hasOwnProperty(m)){let A=d[m];l(A)&&(A=A===!0?void 0:A,t.addDefine(m,A,he.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;a>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,he.FRAGMENT),a===1?p+=1:r.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,he.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,he.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,he.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,he.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,he.FRAGMENT)}var R6=lDt;var GIe=new z;function uDt(e,t){let n=new R6(e);g6(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r,renderBoundPlanes:a,renderBoundPlanesLength:s}=n;if(r>0){let T="getClippingPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,S=ba.getTextureResolution(o,t,GIe),w=HIe(S);i.addFunction(T,E,he.FRAGMENT),i.addFunctionLines(T,[w])}if(s>0){let T="getBoundPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,S=ly.getTextureResolution(a,t,GIe),w=HIe(S);i.addFunction(T,E,he.FRAGMENT),i.addFunctionLines(T,[w])}let c=i.clone();c.addDefine("PICKING",void 0,he.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,he.FRAGMENT);let f=i.buildShaderProgram(t),d=c.buildShaderProgram(t),p=u.buildShaderProgram(t),g=Ve.fromCache({cull:{enabled:!0,face:Li.BACK},depthTest:{enabled:!1},depthMask:!1,blending:Jt.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),A=e._depthTest,y=new tt({vertexArray:m,primitiveType:Re.TRIANGLES,renderState:g,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ie.VOXELS,executeInClosestFrustum:!0,owner:this,cull:A,occlude:A}),x=tt.shallowClone(y,new tt);x.shaderProgram=d,x.pickOnly=!0;let b=tt.shallowClone(y,new tt);if(b.shaderProgram=p,b.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=y,e._drawCommandPick=x,e._drawCommandPickVoxel=b}function HIe(e){let t=e.x,n=e.y,i=1/t,o=1/n,r=`${i}`;r.indexOf(".")===-1&&(r+=".0");let a=`${o}`;return a.indexOf(".")===-1&&(a+=".0"),`int pixY = planeNumber / ${t};
  15037. int pixX = planeNumber - (pixY * ${t});
  15038. // Sample from center of pixel
  15039. float u = (float(pixX) + 0.5) * ${r};
  15040. float v = (float(pixY) + 0.5) * ${a};
  15041. return texture(packedPlanes, vec2(u, v));`}var O6=uDt;function Og(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(Og.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});Og.fromMetadataArray=function(e){return new Og({metadata:e})};Og.fromGltf=async function(e){let t=new id({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new Og({loader:t})};Og.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=fDt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function fDt(e,t,n){let{className:i,names:o,types:r,componentTypes:a}=n.provider,s=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=s,u=new Array(o.length);for(let f=0;f<e.length;f++){let d=c[o[f]].attribute,p=e.find(y=>y.name===d);if(!l(p))continue;let g=Rt.toComponentDatatype(a[f]),m=ht.getComponentCount(r[f]),A=p.count*m;u[f]=Y.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,A)}return u}Og.prototype.isDestroyed=function(){return!1};Og.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),fe(this)};var HS=Og;function ll(){this._orientedBoundingBox=new $t,this._boundingSphere=new ce,this._boundTransform=new R,this._shapeTransform=new R,this._minBounds=ll.DefaultMinBounds.clone(),this._maxBounds=ll.DefaultMaxBounds.clone(),this._renderMinBounds=ll.DefaultMinBounds.clone(),this._renderMaxBounds=ll.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=ll,n=[new ss(h.negate(h.UNIT_X,new h),e.x),new ss(h.negate(h.UNIT_Y,new h),e.y),new ss(h.negate(h.UNIT_Z,new h),e.z),new ss(h.UNIT_X,-t.x),new ss(h.UNIT_Y,-t.y),new ss(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new ly({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new $,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(ll.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var dDt=new h,hDt=new h,mDt=new $,pDt=new h,gDt=new h;ll.prototype.update=function(e,t,n,i,o){i=i??t.clone(pDt),o=o??n.clone(gDt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let r=h.clamp(t,i,o,this._renderMinBounds),a=h.clamp(n,i,o,this._renderMaxBounds),s=R.getScale(e,hDt);if(r.x>a.x||r.y>a.y||r.z>a.z||(r.x===a.x)+(r.y===a.y)+(r.z===a.z)>=2||s.x===0||s.y===0||s.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=r.x,c.get(1).distance=r.y,c.get(2).distance=r.z,c.get(3).distance=-a.x,c.get(4).distance=-a.y,c.get(5).distance=-a.z,this._shapeTransform=R.clone(e,this._shapeTransform),this._orientedBoundingBox=jte(r,a,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=R.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let A in f)f.hasOwnProperty(A)&&(f[A]=void 0);let d=0;f.BOX_INTERSECTION_INDEX=d,d+=1;let p=t,g=n,m=h.fromElements(Ute(p.x,g.x),Ute(p.y,g.y),Ute(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function Ute(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var _Dt=new R;ll.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=R.inverse(this._shapeTransform,_Dt),i=R.getMatrix3(n,t.boxEcToXyz),o=e.context.uniformState.inverseViewRotation;$.multiply(i,o,t.boxEcToXyz)};ll.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var M6=new h,Vte=new h;ll.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=h.fromElements(D.lerp(r.x,a.x,s*t),D.lerp(r.y,a.y,s*n),D.lerp(r.z,a.z,s*i),M6),u=h.fromElements(D.lerp(r.x,a.x,s*(t+1)),D.lerp(r.y,a.y,s*(n+1)),D.lerp(r.z,a.z,s*(i+1)),Vte);return jte(c,u,this._shapeTransform,o)};var WIe=new h;ll.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,WIe),a=h.multiplyByScalar(r,o,WIe),s=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,M6),o,M6),c=h.add(s,a,Vte),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,s.x),D.lerp(u.y,f.y,s.y),D.lerp(u.z,f.z,s.z),M6),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Vte);return jte(d,p,this._shapeTransform,i)};ll.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));ll.DefaultMaxBounds=Object.freeze(new h(1,1,1));var qIe=new h;function jte(e,t,n,i){let o=ll.DefaultMinBounds,r=ll.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=R.getTranslation(n,i.center),i.halfAxes=R.getMatrix3(n,i.halfAxes);else{let s=R.getScale(n,qIe),c=h.midpoint(e,t,dDt);i.center=R.multiplyByPoint(n,c,i.center),s=h.fromElements(s.x*.5*(t.x-e.x),s.y*.5*(t.y-e.y),s.z*.5*(t.z-e.z),qIe);let u=R.getRotation(n,mDt);i.halfAxes=$.setScale(u,s,i.halfAxes)}return i}var WS=ll;function Rf(){this._orientedBoundingBox=new $t,this._boundingSphere=new ce,this._boundTransform=new R,this._shapeTransform=new R,this._minBounds=Rf.DefaultMinBounds.clone(),this._maxBounds=Rf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Rf,n=[new ss(h.negate(h.UNIT_Z,new h),e.z),new ss(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new ly({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new z,cylinderRenderAngleMinMax:new z,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,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_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Rf.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var ADt=new h,yDt=new h,xDt=new h,bDt=new h,TDt=new h,CDt=new R,EDt=new h,YIe=new z;Rf.prototype.update=function(e,t,n,i,o){i=i??t.clone(yDt),o=o??n.clone(xDt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:a}=Rf,s=a.y-r.y,c=.5*s,u=D.EPSILON10,f=D.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=D.negativePiToPi(t.y),n.y=D.negativePiToPi(n.y),i.y=D.negativePiToPi(i.y),o.y=D.negativePiToPi(o.y);let d=h.maximumByComponent(t,i,bDt),p=h.minimumByComponent(n,o,TDt),g=R.getScale(e,ADt);if(p.x===0||d.x>p.x||d.z>p.z||D.equalsEpsilon(g.x,0,void 0,u)||D.equalsEpsilon(g.y,0,void 0,u)||D.equalsEpsilon(g.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=d.z,m.get(1).distance=-p.z,this._shapeTransform=R.clone(e,this._shapeTransform),this._orientedBoundingBox=Wte(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=R.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let A=n.y<t.y,y=n.y-t.y+A*s,x=p.y<d.y,b=p.y-d.y+x*s,T=b>=c-f&&b<s-f,E=b>f&&b<c-f,S=b<=f,w=T||E||S,P=this._shaderUniforms,O=this._shaderDefines;for(let q in O)O.hasOwnProperty(q)&&(O[q]=void 0);let B=0;O.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=B,B+=1,y<s-f&&(O.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),d.x!==r.x&&(O.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,O.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=B,B+=1),P.cylinderRenderRadiusMinMax=z.fromElements(d.x,p.x,P.cylinderRenderRadiusMinMax),d.x===p.x&&(O.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,_=0,C=1;L!==0&&(_=1/L,C=-t.x*_);let v=n.z-t.z,I=0,M=1;v!==0&&(I=1/v,M=-t.z*I),w&&(O.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,O.CYLINDER_INTERSECTION_INDEX_ANGLE=B,T?(O.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,B+=1):E?(O.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,B+=2):S&&(O.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,B+=2),P.cylinderRenderAngleMinMax=z.fromElements(d.y,p.y,P.cylinderRenderAngleMinMax));let N=(t.y-r.y)/s,j=(n.y-r.y)/s,k=1-y/s,V=(j+.5*k)%1;P.cylinderShapeUvAngleRangeOrigin=V;let F=0,W=1;if(y>f){F=s/y;let q=N-V;W=-F*(q-Math.floor(q))}return P.cylinderLocalToShapeUvScale=h.fromElements(_,F,I,P.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(C,W,M,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=B,!0};var vDt=new $,SDt=new $,wDt=new R;Rf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=R.inverse(this._shapeTransform,CDt),i=R.multiplyByPoint(n,e.camera.positionWC,EDt);t.cameraShapePosition=h.fromElements(z.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=z.normalize(z.fromCartesian3(i,YIe),YIe),r=$.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],vDt),a=e.context.uniformState.inverseView,s=R.multiplyTransformation(n,a,wDt),c=R.getMatrix3(s,SDt);t.cylinderEcToRadialTangentUp=$.multiply(r,c,t.cylinderEcToRadialTangentUp)};Rf.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),o=e.z,{cylinderLocalToShapeUvScale:r,cylinderShapeUvAngleRangeOrigin:a}=this._shaderUniforms,s=this._localToShapeUvTranslate;return n=n*r.x+s.x,i=(i+Math.PI)/(2*Math.PI),i-=a,i=i-Math.floor(i),i=i*r.y+s.y,o=o*r.z+s.z,h.fromElements(n,i,o,t)};var B6=new h,Hte=new h;Rf.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=h.fromElements(D.lerp(r.x,a.x,t*s),D.lerp(r.y,a.y,n*s),D.lerp(r.z,a.z,i*s),B6),u=h.fromElements(D.lerp(r.x,a.x,(t+1)*s),D.lerp(r.y,a.y,(n+1)*s),D.lerp(r.z,a.z,(i+1)*s),Hte);return Wte(c,u,this._shapeTransform,o)};var XIe=new h;Rf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,XIe),a=h.multiplyByScalar(r,o,XIe),s=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,B6),o,B6),c=h.add(s,a,Hte),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,s.x),D.lerp(u.y,f.y,s.y),D.lerp(u.z,f.z,s.z),B6),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Hte);return Wte(d,p,this._shapeTransform,i)};Rf.DefaultMinBounds=Object.freeze(new h(0,-D.PI,-1));Rf.DefaultMaxBounds=Object.freeze(new h(1,+D.PI,1));var IDt=5,DDt=new Array(IDt),PDt=new h,RDt=new $,ODt=new R,MDt=new R,BDt=new R,Gte=new R,LDt=new h,NDt=new h,FDt=new h,QIe=new Array(8);for(let e=0;e<8;e++)QIe[e]=new h;function KIe(e,t,n){return Math.abs(se.dot(e,t))<n}function kDt(e){let t=R.getColumn(e,0,LDt),n=R.getColumn(e,1,NDt),i=R.getColumn(e,2,FDt),o=D.EPSILON4;return KIe(t,n,o)&&KIe(n,i,o)}function zDt(e,t){let n=QIe;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)R.multiplyByPoint(e,n[i],n[i]);return $t.fromPoints(n,t)}var UDt=new h;function Wte(e,t,n,i){let o=e.x,r=t.x,a=e.y,s=t.y<a?t.y+D.TWO_PI:t.y,c=e.z,u=t.z,f=s-a,d=a+f*.5,p=DDt,g=0;p[g++]=a,p[g++]=s,p[g++]=d,f>D.PI&&(p[g++]=d-D.PI_OVER_TWO,p[g++]=d+D.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let N=0;N<g;++N){let j=p[N]-d,k=Math.cos(j),V=Math.sin(j),F=k*o,W=V*o,q=k*r,J=V*r;m=Math.min(m,F,q),A=Math.min(A,W,J),y=Math.max(y,F,q),x=Math.max(x,W,J)}let b=y-m,T=x-A,E=u-c,S=(m+y)*.5,w=(A+x)*.5,P=(c+u)*.5,O=h.fromElements(S,w,P,PDt),B=$.fromRotationZ(d,RDt),L=h.fromElements(b,T,E,UDt),_=R.fromScale(L,BDt),C=R.fromRotation(B,MDt),v=R.fromTranslation(O,ODt),I=R.multiplyTransformation(C,R.multiplyTransformation(v,_,Gte),Gte),M=R.multiplyTransformation(n,I,Gte);return kDt(M)?$t.fromTransformation(M,i):zDt(M,i)}var qS=Rf;function jd(){this._orientedBoundingBox=new $t,this._boundingSphere=new ce,this._boundTransform=new R,this._shapeTransform=new R,this._rectangle=new oe,this._minimumHeight=jd.DefaultMinBounds.z,this._maximumHeight=jd.DefaultMaxBounds.z,this._ellipsoid=new te,this._translation=new h,this._rotation=new $,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new $,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new z,ellipsoidCurvatureAtLatitude:new z,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new z,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new z,clipMinMaxHeight:new z},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_SHAPE_BOUNDS_LONGITUDE: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}Object.defineProperties(jd.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var VDt=new h,jDt=new h,GDt=new h,HDt=new h,WDt=new h,qDt=new h,YDt=new h,XDt=new h,$Ie=new h,JIe=new h,KDt=new oe;jd.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:a}=jd;i=i??r,o=o??a;let s=D.EPSILON10,c=D.EPSILON10,u=D.EPSILON10,f=D.EPSILON3,d=R.getScale(e,XDt),p=h.clone(r,VDt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,a,jDt),m=h.clamp(n,p,a,GDt),A=h.clamp(i,p,a,HDt),y=h.clamp(o,p,a,WDt),x=h.maximumByComponent(g,A,qDt),b=h.minimumByComponent(m,y,YDt),T=h.add(d,h.fromElements(m.z,m.z,m.z,$Ie),$Ie),E=h.add(d,h.fromElements(b.z,b.z,b.z,JIe),JIe);if(x.y>b.y||x.y===a.y||b.y===r.y||x.z>b.z||D.equalsEpsilon(E,h.ZERO,void 0,s))return!1;this._rectangle=oe.fromRadians(g.x,g.y,m.x,m.y),this._translation=R.getTranslation(e,this._translation),this._rotation=R.getRotation(e,this._rotation),this._ellipsoid=te.fromCartesian3(d,this._ellipsoid),this._minimumHeight=g.z,this._maximumHeight=m.z;let S=oe.fromRadians(x.x,x.y,b.x,b.y,KDt);this._orientedBoundingBox=qte(S,x.z,b.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=R.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=R.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let w=a.x-r.x,P=.5*w,O=b.x<x.x,B=b.x-x.x+O*w,L=B<=c,_=B>=P-c&&B<w-c,C=B>c&&B<P-c,v=L||_||C,I=m.x<g.x,M=m.x-g.x+I*w,N=M>P+c&&M<w-c,j=M>=P-c&&M<=P+c,k=M<P-c,V=N||j||k,F=b.y<-f,W=b.y>=-f&&b.y<=+f,q=b.y>+f&&b.y<a.y-u,J=F||W||q,H=x.y>r.y+u&&x.y<-f,Z=x.y>=-f&&x.y<=+f,K=x.y>+f,le=H||Z||K,me=J||le,ae=m.y-g.y,be=m.y<-f,ge=m.y>=-f&&m.y<=+f,we=m.y>+f&&m.y<a.y-u,Ee=be||ge||we,Be=g.y>r.y+u&&g.y<-f,ke=g.y>=-f&&g.y<=+f,Ge=g.y>+f,et=Ee||(Be||ke||Ge),Pe=this._shaderUniforms,Ye=this._shaderDefines;for(let Nn in Ye)Ye.hasOwnProperty(Nn)&&(Ye[Nn]=void 0);Pe.ellipsoidRadii=h.clone(T,Pe.ellipsoidRadii);let{x:ut,z:Ct}=Pe.ellipsoidRadii,en=Ct/ut;Pe.eccentricitySquared=1-en*en,Pe.evoluteScale=z.fromElements((ut*ut-Ct*Ct)/ut,(Ct*Ct-ut*ut)/Ct,Pe.evoluteScale),Pe.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(Pe.ellipsoidRadii,Pe.ellipsoidRadii,Pe.ellipsoidInverseRadiiSquared),Pe.ellipsoidInverseRadiiSquared);let Gt=0;Ye.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Gt,Gt+=1,Ye.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Gt,Gt+=1,Pe.clipMinMaxHeight=z.fromElements(x.z-m.z,b.z-m.z,Pe.clipMinMaxHeight);let yt=m.z-g.z,wt=yt===0?0:1/yt;v&&(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ye.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Gt,_?(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Gt+=1):C?(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Gt+=2):L&&(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Gt+=2),Pe.ellipsoidRenderLongitudeMinMax=z.fromElements(x.x,b.x,Pe.ellipsoidRenderLongitudeMinMax));let xn=0,at=1;if(V){Ye.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let Nn=(g.x-r.x)/w,so=(m.x-r.x)/w,jo=1-M/w,to=(so+.5*jo)%1;if(Pe.ellipsoidShapeUvLongitudeRangeOrigin=to,M>c){xn=w/M;let no=Nn-to;at=-xn*(no-Math.floor(no))}}me&&(le&&(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ye.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Gt,H?(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Gt+=1):Z?(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Gt+=1):K&&(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Gt+=2)),J&&(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ye.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Gt,F?(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Gt+=2):W?(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Gt+=1):q&&(Ye.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Gt+=1)),Pe.ellipsoidRenderLatitudeSinMinMax=z.fromElements(Math.sin(x.y),Math.sin(b.y),Pe.ellipsoidRenderLatitudeSinMinMax));let st=0,Ln=1;return et&&(Ye.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,ae>u&&(st=(a.y-r.y)/ae,Ln=(r.y-g.y)/ae)),Pe.ellipsoidLocalToShapeUvScale=h.fromElements(xn,st,wt,Pe.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(at,Ln,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=Gt,!0};var QDt=new de,$Dt=new h,JDt=new R,ZIe=new $;jd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,QDt);h.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=h.fromRadians(o.longitude,o.latitude,0,n,$Dt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let a=pt.eastNorthUpToFixedFrame(r,n,JDt),s=R.getRotation(a,ZIe),c=e.context.uniformState.viewRotation,u=$.multiply(c,s,ZIe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var aDe=new oe;jd.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),a=t*r,s=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,d=(i+1)*r,p=oe.subsection(this._rectangle,a,c,s,u,aDe),g=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,d);return qte(p,g,m,this._ellipsoid,this._translation,this._rotation,o)};var ZDt=new z,ePt=new z,LR=new z,eDe=new z,tDe=new z,NR=new z;function tPt(e,t,n,i){let o=z.abs(e,ZDt),r=z.fromElements(1/t.x,1/t.y,ePt),a=z.fromElements(Math.SQRT1_2,Math.SQRT1_2,LR),s=z.multiplyComponents(t,a,eDe),c=z.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,tDe);for(let u=0;u<3;++u){let f=z.magnitude(z.subtract(s,c,NR)),d=z.normalize(z.subtract(o,c,NR),NR),p=z.multiplyByScalar(d,f,NR);a=z.multiplyComponents(z.add(p,c,LR),r,LR),a=z.normalize(z.clamp(a,z.ZERO,z.ONE,LR),LR),s=z.multiplyComponents(t,a,eDe),c=z.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,tDe)}return h.fromElements(Math.sign(e.x)*s.x,Math.sign(e.y)*s.y,z.magnitude(z.subtract(s,c,NR)),i)}var nPt=new z,nDe=new z,iPt=new h,iDe=new z;jd.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:o,ellipsoidInverseRadiiSquared:r,ellipsoidShapeUvLongitudeRangeOrigin:a,ellipsoidLocalToShapeUvScale:s}=this._shaderUniforms,c=this._localToShapeUvTranslate,u=Math.hypot(e.x,e.y),f=z.fromElements(u,e.z,nDe),d=tPt(f,z.fromElements(i.x,i.z,nPt),o,iPt),p=z.normalize(z.fromElements(d.x*r.x,d.y*r.z,iDe),iDe),g=Math.atan2(p.y,p.x),m=z.magnitude(f)<z.magnitude(d)?-1:1,A=z.subtract(f,d,nDe),y=m*z.magnitude(A),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:x,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:b}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(x)&&(n-=a,n=n-Math.floor(n),n=n*s.x+c.x),g=(g+Math.PI/2)/Math.PI,l(b)&&(g=g*s.y+c.y),y=1+y*s.z,h.fromElements(n,g,y,t)};var oDe=new h,rDe=new h,oPt=new h;jd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,oDe),a=h.multiplyByScalar(r,o,oDe),s=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,rDe),o,rDe),c=h.add(s,a,oPt),u=oe.subsection(this._rectangle,s.x,s.y,c.x,c.y,aDe),f=D.lerp(this._minimumHeight,this._maximumHeight,s.z),d=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return qte(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function qte(e,t,n,i,o,r,a){return a=$t.fromRectangle(e,t,n,i,a),a.center=h.add(a.center,o,a.center),a.halfAxes=$.multiply(a.halfAxes,r,a.halfAxes),a}jd.DefaultMinBounds=Object.freeze(new h(-D.PI,-D.PI_OVER_TWO,-te.WGS84.minimumRadius));jd.DefaultMaxBounds=Object.freeze(new h(D.PI,D.PI_OVER_TWO,10*te.WGS84.maximumRadius));var YS=jd;var Bu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Bu.getMinBounds=function(e){switch(e){case Bu.BOX:return WS.DefaultMinBounds;case Bu.ELLIPSOID:return YS.DefaultMinBounds;case Bu.CYLINDER:return qS.DefaultMinBounds}};Bu.getMaxBounds=function(e){switch(e){case Bu.BOX:return WS.DefaultMaxBounds;case Bu.ELLIPSOID:return YS.DefaultMaxBounds;case Bu.CYLINDER:return qS.DefaultMaxBounds}};Bu.getShapeConstructor=function(e){switch(e){case Bu.BOX:return WS;case Bu.ELLIPSOID:return YS;case Bu.CYLINDER:return qS}};Object.freeze(Bu);var wc=Bu;function sm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(sm.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}}});sm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new sm({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};sm.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};sm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)sDe(this,t)};sm.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++,sDe(this,i),t};sm.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],cDe(this,0)),this._array[e-1]=void 0,t};sm.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=Yte(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&cDe(this,n)}return this._array[e-1]=void 0,t};sm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};sm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Yte(this,1,2)?1:2]};function L6(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function FR(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Yte(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function sDe(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=FR(e,t,i);for(o!==n&&(L6(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(FR(e,t,r)!==o)break;L6(e,t,r),t=r}}function cDe(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,a=o+1;if(a<n){FR(e,a,r)===i&&(r=a);let s=2*o+1,c=Math.max(Math.min(n-s,4),0);for(let u=0;u<c;u++){let f=s+u;FR(e,f,r)===i&&(r=f)}}if(FR(e,r,t)===i&&(L6(e,r,t),r!==o&&r!==a)){let s=Math.floor((r-1)/2);Yte(e,r,s)===i&&L6(e,r,s)}t=r}}var uy=sm;var Xte=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function kR(e,t){this.spatialNode=e,this.keyframe=t,this.state=Xte.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}kR.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=Xte.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};kR.priorityComparator=function(e,t){return e.priority-t.priority};kR.searchComparator=function(e,t){return e.keyframe-t.keyframe};kR.LoadState=Xte;var Lo=kR;function qp(e,t,n,i,o=134217728,r){let a=rPt(i),s=aPt(n),c=n*Rt.getSizeInBytes(i),u=qp.get3DTextureDimension(t,c,o,r),f=h.divideComponents(u,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=h.clone(f,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=f.x*f.y*f.z,this.texture=new MN({context:e,pixelFormat:s,pixelDatatype:a,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new jt({wrapR:un.CLAMP_TO_EDGE,wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.LINEAR,magnificationFilter:ti.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new sPt(d);for(let d=0;d<this.maximumTileCount;d++){let p=this.nodes[d];p.previousNode=d>0?this.nodes[d-1]:void 0,p.nextNode=d<this.maximumTileCount-1?this.nodes[d+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(qp.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=jt.NEAREST:this.texture.sampler=new jt({wrapR:un.CLAMP_TO_EDGE,wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.LINEAR,magnificationFilter:ti.LINEAR}),this._nearestSampling=e)}}});function rPt(e){if(e===Rt.FLOAT32||e===Rt.FLOAT64)return je.FLOAT;if(e===Rt.UINT8)return je.UNSIGNED_BYTE}function aPt(e){switch(e){case 1:return Xe.RED;case 2:return Xe.RG;case 3:return Xe.RGB;case 4:return Xe.RGBA}}function sPt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}qp.prototype.add=function(e){if(this.isFull())throw new _e("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};qp.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new _e("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--};qp.prototype.isFull=function(){return this.emptyList===void 0};qp.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:o}=Mt;if(h.maximumComponent(e)>o)throw new re("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let r=t*e.x*e.y*e.z,a=Math.floor(n/r);if(a<1)throw new re("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,a):i=a;let s=Object.entries(e).sort((f,d)=>d[1]-f[1]),c=s.map(([f,d])=>Math.floor(o/d));for(let f=0;f<3;f++){let d=lDe(c);if(d<i)break;let p=c.slice();p.splice(f,1);let g=p[0]*p[1],m=d-i,A=Math.floor(m/g);c[f]-=A}lDe(c)>a&&(c[2]=Math.floor(a/(c[0]*c[1])));let u=new h;for(let f=0;f<3;f++){let[d,p]=s[f];u[d]=c[f]*p}return u};function lDe(e){return e.reduce((t,n)=>t*n)}qp.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,o={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},r=n.x*n.y,a=Math.floor(e/r),s=e-a*r,c=Math.floor(s/n.x),u=s-c*n.x,f={source:o,xOffset:u*i.x,yOffset:c*i.y,zOffset:a*i.z};this.texture.copyFrom(f)};qp.prototype.isDestroyed=function(){return!1};qp.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),fe(this)};var N6=qp;function Gd(e,t,n,i,o,r,a){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(a),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new $t,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var cPt=new h;Gd.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,cPt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Gd.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,a=i*2,s=o*2,c=a+1,u=r+1,f=s+1,d=t+1,p=[[d,r,a,s],[d,u,a,s],[d,r,c,s],[d,u,c,s],[d,r,a,f],[d,u,a,f],[d,r,c,f],[d,u,c,f]];this.children=p.map(([g,m,A,y])=>new Gd(g,m,A,y,this,e,this.dimensions))};Gd.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Gd.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var uDe={keyframe:0};function zR(e,t){return uDe.keyframe=e,Ao(t,uDe,Lo.searchComparator)}Gd.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,a,s=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=lPt(i,d),g=d[p],m=o===i||i<g.keyframe?p:Math.min(p+1,d.length-1),A=d[m],y=i-g.keyframe,x=fDe(n-t.level,y);x<s&&(s=x,r=g);let b=A.keyframe-o,T=fDe(n-t.level,b);if(T<c&&(c=T,a=A),y===0&&b===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=a,!l(r)||!l(a))return;let u=r.keyframe,f=a.keyframe;this.renderableKeyframeNodeLerp=u===f?0:D.clamp((e-u)/(f-u),0,1)};function lPt(e,t){let n=zR(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function fDe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Gd.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Gd.prototype.createKeyframeNode=function(e){let t=zR(e,this.keyframeNodes);if(t<0){t=~t;let n=new Lo(this,e);this.keyframeNodes.splice(t,0,n)}};Gd.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=zR(n,this.keyframeNodes);if(i<0)throw new _e("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=zR(n,this.renderableKeyframeNodes);if(o<0)throw new _e("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Gd.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new _e("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let a=t[r];e.megatextureIndex=a.add(n[r])}let i=this.renderableKeyframeNodes,o=zR(e.keyframe,i);if(o>=0)throw new _e("Keyframe already renderable");o=~o,i.splice(o,0,e)};Gd.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 F6=Gd;function fy(e,t,n,i){let{provider:o,dimensions:r,inputDimensions:a}=e,{types:s,componentTypes:c}=o;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(s.length);let u=l(o.maximumTileCount)?o.maximumTileCount:l(o.availableLevels)?(8**o.availableLevels-1)/7:void 0;for(let x=0;x<s.length;x++){let b=s[x],T=ht.getComponentCount(b),E=c[x];this.megatextures[x]=new N6(t,a,T,E,i,u),this.textureMemoryByteLength+=this.megatextures[x].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let d=e._shape;this.rootNode=new F6(0,0,0,0,void 0,d,r),this._priorityQueue=new uy({maximumLength:f,comparator:Lo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,Kte(p,1,n-2,0);let g=9,m=2048,A=Math.floor(m/g),y=Math.ceil(f/A);this.internalNodeTexture=new Dt({context:t,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:m,height:y,sampler:new jt({minificationFilter:Vt.NEAREST,magnificationFilter:ti.NEAREST})}),this.internalNodeTilesPerRow=A,this.internalNodeTexelSizeUv=new z(1/m,1/y),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new z}fy.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function Kte(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,Kte(e,t,o-1,i+1),Kte(e,o+1,n,i+1)}fy.simultaneousRequestCountMaximum=50;fy.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,a=this.megatextures[0].maximumTileCount,s=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=s>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(a/T);this.leafNodeTexture=new Dt({context:r,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new jt({minificationFilter:Vt.NEAREST,magnificationFilter:ti.NEAREST})}),this.leafNodeTexelSizeUv=z.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,s-1),n&&dDe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=zi();dPt(this,e),hPt(this,e);let m=zi();APt(this,d,c);let A=zi(),y=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||y){let x=m-g,b=A-m,T=A-g;_Pt(this,e,x,b,T)}};fy.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};fy.prototype.isDestroyed=function(){return!1};fy.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.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),fe(this)};function dDe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];dDe(e,i)}}function uPt(e,t){if(e._simultaneousRequestCount>=fy.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function a(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Lo.LoadState.PROCESSING:Lo.LoadState.UNAVAILABLE}function s(f){e._simultaneousRequestCount--,t.state=Lo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Lo.LoadState.RECEIVING,u.then(a).catch(s))}function fPt(e){return e/(1+e)}function dPt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),hDe(e.rootNode,is.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,a;for(;i.length>0;)a=i.removeMaximum(),a.highPriorityFrameNumber=n,o[r]=a,r++;e._highPriorityKeyframeNodeCount=r}function hPt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(mPt);let r=e._highPriorityKeyframeNodes,a=e._highPriorityKeyframeNodeCount,s=0,c=0;for(let u=0;u<a;u++){let f=r[u];if(!(f.state===Lo.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Lo.LoadState.UNLOADED&&uPt(e,f),f.state===Lo.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!pPt(d.metadata,e)){f.content=void 0,f.state=Lo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-s,s++;let g=o[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Lo.LoadState.LOADED,o[p]=f,e._primitive.tileLoad.raiseEvent()}}}function mPt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function pPt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:a}=i[o],{x:s,y:c,z:u}=r,f=s*c*u,d=e[o],p=f*a;if(d.length!==p)return!1}return!0}function hDe(e,t,n,i){let{camera:o,context:r,pixelRatio:a,frameNumber:s}=i,{positionWC:c,frustum:u}=o,d=r.drawingBufferHeight/a/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===is.MASK_OUTSIDE)return;e.visitedFrameNumber=s;let p=n._primitive,g=p._shape,m=p.screenSpaceError,A=n._priorityQueue,y=n._keyframeCount,x=D.clamp(Math.floor(n._keyframeLocation),0,y-2),b=x+1;if(y===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==y)for(let P=0;P<y;P++)e.createKeyframeNode(P);let{screenSpaceError:T,keyframeNodes:E}=e,S=fPt(T),w=!1;for(let P=0;P<E.length;P++){let O=E[P];O.priority=10*S+gPt(x,O.keyframe,b,n),O.state!==Lo.LoadState.UNAVAILABLE&&O.state!==Lo.LoadState.FAILED&&O.priority!==-Number.MAX_VALUE&&A.insert(O),O.state===Lo.LoadState.LOADED&&(w=!0)}if(T<m||!w){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let P=0;P<8;P++){let O=e.children[P];hDe(O,t,n,i)}}function gPt(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),a=Math.pow(1-o/r,4),s=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return D.lerp(s,a,.15+.85*a)}function _Pt(e,t,n,i,o){let r=e._keyframeCount,a=e.rootNode,s=Object.keys(Lo.LoadState).length,c=new Array(s),u=new Array(s),f=0;for(let w=0;w<s;w++){let P=new Array(r).fill(0);c[w]=P,u[w]=0}function d(w){let P=w.keyframeNodes;for(let O=0;O<P.length;O++){let B=P[O],L=B.keyframe,_=B.state;c[_][L]+=1,u[_]+=1,f++}if(l(w.children))for(let O=0;O<8;O++){let B=w.children[O];d(B)}}d(a),e._primitive.statistics.numberOfTilesWithContentReady=u[Lo.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Lo.LoadState.RECEIVING],g=u[Lo.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(p===0&&g===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let y=`KEYFRAMES: ${c[Lo.LoadState.LOADED]}`,x=`UNLOADED: ${u[Lo.LoadState.UNLOADED]} | RECEIVING: ${u[Lo.LoadState.RECEIVING]} | PROCESSING: ${u[Lo.LoadState.PROCESSING]} | LOADED: ${u[Lo.LoadState.LOADED]} | FAILED: ${u[Lo.LoadState.FAILED]} | UNAVAILABLE: ${u[Lo.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,b=Math.round(n*100)/100,T=Math.round(i*100)/100,E=Math.round(o*100)/100,S=`LOAD: ${b} | OCT: ${T} | ALL: ${E}`;console.log(`${y} || ${x} || ${S}`)}var k6={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function APt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,a=t>=2,s=0,c=0,u=[],f=[];function d(g,m,A,y,x){let b=!1;if(l(g.children))for(let T=0;T<8;T++){let E=g.children[T];E.computeSurroundingRenderableKeyframeNodes(o),E.isRenderable(r)&&(b=!0)}if(b){u[x]=k6.INTERNAL<<16|m,u[A]=y,s++,y=m,x=y*9+1;for(let T=0;T<8;T++){let E=g.children[T];m=s,A=m*9+0,d(E,m,A,y,x+T)}}else{if(e._primitive.tileVisible.raiseEvent(),a){let T=c*5,E=g.renderableKeyframeNodePrevious,S=g.level-E.spatialNode.level,w=E.spatialNode.parent,P=l(w)?w.renderableKeyframeNodePrevious:E,O=yPt(g,i,n),B=S,L=1,_=E.megatextureIndex,C=P.megatextureIndex;f[T+0]=O,f[T+1]=B,f[T+2]=L,f[T+3]=_,f[T+4]=C,u[x]=k6.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,S=g.level-T.spatialNode.level===0?k6.LEAF:k6.PACKED_LEAF_FROM_PARENT;u[x]=S<<16|T.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&d(p,0,0,0,0),xPt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),a&&bPt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function yPt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,a=((t-i)/(o-i)+n-1)/n;return D.clamp(a,0,1)}function xPt(e,t,n,i){let o=Xe.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),a=Math.max(1,t*Math.min(r,n)),s=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(a*s*o);for(let d=0;d<e.length;d++){let p=e[d],g=d*o;for(let m=0;m<o;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:a,height:s},xOffset:0,yOffset:0};i.copyFrom(f)}function bPt(e,t,n,i){let o=Xe.componentsLength(i.pixelFormat),r=5,a=Math.ceil(e.length/r),s=Math.max(1,t*Math.min(a,n)),c=Math.max(1,Math.ceil(a/n)),u=new Uint8Array(s*c*o);for(let p=0;p<a;p++){let g=e[p*r+0],m=e[p*r+1],A=e[p*r+2],y=e[p*r+3],x=e[p*r+4],b=D.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=b>>>0&255,u[p*8+1]=b>>>8&255,u[p*8+2]=m&255,u[p*8+3]=A&255,u[p*8+4]=y>>>0&255,u[p*8+5]=y>>>8&255,u[p*8+6]=x>>>0&255,u[p*8+7]=x>>>8&255}let d={source:{arrayBufferView:u,width:s,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}var z6=fy;function Yp(e){e=e??G.EMPTY_OBJECT;let{provider:t=Yp.DefaultProvider,modelMatrix:n=R.IDENTITY,customShader:i=MR(t),clock:o,calculateStatistics:r=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new fp,this._calculateStatistics=r;let{shape:a,minBounds:s=wc.getMinBounds(a),maxBounds:c=wc.getMaxBounds(a),dimensions:u,paddingBefore:f=h.ZERO,paddingAfter:d=h.ZERO,metadataOrder:p,availableLevels:g=1}=t;this._dimensions=h.clone(u),this._paddingBefore=h.clone(f),this._paddingAfter=h.clone(d),this._inputDimensions=TPt(u,f,d,p),this._availableLevels=g,this._minBounds=s.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=s.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=R.clone(n),this._modelMatrixOld=R.clone(this._modelMatrix),this._customShader=i??Yp.DefaultCustomShader,this._customShaderCompilationEvent=new ye,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=o,this._transformPositionLocalToWorld=new R,this._transformPositionWorldToLocal=new R,this._transformPlaneLocalToView=new R,this._transformDirectionWorldToLocal=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new ap,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=wc.getShapeConstructor(a);this._shape=new m,pDe(this),this._shapeVisible=gDe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new z,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new z,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new R,transformDirectionViewToLocal:new $,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new se,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new R,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new U},this._shapeDefinesOld={},this._uniformMap={};let A=this._uniforms,y=this._uniformMap;for(let x in A)if(A.hasOwnProperty(x)){let b=`u_${x}`;y[b]=function(){return A[x]}}CPt(this,this._shape),this.tileLoad=new ye,this.tileVisible=new ye,this.tileFailed=new ye,this.tileUnload=new ye,this.loadProgress=new ye,this.allTilesLoaded=new ye,this.initialTilesLoaded=new ye}function TPt(e,t,n,i){let o=h.add(e,t,new h);if(h.add(o,n,o),i===Rg.Y_UP){let r=o.y;o.y=o.z,o.z=r}return o}function CPt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:o}=t;for(let r in i)if(i.hasOwnProperty(r)){let a=`u_${r}`;n[a]=function(){return i[r]}}e._shapeDefinesOld=qe(o,!0)}Object.defineProperties(Yp.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=R.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},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}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=D.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){ba.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];if(l(e))this._customShader=e;else{let o=MR(this._provider);this._customShader=o??Yp.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var EPt=new se,vPt=new se,SPt=new R,wPt=new R,IPt=new h,DPt=new se;Yp.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){NPt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=pDe(this),r=LPt(this,e);if((o||r)&&(this._shapeVisible=gDe(this),qPt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let a=YPt(t.timeIntervalCollection,this._clock),s=this._traversal,c=s._sampleCount;if(s.update(e,a,o,this._disableUpdate),c!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&t1t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),XPt(this,e)&&(this._shaderDirty=!0);let f=s.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=s.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=z.clone(s.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(O6(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=$Pt(p,d,vPt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=se.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let A=i.uniformState.inverseView,y=R.multiplyTransformation(this._transformPositionWorldToLocal,A,n.transformPositionViewToLocal);this._transformPlaneLocalToView=R.transpose(y,this._transformPlaneLocalToView);let x=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,x,n.transformDirectionViewToLocal),n.cameraPositionLocal=R.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let b=OPt(this,n.cameraPositionLocal,DPt);n.cameraTileCoordinates=se.fromElements(Math.floor(b.x),Math.floor(b.y),Math.floor(b.z),b.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(b.x-Math.floor(b.x),b.y-Math.floor(b.y),b.z-Math.floor(b.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,PPt(this),RPt(this,e);let T=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;T.boundingVolume=this._shape.boundingSphere,e.commandList.push(T)};function PPt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function RPt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function OPt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,IPt),o=e._availableLevels,r=2**(o-1);return se.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var MPt=new h,Qte=new h,BPt=new de;function LPt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function NPt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=U.clone(e._pickId.color,i.pickColor);let o=t.keyframeCount??1;e._traversal=new z6(e,n,o),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,WPt(e._traversal,i)}function pDe(e){return UR(e,"_modelMatrix","_modelMatrixOld")+UR(e,"_minBounds","_minBoundsOld")+UR(e,"_maxBounds","_maxBoundsOld")+UR(e,"_minClippingBounds","_minClippingBoundsOld")+UR(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function UR(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var FPt=new h,kPt=new h,zPt=new h,UPt=new h,VPt=new R,jPt=new R;function gDe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,FPt),o=h.clone(e._maxBounds,kPt),r=h.clone(e._minClippingBounds,zPt),a=h.clone(e._maxClippingBounds,UPt),s=R.clone(e._modelMatrix,VPt);if(e.shape===wc.ELLIPSOID)i.z=ho.getHeight(e._minBounds.z,t,n),o.z=ho.getHeight(e._maxBounds.z,t,n),r.z=ho.getHeight(e._minClippingBounds.z,t,n),a.z=ho.getHeight(e._maxClippingBounds.z,t,n);else{let m=h.fromElements(1,1,t,MPt);R.multiplyByScale(s,m,s),R.multiplyByTranslation(s,HPt(e),s)}let c=e._provider,u=c.shapeTransform??R.IDENTITY,f=c.globalTransform??R.IDENTITY,d=R.multiplyTransformation(f,s,jPt);R.multiplyTransformation(d,u,d);let p=e._shape;return p.update(d,i,o,r,a)?(e._transformPositionLocalToWorld=R.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=R.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=R.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var GPt=new h;function HPt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=R.IDENTITY,globalTransform:o=R.IDENTITY}=e._provider,r=R.getTranslation(i,Qte),a=R.multiplyByPoint(e._modelMatrix,r,Qte),s=R.multiplyByPoint(o,a,Qte),u=te.WGS84.cartesianToCartographic(s,BPt),f=0;l(u)&&(f=u.height);let d=ho.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,GPt)}function WPt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=z.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let o=0;o<n.length;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function qPt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=qe(t,!0)),n}function YPt(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=Q.secondsDifference(i.stop,i.start),s=Q.secondsDifference(n,i.start)/r;return o+s}function XPt(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=R.transpose(R.multiplyTransformation(R.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionLocalToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}Yp.prototype.isDestroyed=function(){return!1};Yp.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.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),fe(this)};var mDe=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)),KPt=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),QPt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function $Pt(e,t,n){let i=R.fromRotationTranslation(e.halfAxes,e.center,SPt),o=R.multiply(t,i,wPt),r=+Number.MAX_VALUE,a=-Number.MAX_VALUE,s=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=QPt,d=mDe.length;for(u=0;u<d;u++)R.multiplyByVector(o,mDe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;r=Math.min(r,g),a=Math.max(a,g),s=Math.min(s,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=KPt[u*3+g],A=f[m];if(A.z>=-A.w){let y=p.z+p.w,x=A.z+A.w,b=y/(y-x),T=se.lerp(p,A,b,EPt),E=T.x/T.w,S=T.y/T.w;r=Math.min(r,E),a=Math.max(a,E),s=Math.min(s,S),c=Math.max(c,S)}}}return r=D.clamp(r,-1,1),s=D.clamp(s,-1,1),a=D.clamp(a,-1,1),c=D.clamp(c,-1,1),n=se.fromElements(r,s,a,c,n),n}var $te=3e7,JPt=new h($te,0,0),ZPt=new h(0,$te,0),e1t=new h(0,0,$te);function t1t(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,d){i.add({positions:[c,u],width:d,material:qi.fromType("Color",{color:f})})}function r(c,u,f){let d=c.computeCorners();o(d[0],d[1],u,f),o(d[2],d[3],u,f),o(d[4],d[5],u,f),o(d[6],d[7],u,f),o(d[0],d[2],u,f),o(d[4],d[6],u,f),o(d[1],d[3],u,f),o(d[5],d[7],u,f),o(d[0],d[4],u,f),o(d[2],d[6],u,f),o(d[1],d[5],u,f),o(d[3],d[7],u,f)}function a(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[U.RED,U.LIME,U.BLUE][u%3];if(r(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)a(c.children[m])}r(e._shape.orientedBoundingBox,U.WHITE,5),a(n.rootNode);let s=10;o(h.ZERO,JPt,U.RED,s),o(h.ZERO,ZPt,U.LIME,s),o(h.ZERO,e1t,U.BLUE,s),i.update(t)}Yp.DefaultCustomShader=new Pg({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
  15042. {
  15043. vec3 voxelNormal = fsInput.attributes.normalEC;
  15044. float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC));
  15045. float lighting = 0.5 + 0.5 * diffuse;
  15046. material.diffuse = vec3(lighting);
  15047. material.alpha = 1.0;
  15048. }`});function _De(){this.shape=wc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[ht.SCALAR],this.componentTypes=[Rt.FLOAT32],this.maximumTileCount=1}_De.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new HS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};Yp.DefaultProvider=new _De;var Jb=Yp;function n1t(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let s=(r.properties||{})[i];if(l(s))return s}var U6=n1t;function i1t(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var V6=i1t;function o1t(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let s=o.properties[n];if(l(s))return s}}var j6=o1t;var H6=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??G.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof RN;if(o)this._context=e.contextOptions.createSceneContext(t);else{let u=qe(e.contextOptions);this._context=new $T(t,u)}let r=this._context,a=l(n);a||(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=Hn(),this._jobScheduler=new nG,this._frameState=new Zj(r,new jj(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!a,this._creditContainer=n,this._canvas=t,this._computeEngine=new CM(r),this._ellipsoid=e.ellipsoid??te.default,this._globe=void 0,this._globeTranslucencyState=new eG,this._primitives=new Eu({countReferences:o}),this._groundPrimitives=new Eu({countReferences:o}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new US,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new Kj(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new si({color:new U,stencil:0,owner:this}),this._depthClearCommand=new si({depth:1,owner:this}),this._stencilClearCommand=new si({stencil:0}),this._classificationStencilClearCommand=new si({stencil:0,renderState:Ve.fromCache({stencilMask:Ht.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new YG(this),this._preUpdate=new ye,this._postUpdate=new ye,this._renderError=new ye,this._preRender=new ye,this._postRender=new ye,this._minimumDisableDepthTestDistance=0,this._debugInspector=new c6,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new ye,this.morphComplete=new ye,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=U.clone(U.BLACK),this._mode=ie.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Hi(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 tE,this.fog=new Jj,this.fog.enabled=te.WGS84.equals(this._ellipsoid),te.WGS84.equals(this._ellipsoid)||(vo.DEFAULT_VIEW_RECTANGLE=oe.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new vo(this),this.shadowMap=new ry({context:r,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=U.clone(U.WHITE),this._actualInvertClassificationColor=U.clone(this._invertClassificationColor),this._invertClassification=new yR,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new HG,this._brdfLutGenerator=new Rj,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new o6(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Mu.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=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=pl.requestCompletedEvent.addEventListener(H6(this)),this._removeTaskProcessorListenerCallback=Wn.taskCompletedEvent.addEventListener(H6(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let s=new Je(0,0,r.drawingBufferWidth,r.drawingBufferHeight),c=new vo(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new vo(this),this.preloadFlightCullingVolume=void 0,this._picking=new CG(this),this._defaultView=new NS(this,c,s),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 t_,this._enableEdgeVisibility=!1,CDe(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function r1t(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(H6(e))),n.push(t.terrainProviderChanged.addEventListener(H6(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.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 Mt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Mt.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 Nm.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,r1t(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===ie.SCENE2D?this.morphTo2D(0):e===ie.SCENE3D?this.morphTo3D(0):e===ie.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 vo(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new $j(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,Mt.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}}});_i.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 a1t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function ADe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:a,lightShadowsEnabled:s}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=Tg.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Tg.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=Tg.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Tg.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),s&&t.receiveShadows&&(c.shadows=ry.createReceiveDerivedCommand(a,t,n,o,c.shadows)),t.pass===Ie.TRANSLUCENT&&l(r)&&r.isSupported()&&(s&&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))}_i.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,a=!1,s=i.lastDirtyTime;e.lastDirtyTime!==s&&(e.lastDirtyTime=s,e.dirty=!0,a=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=o&&!u,g=c&&!f,m=(!o||!c)&&!d,A=n.pickingMetadata&&a1t(e,n);if(e.dirty=e.dirty||p||g||m||A,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:y,shadowMaps:x}=i;y&&e.castShadows&&(t.shadows=ry.createCastDerivedCommand(x,e,a,r,t.shadows)),(u||p)&&(t.logDepth=Tg.createLogDepthCommand(e,r,t.logDepth),ADe(this,t.logDepth.command,a)),(d||m)&&ADe(this,e,a)};var s1t=new nm({pass:or.RENDER}),Jte=new nm({pass:or.PRELOAD}),Zte=new nm({pass:or.PRELOAD_FLIGHT}),c1t=new nm({pass:or.REQUEST_RENDER_MODE_DEFER_CHECK}),yDe=new ce,ene;function l1t(e){if(!(e._mode!==ie.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return yDe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,ene=Dj.fromBoundingSphere(yDe,e.camera.positionWC,ene),ene}_i.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function CDe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.clone(n,i.time)}_i.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=l1t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof fn||this.camera.frustum instanceof ga),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=U.clone(this.invertClassificationColor,this._actualInvertClassificationColor),yR.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};_i.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===qt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var G6=new R(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);G6=R.inverseTransformation(G6,G6);function u1t(e,t,n,i){let o=t._frameState,r=o.context,a=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let s=h.clone(a.center);if(o.mode!==ie.SCENE3D){s=R.multiplyByPoint(G6,s,s);let m=o.mapProjection,A=m.unproject(s);s=m.ellipsoid.cartographicToCartesian(A)}let c,u,{radius:f}=a;l(f)?(c=tc.createGeometry(new tc({radii:new h(f,f,f),vertexFormat:hn.FLAT_VERTEX_FORMAT})),u=R.fromTranslation(s)):(c=Uc.createGeometry(Uc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:hn.FLAT_VERTEX_FORMAT})),u=R.fromRotationTranslation(a.halfAxes,s,new R)),t._debugVolume=new Pn({geometryInstances:new Bt({geometry:kn.toWireframe(c),modelMatrix:u,attributes:{color:new Yt(1,0,0,1)}}),appearance:new hn({flat:!0,translucent:!1}),asynchronous:!1});let d=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=Tg.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=d}function Lu(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof si){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&u1t(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let a=o.passes;if(!a.pick&&!a.pickVoxel&&!a.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),a.pick||a.depth){if(a.pick&&!a.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 xDe(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:a,pickingMetadata:s,depth:c}=e.derivedCommands;l(s)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(a)?(e=a.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function EDe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var f1t=new h;function bDe(e,t){let n=h.subtract(e,t,f1t),i=Math.max(0,h.magnitude(n));return i*i}function d1t(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return bDe(o.center,n)-bDe(i.center,n)}function h1t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function m1t(e,t,n,i,o){xg(i,EDe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function p1t(e,t,n,i,o){xg(i,h1t,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function g1t(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],xg(i,EDe,e.camera.positionWC);for(let o=0;o<i.length;++o)Lu(i[o],e,t)}function _1t(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],xg(i,d1t,e.camera.positionWC);for(let o=0;o<i.length;++o)Lu(i[o],e,t)}var A1t=new Gi,y1t=new Ru,x1t=new fn,b1t=new ga;function T1t(e){let{frustum:t}=e;return l(t.fov)?t.clone(A1t):l(t.infiniteProjectionMatrix)?t.clone(y1t):l(t.width)?t.clone(x1t):t.clone(b1t)}function C1t(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,a,s){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,a,s)}}return e._executeOITFunction}return e.frameState.passes.render?m1t:p1t}function E1t(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:a}=i.passes,s=r||a,c;!s&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=C1t(e);o.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,Lu,t,f,c)}function v1t(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let a=n.commands[Ie.TRANSLUCENT];i.executeTranslucentCommands(e,Lu,t,a,o.depthStencilTexture),i.executeClassificationCommands(e,Lu,t,n)}function S1t(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let o=n.commands[Ie.CESIUM_3D_TILE_EDGES],r=n.indices[Ie.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new U(0,0,0,0)).execute(e.context,t);for(let a=0;a<r;++a)Lu(o[a],e,t);t.framebuffer=i}function w1t(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Ie.CESIUM_3D_TILE_EDGES_DIRECT],o=n.indices[Ie.CESIUM_3D_TILE_EDGES_DIRECT];for(let r=0;r<o;++r)Lu(i[r],e,t)}function nne(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let a=T1t(n);a.near=n.frustum.near,a.far=n.frustum.far;let s=o.passes,c=s.pick||s.pickVoxel;c||I1t(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:A,globeTranslucencyFramebuffer:y,sceneFramebuffer:x,frustumCommandsList:b}=e._view,T=b.length,E=e._globeTranslucencyState,S=e._depthClearCommand,w=e._stencilClearCommand,P=e._classificationStencilClearCommand,O=e._depthPlane,B=n.position.z;function L(C,v){r.updatePass(v);let I=C.commands[v],M=C.indices[v];for(let N=0;N<M;++N)Lu(I[N],e,t);return M}function _(C,v){r.updatePass(v);let I=C.commands[v],M=C.indices[v];for(let N=0;N<M;++N)xDe(I[N],e,t)}for(let C=0;C<T;++C){let v=T-C-1,I=b[v];e.mode===ie.SCENE2D?(n.position.z=B-I.near+1,a.far=Math.max(1,I.far-I.near),a.near=1,r.update(o),r.updateFrustum(a)):(a.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,a.far=I.far,r.updateFrustum(a)),S.execute(i,t),i.stencilBuffer&&w.execute(i,t),E.translucent?(r.updatePass(Ie.GLOBE),E.executeGlobeCommands(I,Lu,y,e,t)):L(I,Ie.GLOBE),p&&A.executeCopyDepth(i,t),f||(E.translucent?(r.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(I,Lu,y,e,t)):L(I,Ie.TERRAIN_CLASSIFICATION)),u&&(S.execute(i,t),d&&O.execute(i,t));let M;if(S1t(e,t,I),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let j=e._view.edgeFramebuffer.colorTexture;l(j)?e.context.uniformState.edgeColorTexture=j:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let k=e._view.edgeFramebuffer.idTexture;l(k)?e.context.uniformState.edgeIdTexture=k:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let V=e._view.edgeFramebuffer.depthTexture;l(V)?e.context.uniformState.edgeDepthTexture=V:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(!g||c||f)M=L(I,Ie.CESIUM_3D_TILE),M>0&&(p&&(A.prepareColorTextures(i,u),A.executeUpdateDepth(i,t,A.depthStencilTexture)),f||(M=L(I,Ie.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let j=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,M=L(I,Ie.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),A.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),M=L(I,Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=j,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),M>0&&i.stencilBuffer&&P.execute(i,t),M=L(I,Ie.CESIUM_3D_TILE_CLASSIFICATION)}if(M>0&&i.stencilBuffer&&w.execute(i,t),g1t(e,t,I),L(I,Ie.OPAQUE),w1t(e,t,I),_1t(e,t,I),v!==0&&e.mode!==ie.SCENE2D&&(a.near=I.near,r.updateFrustum(a)),E1t(e,t,I),v1t(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let j=e._picking.getPickDepth(e,v);j.update(i,A.depthStencilTexture),j.executeCopyDepth(i,t)}if(c||!m)continue;let N=t.framebuffer;t.framebuffer=x.getIdFramebuffer(),a.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,a.far=I.far,r.updateFrustum(a),E.translucent?(r.updatePass(Ie.GLOBE),E.executeGlobeCommands(I,xDe,y,e,t)):_(I,Ie.GLOBE),u&&(S.framebuffer=t.framebuffer,S.execute(i,t),S.framebuffer=void 0),u&&d&&O.execute(i,t),_(I,Ie.CESIUM_3D_TILE),_(I,Ie.OPAQUE),_(I,Ie.TRANSLUCENT),t.framebuffer=N}}function I1t(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&Lu(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Lu(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let a;i.useGlobeDepthFramebuffer?a=o.globeDepth.framebuffer:i.usePostProcess?a=o.sceneFramebuffer.framebuffer:a=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,a),t.framebuffer=a}i.isMoonVisible&&i.moonCommand.execute(n,t);let r=e.frameState.panoramaCommandList;for(let a=r.length-1;a>=0;a--){let s=r[a];l(s.shaderProgram)?Lu(r[a],e,t):r.splice(a,1)}}function vDe(e){e.context.uniformState.updatePass(Ie.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 D1t(e,t){e.context.uniformState.updatePass(Ie.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function P1t(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,a=r.length,s=[Ie.GLOBE,Ie.CESIUM_3D_TILE,Ie.OPAQUE,Ie.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||s.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<a;++f)r[f].commandList.push(u);else if(a===1)r[0].commandList.push(u);else{let f=!1;for(let d=a-1;d>=0;--d){let p=r[d].cullingVolume;if(e.isVisible(p,u))r[d].commandList.push(u),f=!0;else if(f)break}}}}function SDe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:a}=r;for(let s=0;s<o.length;++s){let c=o[s];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;P1t(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;a.updateCamera(p),c.updatePass(r,f);for(let m=0;m<g.length;++m){let A=g[m];a.updatePass(A.pass);let y=A.derivedCommands.shadows.castCommands[s];Lu(y,e,d.passState)}}}}var R1t=new h;_i.prototype.updateAndExecuteCommands=function(e,t){H1t(this,e,t),this._environmentState.useWebVR?O1t(this,e,t):this._frameState.mode!==ie.SCENE2D||this._mapMode2D===Mu.ROTATE?dy(!0,this,e):V1t(this,e)};function O1t(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;wDe(e),n.createPotentiallyVisibleSet(e),vDe(e),r||SDe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let s=vo.clone(i,e._cameraVR);s.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(s.right,f*.5,R1t);i.frustum.aspectRatio=a.width/a.height;let p=.5*f*c/u;h.add(s.position,d,i.position),i.frustum.xOffset=p,nne(e,t),a.x=a.width,h.subtract(s.position,d,i.position),i.frustum.xOffset=-p,nne(e,t),vo.clone(s,i)}var M1t=new de(Math.PI,D.PI_OVER_TWO),B1t=new h,L1t=new h,N1t=new R,F1t=new R,k1t=new h,z1t=new h,U1t=new Je;function V1t(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,a=Je.clone(r,U1t);t.viewport=a;let s=M1t,c=B1t;e.mapProjection.project(s,c);let f=h.clone(i.position,L1t),d=R.clone(i.transform,F1t),p=i.frustum.clone();i._setTransform(R.IDENTITY);let g=R.computeViewportTransformation(a,0,1,N1t),m=i.frustum.projectionMatrix,A=i.positionWC.y,y=h.fromElements(D.sign(A)*c.x-A,0,-i.positionWC.x,k1t),x=pt.pointToGLWindowCoordinates(m,g,y,z1t);x.x=Math.floor(x.x);let b=a.x,T=a.width;if(A===0||x.x<=b||x.x>=b+T)dy(!0,e,t);else if(Math.abs(b+T*.5-x.x)<1)a.width=x.x-a.x,i.position.x*=D.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),dy(!0,e,t),a.x=x.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),dy(!1,e,t);else if(x.x>b+T*.5){a.width=x.x-b;let E=i.frustum.right;i.frustum.right=c.x-A,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),dy(!0,e,t),a.x=x.x,a.width=b+T-x.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=E-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),dy(!1,e,t)}else{a.x=x.x,a.width=b+T-x.x;let E=i.frustum.left;i.frustum.left=-c.x-A,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),dy(!0,e,t),a.x=b,a.width=x.x-b,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=E-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),dy(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function dy(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),wDe(t),i.createPotentiallyVisibleSet(t),e&&(vDe(t),o||SDe(t)),nne(t,n)}var TDe=new is;_i.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,a=this.skyAtmosphere,s=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==ie.SCENE2D&&t.camera.frustum instanceof fn||!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(a)){if(l(s))a.setDynamicLighting(k_.fromGlobeFlags(s)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!s.show||s._surface._tilesToRender.length>0;else{let x=r.dynamicLighting;a.setDynamicLighting(x),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=a.update(e,s),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 y=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(y)?y.drawCommand:void 0,n.sunComputeCommand=l(y)?y.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===ie.SCENE2D);(n.useDepthPlane=u&&this.mode===ie.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ie.SCENE2D&&!o;let d=e.mode===ie.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=TDe.planes;for(let y=0;y<5;++y)g[y]=p.planes[y];p=TDe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,A=this._specularEnvironmentCubeMap;l(m)&&A?.url!==m?(A=A&&A.destroy(),this._specularEnvironmentCubeMap=new Nm(m)):!l(m)&&l(A)&&(A.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function j1t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new bg({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 G1t(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,a=r>0&&!n.pick&&!n.pickVoxel&&e.mode===ie.SCENE3D;if(a!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=a),i.lightShadowsEnabled=!1,!!a){for(let s=0;s<r;++s)if(o[s]!==i.shadowMaps[s]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let s=0;s<r;++s){let c=o[s];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function wDe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),j1t(e),G1t(e),e._globe&&e._globe.render(t)}function H1t(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,a=e._view,s=o.passes,c=s.pick||s.pickVoxel;l(a.globeDepth)&&(a.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new s6: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 f=e._clearColorCommand;U.clone(n,f.color),f.execute(i,t);let d=r.useGlobeDepthFramebuffer=l(a.globeDepth);d&&(a.globeDepth.update(i,t,a.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),a.globeDepth.clear(i,t,n));let p=a.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,a.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,A=r.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);r.usePostProcessSelected=!1,A&&(a.sceneFramebuffer.update(i,a.viewport,e._hdr,e.msaaSamples),a.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),A=r.usePostProcess=m.ready,r.usePostProcessSelected=A&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=a.globeDepth.framebuffer:A&&(t.framebuffer=a.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let y=r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&a.edgeFramebuffer.update(i,a.viewport,e._hdr),y){let b;if(o.invertClassificationColor.alpha===1&&d&&(b=a.globeDepth.framebuffer),l(b)||i.depthTexture){if(e._invertClassification.previousFramebuffer=b,e._invertClassification.update(i,e.msaaSamples,a.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let T=e._invertClassification.unclassifiedCommand,E=T.derivedCommands;E.oit=p.createDerivedCommands(T,i,E.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&a.globeTranslucencyFramebuffer.updateAndClear(e._hdr,a.viewport,i,t)}_i.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:a,useGlobeDepthFramebuffer:s,usePostProcess:c,originalFramebuffer:u}=n,f=s?o.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(a&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;s&&!a&&(g=f);let m=this.postProcessStages,A=g.getColorTexture(0),y=p.getColorTexture(0),x=(f??d).getDepthStencilTexture();m.execute(t,A,x,y),m.copy(t,u)}!a&&!c&&s&&(e.framebuffer=u,o.executeCopyColor(t,e))};function W1t(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function q1t(e){if(e.mode===ie.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function IDe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Eu){let o=e.length;for(let r=0;r<o;++r){let a=e.get(r),s=IDe(a,t,n);l(s)&&s>i&&(i=s)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(l(o)&&o>i)return o}return i}_i.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===nt.CLAMP_TO_TERRAIN||t===nt.RELATIVE_TO_TERRAIN,i=t===nt.CLAMP_TO_3D_TILE||t===nt.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let a=IDe(this.primitives,e,this);l(a)&&a>o&&(o=a)}let r=this._globe;if(!i&&l(r)&&r.show){let a=r.getHeight(e);a>o&&(o=a)}if(o>Number.NEGATIVE_INFINITY)return o};var tne=new de;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=g=>{de.clone(e,tne);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(tne.height=m,t(tne))},r=n===nt.CLAMP_TO_TERRAIN||n===nt.RELATIVE_TO_TERRAIN,a=n===nt.CLAMP_TO_3D_TILE||n===nt.RELATIVE_TO_3D_TILE,s;!a&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,o));let c={},u=g=>{if(r||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,o,i);c[g.id]=m};if(!r){let g=this.primitives.length;for(let m=0;m<g;++m){let A=this.primitives.get(m);u(A)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{s=s&&s(),Object.values(c).forEach(g=>g()),c={},f(),d()}};function Y1t(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===ie.SCENE2D||n===ie.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}_i.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=q1t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=Y1t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function X1t(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 ny({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 K1t(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 Q1t(e){e.primitives.postPassesUpdate(e._frameState),pl.update()}var $1t=new U;function J1t(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=s1t;let r=e.backgroundColor??U.BLACK;e._hdr&&(r=U.clone(r,$1t),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 a=e.shadowMap;l(a)&&a.enabled&&(!l(e.light)||e.light instanceof t_?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(a)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let s=o.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Je.clone(s,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,D1t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function Zb(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Z1t(e){return e._picking.updateMostDetailedRayPicks(e)}_i.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=Q.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ie.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(Q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=Q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=D.incrementWrap(t.frameNumber,15e6,1);CDe(this,o,e),t.newFrame=!0}Zb(this,K1t),this.primitives.show&&(Zb(this,Z1t),Zb(this,eRt),Zb(this,tRt),i||Zb(this,nRt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),Zb(this,J1t)),X1t(this,i),Zb(this,Q1t),W1t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(Mt.minimumAliasedLineWidth,Math.min(e,Mt.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof Jb))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),a=255*r[0]+r[1],s=o._traversal.findKeyframeNode(a);if(!l(s))return;let c=255*r[2]+r[3];return l6.fromKeyframeNode(o,a,c,s)};_i.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let a=r.schema,s=U6(a,t,n,i);if(!l(s))return;let c=j6(r,n,i);if(!l(c))return;let u=new V6(t,n,i,s,c);return this._picking.pickMetadata(this,e,u)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function eRt(e){let t=e._frameState;Jte.camera=t.camera,Jte.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Jte)}function tRt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;Zte.camera=e.preloadFlightCamera,Zte.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,Zte)}function nRt(e){e.primitives.updateForPass(e._frameState,c1t)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return io.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function iRt(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()})}_i.prototype.setTerrain=function(e){return iRt(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.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),fe(this)};var W6=_i;var VR=`float interpolateByDistance(vec4 nearFarScalar, float distance)
  15049. {
  15050. float startDistance = nearFarScalar.x;
  15051. float startValue = nearFarScalar.y;
  15052. float endDistance = nearFarScalar.z;
  15053. float endValue = nearFarScalar.w;
  15054. float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
  15055. return mix(startValue, endValue, t);
  15056. }
  15057. void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)
  15058. {
  15059. float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;
  15060. // Adjustment to the atmosphere radius applied based on the camera height.
  15061. float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;
  15062. float distanceAdjustMax = czm_ellipsoidRadii.x;
  15063. float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;
  15064. float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);
  15065. // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit
  15066. // for the position on the ellipsoid.
  15067. float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
  15068. float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;
  15069. // Setup the primary ray: from the camera position to the vertex position.
  15070. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  15071. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  15072. czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
  15073. underTranslucentGlobe = 0.0;
  15074. // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.
  15075. #if defined(GLOBE_TRANSLUCENT)
  15076. // Check for intersection with the inner radius of the atmopshere.
  15077. czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
  15078. if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {
  15079. // Compute position on globe.
  15080. vec3 direction = normalize(positionWC);
  15081. czm_ray ellipsoidRay = czm_ray(positionWC, -direction);
  15082. czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);
  15083. vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);
  15084. // Control the color using the camera angle.
  15085. float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));
  15086. // Control the opacity using the distance from Earth.
  15087. opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));
  15088. vec3 horizonColor = vec3(0.1, 0.2, 0.3);
  15089. vec3 nearColor = vec3(0.0);
  15090. rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);
  15091. // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.
  15092. underTranslucentGlobe = 1.0;
  15093. return;
  15094. }
  15095. #endif
  15096. computeScattering(
  15097. primaryRay,
  15098. length(cameraToPositionWC),
  15099. lightDirection,
  15100. atmosphereInnerRadius,
  15101. rayleighColor,
  15102. mieColor,
  15103. opacity
  15104. );
  15105. // Alter the opacity based on how close the viewer is to the ground.
  15106. // (0.0 = At edge of atmosphere, 1.0 = On ground)
  15107. float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
  15108. float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
  15109. opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);
  15110. // Alter alpha based on time of day (0.0 = night , 1.0 = day)
  15111. float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
  15112. opacity *= pow(nightAlpha, 0.5);
  15113. }
  15114. `;var q6=`in vec3 v_outerPositionWC;
  15115. uniform vec3 u_hsbShift;
  15116. #ifndef PER_FRAGMENT_ATMOSPHERE
  15117. in vec3 v_mieColor;
  15118. in vec3 v_rayleighColor;
  15119. in float v_opacity;
  15120. in float v_translucent;
  15121. #endif
  15122. void main (void)
  15123. {
  15124. float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
  15125. vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum);
  15126. vec3 mieColor;
  15127. vec3 rayleighColor;
  15128. float opacity;
  15129. float translucent;
  15130. #ifdef PER_FRAGMENT_ATMOSPHERE
  15131. computeAtmosphereScattering(
  15132. v_outerPositionWC,
  15133. lightDirection,
  15134. rayleighColor,
  15135. mieColor,
  15136. opacity,
  15137. translucent
  15138. );
  15139. #else
  15140. mieColor = v_mieColor;
  15141. rayleighColor = v_rayleighColor;
  15142. opacity = v_opacity;
  15143. translucent = v_translucent;
  15144. #endif
  15145. vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);
  15146. #ifndef HDR
  15147. color.rgb = czm_pbrNeutralTonemapping(color.rgb);
  15148. color.rgb = czm_inverseGamma(color.rgb);
  15149. #endif
  15150. #ifdef COLOR_CORRECT
  15151. const bool ignoreBlackPixels = true;
  15152. color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);
  15153. #endif
  15154. // For the parts of the sky atmosphere that are not behind a translucent globe,
  15155. // we mix in the default opacity so that the sky atmosphere still appears at distance.
  15156. // This is needed because the opacity in the sky atmosphere is initially adjusted based
  15157. // on the camera height.
  15158. if (translucent == 0.0) {
  15159. color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
  15160. }
  15161. out_FragColor = color;
  15162. }
  15163. `;var Y6=`in vec4 position;
  15164. out vec3 v_outerPositionWC;
  15165. #ifndef PER_FRAGMENT_ATMOSPHERE
  15166. out vec3 v_mieColor;
  15167. out vec3 v_rayleighColor;
  15168. out float v_opacity;
  15169. out float v_translucent;
  15170. #endif
  15171. void main(void)
  15172. {
  15173. vec4 positionWC = czm_model * position;
  15174. float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
  15175. vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum);
  15176. #ifndef PER_FRAGMENT_ATMOSPHERE
  15177. computeAtmosphereScattering(
  15178. positionWC.xyz,
  15179. lightDirection,
  15180. v_rayleighColor,
  15181. v_mieColor,
  15182. v_opacity,
  15183. v_translucent
  15184. );
  15185. #endif
  15186. v_outerPositionWC = positionWC.xyz;
  15187. vec4 positionEC = czm_modelView * position;
  15188. gl_Position = czm_projection * positionEC;
  15189. }
  15190. `;function XS(e){e=e??te.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=R.fromScale(n),this._modelMatrix=new R,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(XS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});XS.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var ine=new R;XS.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ie.SCENE3D&&n!==ie.MORPHING||!e.passes.render)return;let i=R.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,ine),o=R.multiplyTransformation(i,Fi.Y_UP_TO_Z_UP,ine),r=R.multiply(this._scaleMatrix,o,ine);R.clone(r,this._modelMatrix);let a=e.context,s=oRt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=tc.createGeometry(new tc({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Ne.POSITION_ONLY}));f.vertexArray=Fn.fromGeometry({context:a,geometry:p,attributeLocations:kn.createAttributeLocations(p),bufferUsage:Oe.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:Li.FRONT},blending:Jt.ALPHA_BLEND,depthMask:!1})}let d=s|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];s&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new He({defines:p,sources:[Ym,VR,Y6]}),m=new He({defines:p,sources:[Ym,VR,q6]});this._spSkyAtmosphere=Qt.fromCache({context:a,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function oRt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}XS.prototype.isDestroyed=function(){return!1};XS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),fe(this)};var X6=XS;var K6=`uniform samplerCube u_cubeMap;
  15191. in vec3 v_texCoord;
  15192. void main()
  15193. {
  15194. vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));
  15195. out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
  15196. }
  15197. `;var Q6=`in vec3 position;
  15198. out vec3 v_texCoord;
  15199. void main()
  15200. {
  15201. vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
  15202. gl_Position = czm_projection * vec4(p, 1.0);
  15203. v_texCoord = position.xyz;
  15204. }
  15205. `;var $6=`uniform mat3 u_cubeMapPanoramaTransform;
  15206. in vec3 position;
  15207. out vec3 v_texCoord;
  15208. void main()
  15209. {
  15210. vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position));
  15211. gl_Position = czm_projection * vec4(p, 1.0);
  15212. v_texCoord = position.xyz;
  15213. }
  15214. `;function jR(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new tt({modelMatrix:R.clone(R.IDENTITY),owner:this,pass:Ie.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new xt(t)),this._credit=t}Object.defineProperties(jR.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});jR.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r,panoramaCommandList:a}=e;if(!this.show||i!==ie.SCENE3D&&i!==ie.MORPHING||!o.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?BN(r,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new oa({context:r,source:c})),this._addToPanoramaCommandList=!0}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Uc.createGeometry(Uc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Ne.POSITION_ONLY})),u=this._attributeLocations=kn.createAttributeLocations(c);s.vertexArray=Fn.fromGeometry({context:r,geometry:c,attributeLocations:u,bufferUsage:Oe.STATIC_DRAW}),s.renderState=Ve.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:Jt.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(s.shaderProgram)||this._useHdr!==t){let c=new He({defines:[t?"HDR":""],sources:[K6]});s.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:l(this._transform)?$6:Q6,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return s;this._addToPanoramaCommandList&&(a.push(s),this._addToPanoramaCommandList=!1)}};jR.prototype.isDestroyed=function(){return!1};jR.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(),fe(this)};var KS=jR;function eT(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new KS({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(eT.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});eT.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==ie.SCENE3D&&n!==ie.MORPHING)&&i.render)return this._panorama.update(e,t)};eT.prototype.isDestroyed=function(){return!1};eT.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),fe(this)};function QS(e){return Xt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}eT.createEarthSkyBox=function(){return new eT({sources:{positiveX:QS("px"),negativeX:QS("mx"),positiveY:QS("py"),negativeY:QS("my"),positiveZ:QS("pz"),negativeZ:QS("mz")}})};var J6=eT;var Z6=`uniform sampler2D u_texture;
  15215. in vec2 v_textureCoordinates;
  15216. void main()
  15217. {
  15218. vec4 color = texture(u_texture, v_textureCoordinates);
  15219. out_FragColor = czm_gammaCorrect(color);
  15220. }
  15221. `;var eH=`uniform float u_radiusTS;
  15222. in vec2 v_textureCoordinates;
  15223. vec2 rotate(vec2 p, vec2 direction)
  15224. {
  15225. return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);
  15226. }
  15227. vec4 addBurst(vec2 position, vec2 direction, float lengthScalar)
  15228. {
  15229. vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);
  15230. float radius = length(rotatedPosition) * lengthScalar;
  15231. float burst = 1.0 - smoothstep(0.0, 0.55, radius);
  15232. return vec4(burst);
  15233. }
  15234. void main()
  15235. {
  15236. float lengthScalar = 2.0 / sqrt(2.0);
  15237. vec2 position = v_textureCoordinates - vec2(0.5);
  15238. float radius = length(position) * lengthScalar;
  15239. float surface = step(radius, u_radiusTS);
  15240. vec4 color = vec4(vec2(1.0), surface + 0.2, surface);
  15241. float glow = 1.0 - smoothstep(0.0, 0.55, radius);
  15242. color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;
  15243. vec4 burst = vec4(0.0);
  15244. // The following loop has been manually unrolled for speed, to
  15245. // avoid sin() and cos().
  15246. //
  15247. //for (float i = 0.4; i < 3.2; i += 1.047) {
  15248. // vec2 direction = vec2(sin(i), cos(i));
  15249. // burst += 0.4 * addBurst(position, direction, lengthScalar);
  15250. //
  15251. // direction = vec2(sin(i - 0.08), cos(i - 0.08));
  15252. // burst += 0.3 * addBurst(position, direction, lengthScalar);
  15253. //}
  15254. burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4
  15255. burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047
  15256. burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0
  15257. burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08
  15258. burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08
  15259. burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08
  15260. // End of manual loop unrolling.
  15261. color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;
  15262. out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
  15263. }
  15264. `;var tH=`in vec2 direction;
  15265. uniform float u_size;
  15266. out vec2 v_textureCoordinates;
  15267. void main()
  15268. {
  15269. vec4 position;
  15270. if (czm_morphTime == 1.0)
  15271. {
  15272. position = vec4(czm_sunPositionWC, 1.0);
  15273. }
  15274. else
  15275. {
  15276. position = vec4(czm_sunPositionColumbusView.zxy, 1.0);
  15277. }
  15278. vec4 positionEC = czm_view * position;
  15279. vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
  15280. vec2 halfSize = vec2(u_size * 0.5);
  15281. halfSize *= ((direction * 2.0) - 1.0);
  15282. gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);
  15283. v_textureCoordinates = direction;
  15284. }
  15285. `;function HR(){this.show=!0,this._drawCommand=new tt({primitiveType:Re.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(HR.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var rRt=new z,aRt=new z,sRt=new se,GR=new se;HR.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ie.SCENE2D||i===ie.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,a=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||a!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=a,this._glowFactorDirty=!1,this._useHdr=n;let E=Math.max(r,a);E=Math.pow(2,Math.ceil(Math.log(E)/Math.log(2))-2),E=Math.max(1,E);let S=n?o.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._texture=new Dt({context:o,width:E,height:E,pixelFormat:Xe.RGBA,pixelDatatype:S}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let w=this,P={u_radiusTS:function(){return w._radiusTS}};this._commands.computeCommand=new Kl({fragmentShaderSource:eH,outputTexture:this._texture,uniformMap:P,persists:!1,owner:this,postExecute:function(){w._commands.computeCommand=void 0}})}let s=this._drawCommand;if(!l(s.vertexArray)){let E={direction:0},S=new Uint8Array(8);S[0]=0,S[1]=0,S[2]=255,S[3]=0,S[4]=255,S[5]=255,S[6]=0,S[7]=255;let w=Ke.createVertexBuffer({context:o,typedArray:S,usage:Oe.STATIC_DRAW}),P=[{index:E.direction,vertexBuffer:w,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],O=Ke.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Oe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});s.vertexArray=new Fn({context:o,attributes:P,indexBuffer:O}),s.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:tH,fragmentShaderSource:Z6,attributeLocations:E}),s.renderState=Ve.fromCache({blending:Jt.ALPHA_BLEND}),s.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=D.SOLAR_RADIUS+D.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ie.SCENE3D?ce.clone(f,s.boundingVolume):i===ie.COLUMBUS_VIEW&&ce.clone(d,s.boundingVolume);let p=io.computeActualEllipsoidPosition(e,c,GR),g=h.magnitude(h.subtract(p,e.camera.position,GR)),m=o.uniformState.projection,A=sRt;A.x=0,A.y=0,A.z=-g,A.w=1;let y=R.multiplyByVector(m,A,GR),x=io.clipToGLWindowCoordinates(t.viewport,y,rRt);A.x=D.SOLAR_RADIUS;let b=R.multiplyByVector(m,A,GR),T=io.clipToGLWindowCoordinates(t.viewport,b,aRt);return this._size=z.magnitude(z.subtract(T,x,GR)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};HR.prototype.isDestroyed=function(){return!1};HR.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(),fe(this)};var nH=HR;var RDe=Na(PO(),1);function cRt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t});
  15286. vec4 clippingPlanesEdgeColor = vec4(1.0);
  15287. clippingPlanesEdgeColor.rgb = ${n}.rgb;
  15288. float clippingPlanesEdgeWidth = ${n}.a;
  15289. if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth)
  15290. {
  15291. out_FragColor = clippingPlanesEdgeColor;
  15292. }
  15293. `}var iH=cRt;var lRt={modifyFragmentShader:function(t){return t=He.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection;
  15294. void main()
  15295. {
  15296. #ifndef SHADOW_MAP
  15297. if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
  15298. if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
  15299. #endif
  15300. czm_splitter_main();
  15301. }
  15302. `,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},WR=lRt;var tT={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function qR(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=U.clone(U.DARKGRAY),this._highlightColor=U.clone(U.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=tT.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=e.opaquePass??Ie.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=R.clone(R.IDENTITY),this._modelMatrix=R.clone(R.IDENTITY),this.time=0,this.shadows=vn.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=e.splitDirection??Vr.NONE,this._splittingEnabled=!1,this._error=void 0,uRt(this,e)}Object.defineProperties(qR.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return U.clone(this._highlightColor)},set:function(e){this._highlightColor=U.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 uRt(e,t){let n=BE.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=Vm.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let s=n.draco;e._decodingState=tT.NEEDS_DECODE,s.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=U.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let a=n.batchIds;l(n.batchIds)&&(a.name="BATCH_ID",a.semantic="BATCH_ID",a.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var fRt=new h,dRt=new h,hRt=new h,DDe,oH;function mRt(e){if(!l(oH)){DDe=new RDe.default(0),oH=new Array(e);for(let t=0;t<e;++t)oH[t]=DDe.random()}return oH}function pRt(e){let n=e.length/3,i=Math.min(n,20),o=mRt(20),r=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=h.fromElements(r,r,r,fRt),c=h.fromElements(a,a,a,dRt);for(let f=0;f<i;++f){let d=Math.floor(o[f]*n),p=h.unpack(e,d*3,hRt);h.minimumByComponent(s,p,s),h.maximumByComponent(c,p,c)}let u=ce.fromCornerPoints(s,c);return u.radius+=D.EPSILON2,u}function PDe(e,t){let n=Y.fromTypedArray(e);return n===Y.INT||n===Y.UNSIGNED_INT||n===Y.DOUBLE?(_t("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 gRt=new se,_Rt=new se,ARt=new U,ODe=0,rH=1,cne=2,MDe=3,yRt=4,one=new R,xRt=new R;function bRt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,a=i.colors,s=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,A=e._quantizedRange,y=e._octEncodedRange,x=e._isRGB565,b=e._isTranslucent,T=e._hasColors,E=e._hasNormals,S=e._hasBatchIds,w,P,O=[],B={};if(e._styleableShaderAttributes=B,f){let k=yRt;for(let V in u)if(u.hasOwnProperty(V)){let F=u[V],W=PDe(F.typedArray,V);w=F.componentCount,P=Y.fromTypedArray(W);let q=Ke.createVertexBuffer({context:n,typedArray:W,usage:Oe.STATIC_DRAW});e._geometryByteLength+=q.sizeInBytes;let J={index:k,vertexBuffer:q,componentsPerAttribute:w,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0};O.push(J),B[V]={location:k,componentCount:w},++k}}let L=Ke.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Oe.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=Ke.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let C;E&&(C=Ke.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=C.sizeInBytes);let v;S&&(c.typedArray=PDe(c.typedArray,"batchIds"),v=Ke.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Oe.STATIC_DRAW}),e._geometryByteLength+=v.sizeInBytes);let I=[];if(d?P=Y.UNSIGNED_SHORT:p?P=A<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT:P=Y.FLOAT,I.push({index:ODe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ce.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=pRt(r.typedArray)),T)if(x)I.push({index:rH,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=b?4:3;I.push({index:rH,vertexBuffer:_,componentsPerAttribute:k,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}E&&(g?(w=2,P=Y.UNSIGNED_BYTE):m?(w=2,P=y<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT):(w=3,P=Y.FLOAT),I.push({index:cne,vertexBuffer:C,componentsPerAttribute:w,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0})),S&&I.push({index:MDe,vertexBuffer:v,componentsPerAttribute:1,componentDatatype:Y.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(O));let M=new Fn({context:n,attributes:I}),N={depthTest:{enabled:!0}},j={depthTest:{enabled:!0},depthMask:!1,blending:Jt.ALPHA_BLEND};e._opaquePass===Ie.CESIUM_3D_TILE&&(N.stencilTest=Ht.setCesium3DTileBit(),N.stencilMask=Ht.CESIUM_3D_TILE_MASK,j.stencilTest=Ht.setCesium3DTileBit(),j.stencilMask=Ht.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(N),e._translucentRenderState=Ve.fromCache(j),e._drawCommand=new tt({boundingVolume:new ce,cull:e._cull,modelMatrix:new R,primitiveType:Re.POINTS,vertexArray:M,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:b?e._translucentRenderState:e._opaqueRenderState,pass:b?Ie.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function TRt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,a={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let s=gRt;if(s.x=e._attenuation?e.maximumAttenuation:e._pointSize,s.x*=t.pixelRatio,s.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ie.SCENE2D||c instanceof fn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,s.z=e.geometricError*e.geometricErrorScale,s.w=u}return s},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let s=e.clippingPlanes;return e.isClipped?s.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let s=e.clippingPlanes;if(!l(s))return U.TRANSPARENT;let c=U.clone(s.edgeColor,ARt);return c.alpha=s.edgeWidth,c},u_clippingPlanesMatrix:function(){let s=e.clippingPlanes;if(!l(s))return R.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;R.multiply(n.uniformState.view3D,c,one);let u=R.multiply(one,s.modelMatrix,one);return R.inverseTranspose(u,xRt)}};WR.addUniforms(e,a),(i||o||r)&&(a=It(a,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let s=_Rt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,s);h.divideByScalar(c,e._quantizedRange,s)}return s.w=e._octEncodedRange,s}})),l(e._uniformMapLoaded)&&(a=e._uniformMapLoaded(a)),e._drawCommand.uniformMap=a}function rne(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 ane(e,t){e=e.slice(e.indexOf(`
  15303. `));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 sne(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 CRt={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 ERt(e,t,n){let i,o,r,a=t.context,s=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,A=e._hasNormals,y=e._hasBatchIds,x=e._backFaceCulling,b=e._normalShading,T=e._drawCommand.vertexArray,E=e.clippingPlanes,S=e._attenuation,w,P,O,B=g,L=qe(CRt),_={},C=e._styleableShaderAttributes;for(o in C)C.hasOwnProperty(o)&&(r=C[o],L[o]=`czm_3dtiles_property_${r.location}`,_[r.location]=r);if(s){let ae={translucent:!1},be="(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)";w=n.getColorShaderFunction(`getColorFromStyle${be}`,L,ae),P=n.getShowShaderFunction(`getShowFromStyle${be}`,L,ae),O=n.getPointSizeShaderFunction(`getPointSizeFromStyle${be}`,L,ae),l(w)&&ae.translucent&&(B=!0)}e._styleTranslucent=B;let v=l(w),I=l(P),M=l(O),N=e.isClipped,j=[],k=[];v&&(rne(w,j),ane(w,k)),I&&(rne(P,j),ane(P,k)),M&&(rne(O,j),ane(O,k));let V=k.indexOf("COLOR")>=0,F=k.indexOf("NORMAL")>=0;if(F&&!A)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");for(o in C)if(C.hasOwnProperty(o)){r=C[o];let ae=j.indexOf(r.location)>=0,be=sne(T,r.location);be.enabled=ae}let W=m&&(!v||V);if(m){let ae=sne(T,rH);ae.enabled=W}let q=A&&(b||x||F);if(A){let ae=sne(T,cne);ae.enabled=q}let J={a_position:ODe};W&&(J.a_color=rH),q&&(J.a_normal=cne),y&&(J.a_batchId=MDe);let H="",Z=j.length;for(i=0;i<Z;++i){let ae=j[i];r=_[ae];let be=r.componentCount,ge=`czm_3dtiles_property_${ae}`,we;be===1?we="float":we=`vec${be}`,H+=`in ${we} ${ge};
  15304. `,J[ge]=r.location}TRt(e,t);let K=`in vec3 a_position;
  15305. out vec4 v_color;
  15306. uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
  15307. uniform vec4 u_constantColor;
  15308. uniform vec4 u_highlightColor;
  15309. `;K+=`float u_pointSize;
  15310. float tiles3d_tileset_time;
  15311. `,S&&(K+=`float u_geometricError;
  15312. float u_depthMultiplier;
  15313. `),K+=H,W&&(g?K+=`in vec4 a_color;
  15314. `:p?K+=`in float a_color;
  15315. const float SHIFT_RIGHT_11 = 1.0 / 2048.0;
  15316. const float SHIFT_RIGHT_5 = 1.0 / 32.0;
  15317. const float SHIFT_LEFT_11 = 2048.0;
  15318. const float SHIFT_LEFT_5 = 32.0;
  15319. const float NORMALIZE_6 = 1.0 / 64.0;
  15320. const float NORMALIZE_5 = 1.0 / 32.0;
  15321. `:K+=`in vec3 a_color;
  15322. `),q&&(f||d?K+=`in vec2 a_normal;
  15323. `:K+=`in vec3 a_normal;
  15324. `),y&&(K+=`in float a_batchId;
  15325. `),(c||u||d)&&(K+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
  15326. `),v&&(K+=w),I&&(K+=P),M&&(K+=O),K+=`void main()
  15327. {
  15328. u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
  15329. tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
  15330. `,S&&(K+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
  15331. u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
  15332. `),W?g?K+=` vec4 color = a_color;
  15333. `:p?K+=` float compressed = a_color;
  15334. float r = floor(compressed * SHIFT_RIGHT_11);
  15335. compressed -= r * SHIFT_LEFT_11;
  15336. float g = floor(compressed * SHIFT_RIGHT_5);
  15337. compressed -= g * SHIFT_LEFT_5;
  15338. float b = compressed;
  15339. vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5);
  15340. vec4 color = vec4(rgb, 1.0);
  15341. `:K+=` vec4 color = vec4(a_color, 1.0);
  15342. `:K+=` vec4 color = u_constantColor;
  15343. `,c||u?K+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
  15344. `:K+=` vec3 position = a_position;
  15345. `,K+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
  15346. `,q?(f?K+=` vec3 normal = czm_octDecode(a_normal);
  15347. `:d?K+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
  15348. `:K+=` vec3 normal = a_normal;
  15349. `,K+=` vec3 normalEC = czm_normal * normal;
  15350. `):K+=` vec3 normal = vec3(1.0);
  15351. `,v&&(K+=` color = getColorFromStyle(position, position_absolute, color, normal);
  15352. `),I&&(K+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
  15353. `),M?K+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
  15354. `:S?K+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
  15355. float depth = -positionEC.z;
  15356. gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
  15357. `:K+=` gl_PointSize = u_pointSize;
  15358. `,K+=` color = color * u_highlightColor;
  15359. `,q&&b&&(K+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
  15360. diffuseStrength = max(diffuseStrength, 0.4);
  15361. color.xyz *= diffuseStrength * czm_lightColor;
  15362. `),K+=` v_color = color;
  15363. gl_Position = czm_modelViewProjection * vec4(position, 1.0);
  15364. `,q&&x&&(K+=` float visible = step(-normalEC.z, 0.0);
  15365. gl_Position *= visible;
  15366. gl_PointSize *= visible;
  15367. `),I&&(K+=` gl_Position.w *= float(show);
  15368. gl_PointSize *= float(show);
  15369. `),K+=`}
  15370. `;let le=`in vec4 v_color;
  15371. `;N&&(le+=`uniform highp sampler2D u_clippingPlanes;
  15372. uniform mat4 u_clippingPlanesMatrix;
  15373. uniform vec4 u_clippingPlanesEdgeStyle;
  15374. `,le+=`
  15375. `,le+=ES(E,a),le+=`
  15376. `),le+=`void main()
  15377. {
  15378. out_FragColor = czm_gammaCorrect(v_color);
  15379. `,N&&(le+=iH("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),le+=`}
  15380. `,e.splitDirection!==Vr.NONE&&(le=WR.modifyFragmentShader(le)),l(e._vertexShaderLoaded)&&(K=e._vertexShaderLoaded(K)),l(e._fragmentShaderLoaded)&&(le=e._fragmentShaderLoaded(le));let me=e._drawCommand;l(me.shaderProgram)&&me.shaderProgram.destroy(),me.shaderProgram=Qt.fromCache({context:a,vertexShaderSource:K,fragmentShaderSource:le,attributeLocations:J});try{me.shaderProgram._bind()}catch{throw new re("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function vRt(e,t){if(e._decodingState===tT.READY)return!1;if(e._decodingState===tT.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=w_.decodePointCloud(i,t);l(o)&&(e._decodingState=tT.DECODING,o.then(function(r){e._decodingState=tT.READY;let a=l(r.POSITION)?r.POSITION.array:void 0,s=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,d=l(a)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(d){let y=r.POSITION.data.quantization,x=y.range;e._quantizedVolumeScale=h.fromElements(x,x,x),e._quantizedVolumeOffset=h.unpack(y.minValues),e._quantizedRange=(1<<y.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let y in m)if(m.hasOwnProperty(y)){let x=r[y];l(g)||(g={}),g[y]={typedArray:x.array,componentCount:x.data.componentsPerAttribute}}l(a)&&(n.positions={typedArray:a});let A=c??s;l(A)&&(n.colors={typedArray:A}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=tT.FAILED,e._error=r}))}return!0}var SRt=new se,wRt=new h;qR.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(vRt(this,t))return;let i=!1,o=!R.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(bRt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){R.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(R.clone(this._modelMatrix,u),l(this._rtcCenter)&&R.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&R.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ie.SCENE3D){let d=e.mapProjection,p=R.getColumn(u,3,SRt);se.equals(p,se.UNIT_W)||pt.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ce.clone(this._boundingSphere,f),this._cull){let d=f.center;R.multiplyByPoint(u,d,d);let p=R.getScale(u,wRt);f.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&&ERt(this,e,this._style),this._drawCommand.castShadows=vn.castShadows(this.shadows),this._drawCommand.receiveShadows=vn.receiveShadows(this.shadows);let a=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=a?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=a?Ie.TRANSLUCENT:this._opaquePass;let s=e.commandList,c=e.passes;(c.render||c.pick)&&s.push(this._drawCommand)};qR.prototype.isDestroyed=function(){return!1};qR.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),fe(this)};var aH=qR;function iT(e){e=e??G.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this.shadows=e.shadows??vn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new I0(e.shading),this.style=e.style,this.frameFailed=new ye,this.frameChanged=new ye,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new H_,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(iT.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ba.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function IRt(e){return`uniform vec4 czm_pickColor;
  15381. ${e}`}function DRt(e){return function(t){return It(t,{czm_pickColor:function(){return e._pickId.color}})}}function PRt(){return"czm_pickColor"}iT.prototype.makeStyleDirty=function(){this._styleDirty=!0};iT.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var RRt=new Q;function une(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function nT(e,t){return e._intervals.indexOf(t.start)}function ORt(e,t){let n=e._intervals,i=e._clock,o=une(e);if(o===0)return;let r=e._getAverageLoadTime(),a=Q.addSeconds(i.currentTime,r*o,RRt),s=n.indexOf(a),c=nT(e,t);return s===c&&(o>=0?++s:--s),n.get(s)}function MRt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function BRt(e,t,n){let i=une(e),o=nT(e,t),r=nT(e,n);return i>=0?o>=r:o<=r}function LDe(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 LRt(e,t,n){let i=nT(e,t),o=e._frames,r=o[i];if(!l(r)){let a=t.data.transform,s=l(a)?R.fromArray(a):void 0,c=t.data.uri;r={pointCloud:void 0,transform:s,timestamp:zi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,De.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new aH({arrayBuffer:u,cull:!0,fragmentShaderLoaded:IRt,uniformMapLoaded:DRt(e),pickIdLoaded:PRt})}).catch(LDe(e,c))}return r}function NRt(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 FRt(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,a=r.length;if(NDe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=a,t.sequential)){let s=(zi()-t.timestamp)/1e3;NRt(e,s)}}t.touchedFrameNumber=i.frameNumber}var kRt=new R;function zRt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function URt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var VRt=new I0;function NDe(e,t,n,i){let o=e.shading??VRt,r=t.pointCloud,a=t.transform??R.IDENTITY;r.modelMatrix=R.multiplyTransformation(e.modelMatrix,a,kRt),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=zRt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=URt(e);try{r.update(i)}catch(s){LDe(e,t.uri)(s)}t.touchedFrameNumber=i.frameNumber}function lne(e,t,n,i){let o=LRt(e,t,i);FRt(e,o,n,i)}function jRt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function FDe(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 a=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=a.geometryByteLength),l(a)&&a.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function GRt(e,t){let n=nT(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function BDe(e,t,n,i,o){return l(n)?n.ready?!0:(lne(e,t,i,o),n.ready):!1}function HRt(e,t,n,i,o){let r,a,s,c=e._intervals,u=e._frames,f=nT(e,n),d=nT(e,t);if(f>=d){for(r=f;r>=d;--r)if(a=c.get(r),s=u[r],BDe(e,a,s,i,o))return a}else for(r=f;r<=d;++r)if(a=c.get(r),s=u[r],BDe(e,a,s,i,o))return a;return t}function WRt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let a=i[r];l(a)&&l(a.pointCloud)&&(a.pointCloud.clippingPlanesDirty=t,a.pointCloud.styleDirty=n)}}var $S={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};iT.prototype.update=function(e){if(e.mode===ie.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time));let t=Math.max(Q.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 a=this._styleDirty;this._styleDirty=!1,(o||a)&&WRt(this,o,a),$S.timeSinceLoad=t,$S.isClipped=r;let s=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=MRt(this);if(!l(g))return;let m=!1,A=une(this),y=A===0;A!==this._clockMultiplier&&(m=!0,this._clockMultiplier=A),(!l(d)||y)&&(d=g),(!l(p)||m||BRt(this,g,p))&&(p=ORt(this,g)),d=HRt(this,d,g,$S,e);let x=GRt(this,d);l(x)||(lne(this,d,$S,e),x=this._lastRenderedFrame),l(x)&&NDe(this,x,$S,e),l(p)&&lne(this,p,$S,e);let b=this;l(x)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(x)&&x!==this._lastRenderedFrame&&b.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return b.frameChanged.raiseEvent(b),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=x;let T=this._totalMemoryUsageInBytes,E=this.maximumMemoryUsage*1024*1024;T>E&&FDe(this,jRt(e));let w=u.length-f;l(s)&&s.attenuation&&s.eyeDomeLighting&&w>0&&c.update(e,f,s,this.boundingSphere)};iT.prototype.isDestroyed=function(){return!1};iT.prototype.destroy=function(){return FDe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),fe(this)};var YR=iT;function UDe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function qRt(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,a=i-t;a>r&&(e.resize(),e.render(),t=i-a%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 VDe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function jDe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=VDe(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 GDe(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 Vo(e,t){e=Bn(e),t=t??G.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=cn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=cn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let s=document.createElement("div");s.className="cesium-widget-credits";let c=l(t.creditContainer)?Bn(t.creditContainer):n;c.appendChild(s);let u=l(t.creditViewport)?Bn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=s,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,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 ye,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new pp,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),jDe(this);try{let p=t.ellipsoid??te.default,g=new W6({canvas:i,contextOptions:t.contextOptions,creditContainer:s,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly: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,VDe(this),GDe(this);let m=t.globe;l(m)||(m=new _j(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??vn.RECEIVE_ONLY);let A=t.skyBox;!l(A)&&te.WGS84.equals(p)&&(A=J6.createEarthSkyBox()),A!==!1&&(g.skyBox=A,g.sun=new nH,te.WGS84.equals(p)&&(g.moon=new vj));let y=t.skyAtmosphere;!l(y)&&te.WGS84.equals(p)&&(y=new X6(p),y.show=t.globe!==!1&&m.show),y!==!1&&(g.skyAtmosphere=y);let x=t.baseLayer;t.globe!==!1&&x!==!1&&(l(x)||(x=va.fromWorldImagery()),g.imageryLayers.add(x)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new zd(i),l(t.sceneMode)&&(t.sceneMode===ie.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ie.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let b=this;this._onRenderError=function(O,B){b._useDefaultRenderLoop=!1,b._renderLoopRunning=!1,b._showRenderLoopErrors&&b.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,B)},g.renderError.addEventListener(this._onRenderError);let T=t.dataSources,E=!1;l(T)||(T=new bV,E=!0);let S=new g4({scene:g,dataSourceCollection:T}),w=new Yr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=T,this._destroyDataSourceCollection=E,this._dataSourceDisplay=S,this._eventHelper=w,this._canAnimateUpdateCallback=this._updateCanAnimate,w.add(this._clock.onTick,Vo.prototype._onTick,this),w.add(g.morphStart,Vo.prototype._clearTrackedObject,this),w.add(T.dataSourceAdded,Vo.prototype._onDataSourceAdded,this),w.add(T.dataSourceRemoved,Vo.prototype._onDataSourceRemoved,this),w.add(g.postRender,Vo.prototype._postRender,this);let P=T.length;for(let O=0;O<P;O++)this._dataSourceAdded(T,T.get(O));this._dataSourceAdded(void 0,S.defaultDataSource),w.add(T.dataSourceAdded,Vo.prototype._dataSourceAdded,this),w.add(T.dataSourceRemoved,Vo.prototype._dataSourceRemoved,this)}catch(p){throw f&&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(Vo.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&&qRt(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,fne(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ie.COLUMBUS_VIEW||n===ie.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ie.COLUMBUS_VIEW||n===ie.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(R.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,UDe(this.clock,e))}}});Vo.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 a=document.createElement("div");a.className="cesium-widget-errorPanel-header",a.appendChild(document.createTextNode(e)),r.appendChild(a);let s=document.createElement("div");s.className="cesium-widget-errorPanel-scroll",r.appendChild(s);function c(){s.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",s.appendChild(g),f){let m=B0(n);u||(typeof n=="string"&&(n=new Error(n)),t=B0({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e}
  15382. ${t}
  15383. ${m}`);let A=document.createElement("div");A.className="cesium-widget-errorPanel-message-details collapsed";let y=document.createElement("span");y.className="cesium-widget-errorPanel-more-details",y.appendChild(document.createTextNode("See more...")),A.appendChild(y),A.onclick=function(x){A.removeChild(y),A.appendChild(document.createTextNode(m)),A.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",A.onclick=void 0},s.appendChild(A)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(d);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)},d.appendChild(p),i.appendChild(o)};Vo.prototype.isDestroyed=function(){return!1};Vo.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()),fe(this)};Vo.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,jDe(this),GDe(this),this._scene.requestRender())};Vo.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Vo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Vo.prototype._onEntityCollectionChanged,this)};Vo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Vo.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Vo.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var YRt=new ce;Vo.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,!1,i.boundingSphere??YRt)===Tt.DONE&&i.update(t)}};Vo.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)}};Vo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Vo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&UDe(this.clock,e)};Vo.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Vo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Vo.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}};Vo.prototype.zoomTo=function(e,t){return HDe(this,e,{offset:t},!1)};Vo.prototype.flyTo=function(e,t){return HDe(this,e,t,!0)};function HDe(e,t,n,i){fne(e);let o=new Promise(r=>{e._completeZoom=function(a){r(a)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof va){let a;l(r.imageryProvider)?a=Promise.resolve(r.getImageryRectangle()):a=new Promise(s=>{let c=r.readyEvent.addEventListener(()=>{c(),s(r.getImageryRectangle())})}),a.then(function(s){return TS(s,e.scene)}).then(function(s){e._zoomPromise===o&&(e._zoomTarget=s)});return}if(r instanceof wa||r instanceof YR||r instanceof Jb||r instanceof us){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let a=r.loadingEvent.addEventListener(function(){a(),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 XR(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function fne(e){let t=e._zoomPromise;l(t)&&(XR(e),e._completeZoom(!1))}Vo.prototype._postRender=function(){XRt(this),KRt(this)};var kDe=new ce;function XRt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ie.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function a(f){l(o.offset)||(o.offset=new Hh(0,-.5,f.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(f,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(R.IDENTITY),e._completeZoom(!0)),XR(e)}if(t instanceof YR){if(l(t.boundingSphere)){a(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){a(d.boundingSphere),f()});return}if(t instanceof wa||t instanceof Jb){a(t.boundingSphere);return}if(t instanceof us){a(t.boundingVolume);return}if(t instanceof de){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)),XR(e);return}let s=t,c=[];for(let f=0,d=s.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(s[f],!1,kDe);if(p===Tt.PENDING)return;p!==Tt.FAILED&&c.push(ce.clone(kDe))}if(c.length===0){fne(e);return}e.trackedEntity=void 0;let u=ce.fromBoundingSpheres(c);e._zoomIsFlight?(XR(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(R.IDENTITY),XR(e),e._completeZoom(!0))}var zDe=new ce;function KRt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,zDe);if(r===Tt.PENDING)return;let a=o.mode;(a===ie.COLUMBUS_VIEW||a===ie.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(a===ie.COLUMBUS_VIEW||a===ie.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let s=r!==Tt.FAILED?zDe:void 0;e._entityView=new y4(t,o,o.ellipsoid),e._entityView.update(n,s),e._needTrackedEntityUpdate=!1}var sH=Vo;var cH=`uniform sampler2D u_noiseTexture;
  15384. uniform vec3 u_noiseTextureDimensions;
  15385. uniform float u_noiseDetail;
  15386. in vec2 v_offset;
  15387. in vec3 v_maximumSize;
  15388. in vec4 v_color;
  15389. in float v_slice;
  15390. in float v_brightness;
  15391. float wrap(float value, float rangeLength) {
  15392. if(value < 0.0) {
  15393. float absValue = abs(value);
  15394. float modValue = mod(absValue, rangeLength);
  15395. return mod(rangeLength - modValue, rangeLength);
  15396. }
  15397. return mod(value, rangeLength);
  15398. }
  15399. vec3 wrapVec(vec3 value, float rangeLength) {
  15400. return vec3(wrap(value.x, rangeLength),
  15401. wrap(value.y, rangeLength),
  15402. wrap(value.z, rangeLength));
  15403. }
  15404. vec2 voxelToUV(vec3 voxelIndex) {
  15405. float textureSliceWidth = u_noiseTextureDimensions.x;
  15406. float noiseTextureRows = u_noiseTextureDimensions.y;
  15407. float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
  15408. float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;
  15409. vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,
  15410. inverseNoiseTextureRows / textureSliceWidth);
  15411. vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);
  15412. float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);
  15413. float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);
  15414. float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;
  15415. float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;
  15416. return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;
  15417. }
  15418. // Interpolate a voxel with its neighbor (along the positive X-axis)
  15419. vec4 lerpSamplesX(vec3 voxelIndex, float x) {
  15420. vec2 uv0 = voxelToUV(voxelIndex);
  15421. vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));
  15422. vec4 sample0 = texture(u_noiseTexture, uv0);
  15423. vec4 sample1 = texture(u_noiseTexture, uv1);
  15424. return mix(sample0, sample1, x);
  15425. }
  15426. vec4 sampleNoiseTexture(vec3 position) {
  15427. float textureSliceWidth = u_noiseTextureDimensions.x;
  15428. vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);
  15429. vec3 lerpValue = fract(recenteredPos);
  15430. vec3 voxelIndex = floor(recenteredPos);
  15431. vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);
  15432. vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);
  15433. vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);
  15434. vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);
  15435. vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);
  15436. vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);
  15437. return mix(yLerp0, yLerp1, lerpValue.z);
  15438. }
  15439. // Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).
  15440. bool intersectSphere(vec3 origin, vec3 dir, float slice,
  15441. out vec3 point, out vec3 normal) {
  15442. float A = dot(dir, dir);
  15443. float B = dot(origin, dir);
  15444. float C = dot(origin, origin) - 0.25;
  15445. float discriminant = (B * B) - (A * C);
  15446. if(discriminant < 0.0) {
  15447. return false;
  15448. }
  15449. float root = sqrt(discriminant);
  15450. float t = (-B - root) / A;
  15451. if(t < 0.0) {
  15452. t = (-B + root) / A;
  15453. }
  15454. point = origin + t * dir;
  15455. if(slice >= 0.0) {
  15456. point.z = (slice / 2.0) - 0.5;
  15457. if(length(point) > 0.5) {
  15458. return false;
  15459. }
  15460. }
  15461. normal = normalize(point);
  15462. point -= czm_epsilon2 * normal;
  15463. return true;
  15464. }
  15465. // Transforms the ray origin and direction into unit sphere space,
  15466. // then transforms the result back into the ellipsoid's space.
  15467. bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,
  15468. out vec3 point, out vec3 normal) {
  15469. if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {
  15470. return false;
  15471. }
  15472. vec3 o = (origin - center) / scale;
  15473. vec3 d = dir / scale;
  15474. vec3 p, n;
  15475. bool intersected = intersectSphere(o, d, slice, p, n);
  15476. if(intersected) {
  15477. point = (p * scale) + center;
  15478. normal = n;
  15479. }
  15480. return intersected;
  15481. }
  15482. // Assume that if phase shift is being called for octave i,
  15483. // the frequency is of i - 1. This saves us from doing extra
  15484. // division / multiplication operations.
  15485. vec2 phaseShift2D(vec2 p, vec2 freq) {
  15486. return (czm_pi / 2.0) * sin(freq.yx * p.yx);
  15487. }
  15488. vec2 phaseShift3D(vec3 p, vec2 freq) {
  15489. return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));
  15490. }
  15491. // The cloud texture function derived from Gardner's 1985 paper,
  15492. // "Visual Simulation of Clouds."
  15493. // https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf
  15494. const float T0 = 0.6; // contrast of the texture pattern
  15495. const float k = 0.1; // computed to produce a maximum value of 1
  15496. const float C0 = 0.8; // coefficient
  15497. const float FX0 = 0.6; // frequency X
  15498. const float FY0 = 0.6; // frequency Y
  15499. const int octaves = 5;
  15500. float T(vec3 point) {
  15501. vec2 sum = vec2(0.0);
  15502. float Ci = C0;
  15503. vec2 FXY = vec2(FX0, FY0);
  15504. vec2 PXY = vec2(0.0);
  15505. for(int i = 1; i <= octaves; i++) {
  15506. PXY = phaseShift3D(point, FXY);
  15507. Ci *= 0.707;
  15508. FXY *= 2.0;
  15509. vec2 sinTerm = sin(FXY * point.xy + PXY);
  15510. sum += Ci * sinTerm + vec2(T0);
  15511. }
  15512. return k * sum.x * sum.y;
  15513. }
  15514. const float a = 0.5; // fraction of surface reflection due to ambient or scattered light,
  15515. const float t = 0.4; // fraction of texture shading
  15516. const float s = 0.25; // fraction of specular reflection
  15517. float I(float Id, float Is, float It) {
  15518. return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;
  15519. }
  15520. const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));
  15521. vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,
  15522. float brightness) {
  15523. vec3 cloudPoint, cloudNormal;
  15524. if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,
  15525. cloudPoint, cloudNormal)) {
  15526. return vec4(0.0);
  15527. }
  15528. float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection
  15529. float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection
  15530. float It = T(cloudPoint); // texture function
  15531. float intensity = I(Id, Is, It);
  15532. vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));
  15533. vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);
  15534. float W = noise.x;
  15535. float W2 = noise.y;
  15536. float W3 = noise.z;
  15537. // The dot product between the cloud's normal and the ray's direction is greatest
  15538. // in the center of the ellipsoid's surface. It decreases towards the edge.
  15539. // Thus, it is used to blur the areas leading to the edges of the ellipsoid,
  15540. // so that no harsh lines appear.
  15541. // The first (and biggest) layer of worley noise is then subtracted from this.
  15542. // The final result is scaled up so that the base cloud is not too translucent.
  15543. float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
  15544. float TR = pow(ndDot, 3.0) - W; // translucency
  15545. TR *= 1.3;
  15546. // Subtracting the second and third layers of worley noise is more complicated.
  15547. // If these layers of noise were simply subtracted from the current translucency,
  15548. // the shape derived from the first layer of noise would be completely deleted.
  15549. // The erosion of this noise should thus be constricted to the edges of the cloud.
  15550. // However, because the edges of the ellipsoid were already blurred away, mapping
  15551. // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.
  15552. // The value of (0.5 - ndDot) provides the best compromise.
  15553. float minusDot = 0.5 - ndDot;
  15554. // Even with the previous calculation, subtracting the second layer of wnoise
  15555. // erode too much of the cloud. The addition of it, however, will detailed
  15556. // volume to the cloud. As long as the noise is only added and not subtracted,
  15557. // the results are aesthetically pleasing.
  15558. // The minusDot product is mapped in a way that it is larger at the edges of
  15559. // the ellipsoid, so a subtraction and min operation are used instead of
  15560. // an addition and max one.
  15561. TR -= min(minusDot * W2, 0.0);
  15562. // The third level of worley noise is subtracted from the result, with some
  15563. // modifications. First, a scalar is added to minusDot so that the noise
  15564. // starts affecting the shape farther away from the center of the ellipsoid's
  15565. // surface. Then, it is scaled down so its impact is not too intense.
  15566. TR -= 0.8 * (minusDot + 0.25) * W3;
  15567. // The texture function's shading does not correlate with the shape of the cloud
  15568. // produced by the layers of noise, so an extra shading scalar is calculated.
  15569. // The darkest areas of the cloud are assigned to be where the noise erodes
  15570. // the cloud the most. This is then interpolated based on the translucency
  15571. // and the diffuse shading term of that point in the cloud.
  15572. float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);
  15573. // To avoid values that are too dark, this scalar is increased by a small amount
  15574. // and clamped so it never goes to zero.
  15575. shading = clamp(shading + 0.2, 0.3, 1.0);
  15576. // Finally, the contrast of the cloud's color is increased.
  15577. vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);
  15578. return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;
  15579. }
  15580. void main() {
  15581. #ifdef DEBUG_BILLBOARDS
  15582. out_FragColor = vec4(0.0, 0.5, 0.5, 1.0);
  15583. #endif
  15584. // To avoid calculations with high values,
  15585. // we raycast from an arbitrarily smaller space.
  15586. vec2 coordinate = v_maximumSize.xy * v_offset;
  15587. vec3 ellipsoidScale = 0.82 * v_maximumSize;
  15588. vec3 ellipsoidCenter = vec3(0.0);
  15589. float zOffset = max(ellipsoidScale.z - 10.0, 0.0);
  15590. vec3 eye = vec3(0, 0, -10.0 - zOffset);
  15591. vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);
  15592. vec3 rayOrigin = eye;
  15593. #ifdef DEBUG_ELLIPSOIDS
  15594. vec3 point, normal;
  15595. if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,
  15596. point, normal)) {
  15597. out_FragColor = v_brightness * v_color;
  15598. }
  15599. #else
  15600. #ifndef DEBUG_BILLBOARDS
  15601. vec4 cloud = drawCloud(rayOrigin, rayDir,
  15602. ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);
  15603. if(cloud.w < 0.01) {
  15604. discard;
  15605. }
  15606. out_FragColor = cloud;
  15607. #endif
  15608. #endif
  15609. }
  15610. `;var lH=`#ifdef INSTANCED
  15611. in vec2 direction;
  15612. #endif
  15613. in vec4 positionHighAndScaleX;
  15614. in vec4 positionLowAndScaleY;
  15615. in vec4 packedAttribute0;
  15616. in vec4 packedAttribute1;
  15617. in vec4 color;
  15618. out vec2 v_offset;
  15619. out vec3 v_maximumSize;
  15620. out vec4 v_color;
  15621. out float v_slice;
  15622. out float v_brightness;
  15623. void main() {
  15624. // Unpack attributes.
  15625. vec3 positionHigh = positionHighAndScaleX.xyz;
  15626. vec3 positionLow = positionLowAndScaleY.xyz;
  15627. vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);
  15628. float show = packedAttribute0.x;
  15629. float brightness = packedAttribute0.y;
  15630. vec2 coordinates = packedAttribute0.wz;
  15631. vec3 maximumSize = packedAttribute1.xyz;
  15632. float slice = packedAttribute1.w;
  15633. #ifdef INSTANCED
  15634. vec2 dir = direction;
  15635. #else
  15636. vec2 dir = coordinates;
  15637. #endif
  15638. vec2 offset = dir - vec2(0.5, 0.5);
  15639. vec2 scaledOffset = scale * offset;
  15640. vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  15641. vec4 positionEC = czm_modelViewRelativeToEye * p;
  15642. positionEC.xy += scaledOffset;
  15643. positionEC.xyz *= show;
  15644. gl_Position = czm_projection * positionEC;
  15645. v_offset = offset;
  15646. v_maximumSize = maximumSize;
  15647. v_color = color;
  15648. v_slice = slice;
  15649. v_brightness = brightness;
  15650. }
  15651. `;var uH=`uniform vec3 u_noiseTextureDimensions;
  15652. uniform float u_noiseDetail;
  15653. uniform vec3 u_noiseOffset;
  15654. in vec2 v_position;
  15655. float wrap(float value, float rangeLength) {
  15656. if(value < 0.0) {
  15657. float absValue = abs(value);
  15658. float modValue = mod(absValue, rangeLength);
  15659. return mod(rangeLength - modValue, rangeLength);
  15660. }
  15661. return mod(value, rangeLength);
  15662. }
  15663. vec3 wrapVec(vec3 value, float rangeLength) {
  15664. return vec3(wrap(value.x, rangeLength),
  15665. wrap(value.y, rangeLength),
  15666. wrap(value.z, rangeLength));
  15667. }
  15668. vec3 random3(vec3 p) {
  15669. float dot1 = dot(p, vec3(127.1, 311.7, 932.8));
  15670. float dot2 = dot(p, vec3(269.5, 183.3, 421.4));
  15671. return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));
  15672. }
  15673. // Frequency corresponds to cell size.
  15674. // The higher the frequency, the smaller the cell size.
  15675. vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {
  15676. float textureSliceWidth = u_noiseTextureDimensions.x;
  15677. vec3 cell = centerCell + offset;
  15678. cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);
  15679. cell += floor(u_noiseOffset / u_noiseDetail);
  15680. vec3 p = offset + random3(cell);
  15681. return p;
  15682. }
  15683. float worleyNoise(vec3 p, float freq) {
  15684. vec3 centerCell = floor(p * freq);
  15685. vec3 pointInCell = fract(p * freq);
  15686. float shortestDistance = 1000.0;
  15687. for(float z = -1.0; z <= 1.0; z++) {
  15688. for(float y = -1.0; y <= 1.0; y++) {
  15689. for(float x = -1.0; x <= 1.0; x++) {
  15690. vec3 offset = vec3(x, y, z);
  15691. vec3 point = getWorleyCellPoint(centerCell, offset, freq);
  15692. float distance = length(pointInCell - point);
  15693. if(distance < shortestDistance) {
  15694. shortestDistance = distance;
  15695. }
  15696. }
  15697. }
  15698. }
  15699. return shortestDistance;
  15700. }
  15701. const float MAX_FBM_ITERATIONS = 10.0;
  15702. float worleyFBMNoise(vec3 p, float octaves, float scale) {
  15703. float noise = 0.0;
  15704. float freq = 1.0;
  15705. float persistence = 0.625;
  15706. for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {
  15707. if(i >= octaves) {
  15708. break;
  15709. }
  15710. noise += worleyNoise(p * scale, freq * scale) * persistence;
  15711. persistence *= 0.5;
  15712. freq *= 2.0;
  15713. }
  15714. return noise;
  15715. }
  15716. void main() {
  15717. float textureSliceWidth = u_noiseTextureDimensions.x;
  15718. float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
  15719. float x = mod(v_position.x, textureSliceWidth);
  15720. float y = mod(v_position.y, textureSliceWidth);
  15721. float sliceRow = floor(v_position.y / textureSliceWidth);
  15722. float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;
  15723. vec3 position = vec3(x, y, z);
  15724. position /= u_noiseDetail;
  15725. float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);
  15726. float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);
  15727. float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);
  15728. out_FragColor = vec4(worley0, worley1, worley2, 1.0);
  15729. }
  15730. `;var fH=`uniform vec3 u_noiseTextureDimensions;
  15731. in vec2 position;
  15732. out vec2 v_position;
  15733. void main()
  15734. {
  15735. gl_Position = vec4(position, 0.1, 1.0);
  15736. float textureSliceWidth = u_noiseTextureDimensions.x;
  15737. float noiseTextureRows = u_noiseTextureDimensions.y;
  15738. float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
  15739. vec2 transformedPos = (position * 0.5) + vec2(0.5);
  15740. transformedPos *= textureSliceWidth;
  15741. transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;
  15742. transformedPos.y *= noiseTextureRows;
  15743. v_position = transformedPos;
  15744. }
  15745. `;var dH=`
  15746. in vec2 v_textureCoordinates;
  15747. void main()
  15748. {
  15749. czm_materialInput materialInput;
  15750. materialInput.s = v_textureCoordinates.s;
  15751. materialInput.st = v_textureCoordinates;
  15752. materialInput.str = vec3(v_textureCoordinates, 0.0);
  15753. materialInput.normalEC = vec3(0.0, 0.0, -1.0);
  15754. czm_material material = czm_getMaterial(materialInput);
  15755. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  15756. }
  15757. `;var QRt=new h(1,1,1);function dne(e){e=e??QRt,this._dimensions=h.clone(e)}Object.defineProperties(dne.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var $Rt=new h;dne.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,$Rt),i=D.randomBetween(-n.x,n.x),o=D.randomBetween(-n.y,n.y),r=D.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var WDe=dne;var hne=class{constructor(){lt(this,"featuresLength");lt(this,"pointsLength");lt(this,"trianglesLength");lt(this,"geometryByteLength");lt(this,"texturesByteLength");lt(this,"batchTableByteLength");lt(this,"innerContents");lt(this,"ready");lt(this,"tileset");lt(this,"tile");lt(this,"url");lt(this,"batchTable");lt(this,"metadata");lt(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){_e.throwInstantiationError()}getFeature(t){_e.throwInstantiationError()}applyDebugSettings(t,n){_e.throwInstantiationError()}applyStyle(t){_e.throwInstantiationError()}update(t,n){_e.throwInstantiationError()}pick(t,n,i){_e.throwInstantiationError()}isDestroyed(){_e.throwInstantiationError()}destroy(){_e.throwInstantiationError()}},qDe=hne;function KR(e){e=e??G.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new uy({comparator:KR.comparator})}KR.prototype.addSubtree=function(e){let t=new JRt(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()};KR.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],s=r.subtree.implicitCoordinates;if(e.isEqual(s))return r.subtree}};KR.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 JRt(e,t){this.subtree=e,this.stamp=t}var hH=KR;function QR(e){e=e??G.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:a,paddingBefore:s=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=R.IDENTITY.clone(),shapeTransform:f=R.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:A}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=d,this._maxBounds=p,this._dimensions=a,this._paddingBefore=s,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===wc.ELLIPSOID?Rg.Z_UP:Rg.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=A,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new hH}Object.defineProperties(QR.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});QR.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();eOt(n);let i=sOt(n,t);await i.load();let{root:o}=n,r=vi(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,a=new rv({metadataJson:r,schema:i.schema}),s=o.content.extensions["3DTILES_content_voxels"],c=s.class,u=cOt(a,c);Object.assign(u,tOt(o)),l(o.transform)?u.globalTransform=R.unpack(o.transform):u.globalTransform=R.clone(R.IDENTITY),u.dimensions=h.unpack(s.dimensions),u.maximumTileCount=ZRt(a),l(s.padding)&&(u.paddingBefore=h.unpack(s.padding.before),u.paddingAfter=h.unpack(s.padding.after));let f=new QR(u),d=new Q0(t,o,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Pi.unload(i),f};function ZRt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(gh.TILESET_TILE_COUNT)}function eOt(e){let t=e.root;if(!l(t.content))throw new re("Root must have content");if(!vi(t.content,"3DTILES_content_voxels"))throw new re("Root tile content must have 3DTILES_content_voxels extension");if(!vi(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new re("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!vi(e,"3DTILES_metadata"))throw new re("Tileset must have a metadata schema")}function tOt(e){let t=e.boundingVolume;if(l(t.box))return rOt(t.box);if(l(t.region))return nOt(t.region);if(vi(t,"3DTILES_bounding_volume_cylinder"))return aOt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new re("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function nOt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],a=e[5],s=R.fromScale(te.WGS84.radii),c=new h(t,n,r),u=new h(i,o,a);return{shape:wc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:s}}var iOt=new h,oOt=new $;function rOt(e){let t=$t.unpack(e),n=$.getScale(t.halfAxes,iOt),i=$.getRotation(t.halfAxes,oOt);return{shape:wc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:R.fromRotationTranslation(i,t.center)}}function aOt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-D.PI,maxAngle:r=D.PI,translation:a=[0,0,0],rotation:s=[0,0,0,1]}=e,c=-.5*i+a[2],u=.5*i+a[2],f=R.fromTranslationQuaternionRotationScale(h.unpack(a),Le.unpack(s),h.ONE);return{shape:wc.CYLINDER,minBounds:h.fromElements(t,o,c),maxBounds:h.fromElements(n,r,u),shapeTransform:f}}function sOt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Pi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Pi.getSchemaLoader({schema:i})}function cOt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,a=Object.entries(r).map(([g,m])=>{let{type:A,componentType:y}=m,x=o?.properties[g].min,b=o?.properties[g].max,T=ht.getComponentCount(A),E=YDe(x,T),S=YDe(b,T);return{id:g,type:A,componentType:y,minValue:E,maxValue:S}}),s=a.map(g=>g.id),c=a.map(g=>g.type),u=a.map(g=>g.componentType),f=a.map(g=>g.minValue),d=a.map(g=>g.maxValue),p=f.some(l);return{className:t,names:s,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function YDe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function lOt(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()}),a=n.baseResource.getDerivedResource({url:r.url}),s=await a.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=cA(s);return o=await O_.fromSubtreeJson(a,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}QR.prototype.requestData=async function(e){e=e??G.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:o=0,keyframe:r=0}=e;if(r!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let a=this._implicitTileset,s=new $0({subdivisionScheme:a.subdivisionScheme,subtreeLevels:a.subtreeLevels,level:t,x:n,y:i,z:o}),c=s.isSubtreeRoot()&&s.level>0,u=c?s.getParentSubtreeCoordinates():s.getSubtreeCoordinates(),d=await lOt(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,s))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:m,baseResource:A}=a,y=m[0].getDerivedResource({templateValues:s.getTemplateValues()}),x=A.getDerivedResource({url:y.url});return HS.fromGltf(x)};var XDe=QR;function mne(e){e=e??1,this._radius=e??1}Object.defineProperties(mne.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});mne.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.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 mH=mne;var pH={CUMULUS:0};pH.validate=function(e){return e===pH.CUMULUS};Object.freeze(pH);var $R=pH;function cm(e,t){if(e=e??G.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new z(this._maximumSize.x,this._maximumSize.y);else{this._scale=z.clone(e.scale??new z(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(e.maximumSize??n)}this._slice=e.slice??-1,this._color=U.clone(e.color??U.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var uOt=cm.SHOW_INDEX=0,fOt=cm.POSITION_INDEX=1,dOt=cm.SCALE_INDEX=2,hOt=cm.MAXIMUM_SIZE_INDEX=3,mOt=cm.SLICE_INDEX=4,pOt=cm.BRIGHTNESS_INDEX=5,gOt=cm.COLOR_INDEX=6;cm.NUMBER_OF_PROPERTIES=7;function oT(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(cm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,oT(this,uOt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),oT(this,fOt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;z.equals(t,e)||(z.clone(e,t),oT(this,dOt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),oT(this,hOt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),oT(this,gOt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,oT(this,mOt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,oT(this,pOt))}}});cm.prototype._destroy=function(){this._cloudCollection=void 0};var Hd=cm;var Of,gH=new h,_Ot={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},AOt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},yOt=Hd.SHOW_INDEX,xOt=Hd.POSITION_INDEX,bOt=Hd.SCALE_INDEX,TOt=Hd.MAXIMUM_SIZE_INDEX,COt=Hd.SLICE_INDEX,EOt=Hd.BRIGHTNESS_INDEX,vOt=Hd.NUMBER_OF_PROPERTIES,SOt=Hd.COLOR_INDEX;function lm(e){e=e??G.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(vOt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:KDe(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=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function KDe(e){return function(){return gH.x=e._textureSliceWidth,gH.y=e._noiseTextureRows,gH.z=1/e._noiseTextureRows,gH}}Object.defineProperties(lm.prototype,{length:{get:function(){return gne(this),this._clouds.length}}});function QDe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}lm.prototype.add=function(e){e=e??G.EMPTY_OBJECT;let t=e.cloudType??$R.CUMULUS,n;return t===$R.CUMULUS&&(n=new Hd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};lm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};lm.prototype.removeAll=function(){QDe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function gne(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 a=n[o];l(a)&&(n._index=r++,t.push(a))}e._clouds=t}}lm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};lm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};lm.prototype.get=function(e){return gne(this),this._clouds[e]};var wOt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),IOt=new Uint16Array([0,1,2,0,2,3]);function DOt(e){let t=Ke.createVertexBuffer({context:e,typedArray:wOt,usage:Oe.STATIC_DRAW}),n=Ke.createIndexBuffer({context:e,typedArray:IOt,usage:Oe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Y.FLOAT}];return new Fn({context:e,attributes:i,indexBuffer:n})}var _ne;function POt(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,a=0;r<i;r+=6,a+=4)o[r]=a,o[r+1]=a+1,o[r+2]=a+2,o[r+3]=a,o[r+4]=a+2,o[r+5]=a+3;return n=Ke.createIndexBuffer({context:e,typedArray:o,usage:Oe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function ROt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=Ke.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Oe.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function OOt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=Ke.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Oe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function MOt(e,t,n){let i=[{index:Of.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:Of.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:Of.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:Of.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Oe.STATIC_DRAW},{index:Of.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Oe.STATIC_DRAW}];n&&i.push({index:Of.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:OOt(e)});let o=n?t:4*t;return new r_(e,i,o,n)}var pne=new Tn;function $De(e,t,n,i){let o,r=n[Of.positionHighAndScaleX],a=n[Of.positionLowAndScaleY],s=i.position;Tn.fromCartesian(s,pne);let c=i.scale,u=pne.high,f=pne.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),a(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),a(o+0,f.x,f.y,f.z,c.y),a(o+1,f.x,f.y,f.z,c.y),a(o+2,f.x,f.y,f.z,c.y),a(o+3,f.x,f.y,f.z,c.y))}function JDe(e,t,n,i){let o,r=n[Of.packedAttribute0],a=i.show,s=i.brightness;e._instanced?(o=i._index,r(o,a,s,0,0)):(o=i._index*4,r(o+0,a,s,0,0),r(o+1,a,s,1,0),r(o+2,a,s,1,1),r(o+3,a,s,0,1))}function ZDe(e,t,n,i){let o,r=n[Of.packedAttribute1],a=i.maximumSize,s=i.slice;e._instanced?(o=i._index,r(o,a.x,a.y,a.z,s)):(o=i._index*4,r(o+0,a.x,a.y,a.z,s),r(o+1,a.x,a.y,a.z,s),r(o+2,a.x,a.y,a.z,s),r(o+3,a.x,a.y,a.z,s))}function ePe(e,t,n,i){let o,r=n[Of.color],a=i.color,s=U.floatToByte(a.red),c=U.floatToByte(a.green),u=U.floatToByte(a.blue),f=U.floatToByte(a.alpha);e._instanced?(o=i._index,r(o,s,c,u,f)):(o=i._index*4,r(o+0,s,c,u,f),r(o+1,s,c,u,f),r(o+2,s,c,u,f),r(o+3,s,c,u,f))}function BOt(e,t,n,i){$De(e,t,n,i),JDe(e,t,n,i),ZDe(e,t,n,i),ePe(e,t,n,i)}function LOt(e,t,n,i){let o=e,r=o._textureSliceWidth,a=o._noiseTextureRows,s=t.context;o._vaNoise=DOt(s),o._spNoise=Qt.fromCache({context:s,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Dt({context:s,width:r*r/a,height:r*a,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:Xe.RGBA,sampler:new jt({wrapS:un.REPEAT,wrapT:un.REPEAT,minificationFilter:Vt.NEAREST,magnificationFilter:ti.NEAREST})});let f=new Kl({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:KDe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function NOt(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=MOt(i,r,n._instanced);let a=n._vaf.writers,s;for(s=0;s<r;++s){let c=o[s];BOt(e,t,a,c)}n._vaf.commit(_ne(i))}}var FOt=[];function kOt(e,t){let n=t.context,i=e,r=i._clouds.length,a=i._cloudsToUpdate,s=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=FOt;u.length=0,(c[xOt]||c[bOt])&&u.push($De),(c[yOt]||c[EOt])&&u.push(JDe),(c[TOt]||c[COt])&&u.push(ZDe),c[SOt]&&u.push(ePe);let f=u.length,d=i._vaf.writers,p,g,m;if(s/r>.1){for(p=0;p<s;++p)for(g=a[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(_ne(n))}else{for(p=0;p<s;++p){for(g=a[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function zOt(e,t,n,i){let o=t.context,r=e,a=new He({defines:[],sources:[n]});r._instanced&&a.defines.push("INSTANCED");let s=new He({defines:[],sources:[i]});r.debugBillboards&&s.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&s.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Qt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:Of}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!1,blending:Jt.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function UOt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let a=n._colorCommands,s=n._vaf.va,c=s.length;a.length=c;for(let u=0;u<c;u++){let f=a[u];l(f)||(f=a[u]=new tt),f.pass=Ie.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=s[u].indicesCount,f.vertexArray=s[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}lm.prototype.update=function(e){if(gne(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&LOt(this,e,fH,uH),this._instanced=e.context.instancedArrays,Of=this._instanced?AOt:_Ot,_ne=this._instanced?ROt:POt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?NOt(this,e):r>0&&kOt(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)&&zOt(this,e,lH,cH),UOt(this,e))};lm.prototype.isDestroyed=function(){return!1};lm.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(),QDe(this._clouds),fe(this)};var tPe=lm;var VOt=D.toRadians(30);function Ane(e){this._angle=e??VOt}Object.defineProperties(Ane.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});Ane.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),a=1;e.velocity=h.fromElements(o,r,a,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var nPe=Ane;function JR(e){e=e??G.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=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); }
  15758. `;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); }
  15759. `;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); }
  15760. `;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); }
  15761. `;break;case"vec4":r=`vec4 getColor() { return ${o}; }
  15762. `;break}let a=`in vec3 position3DHigh;
  15763. in vec3 position3DLow;
  15764. in float batchId;
  15765. ${n?"":`in ${i} ${t};
  15766. `}out ${i} ${o};
  15767. void main()
  15768. {
  15769. vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
  15770. ${n?`${o} = czm_batchTable_${t}(batchId);
  15771. `:`${o} = ${t};
  15772. `}gl_Position = czm_modelViewProjectionRelativeToEye * p;
  15773. }`,s=`in ${i} ${o};
  15774. ${r}
  15775. void main()
  15776. {
  15777. out_FragColor = getColor();
  15778. }`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??a,this._fragmentShaderSource=e.fragmentShaderSource??s,this._renderState=xo.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(JR.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}}});JR.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;JR.prototype.isTranslucent=xo.prototype.isTranslucent;JR.prototype.getRenderState=xo.prototype.getRenderState;var iPe=JR;function _H(e){e=e??G.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this._modelMatrix=new R,this.id=e.id,this._id=void 0,this._primitive=void 0}_H.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!R.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=R.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 Bt({geometry:new NA({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ua.VERTEX_FORMAT,colors:[U.RED,U.RED],arcType:rn.NONE}),modelMatrix:R.multiplyByUniformScale(this.modelMatrix,this.length,new R),id:this.id,pickPrimitive:this}),n=new Bt({geometry:new NA({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ua.VERTEX_FORMAT,colors:[U.GREEN,U.GREEN],arcType:rn.NONE}),modelMatrix:R.multiplyByUniformScale(this.modelMatrix,this.length,new R),id:this.id,pickPrimitive:this}),i=new Bt({geometry:new NA({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ua.VERTEX_FORMAT,colors:[U.BLUE,U.BLUE],arcType:rn.NONE}),modelMatrix:R.multiplyByUniformScale(this.modelMatrix,this.length,new R),id:this.id,pickPrimitive:this});this._primitive=new Pn({geometryInstances:[t,n,i],appearance:new Ua,asynchronous:!1})}this._primitive.update(e)}};_H.prototype.isDestroyed=function(){return!1};_H.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var AH=_H;function jOt(e){this.direction=h.clone(e.direction),this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??1}var oPe=jOt;var yH=`in vec3 v_positionMC;
  15779. in vec3 v_positionEC;
  15780. in vec2 v_st;
  15781. void main()
  15782. {
  15783. czm_materialInput materialInput;
  15784. vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
  15785. #ifdef FACE_FORWARD
  15786. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  15787. #endif
  15788. materialInput.s = v_st.s;
  15789. materialInput.st = v_st;
  15790. materialInput.str = vec3(v_st, 0.0);
  15791. // Convert tangent space material normal to eye space
  15792. materialInput.normalEC = normalEC;
  15793. materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
  15794. // Convert view vector to world space
  15795. vec3 positionToEyeEC = -v_positionEC;
  15796. materialInput.positionToEyeEC = positionToEyeEC;
  15797. czm_material material = czm_getMaterial(materialInput);
  15798. #ifdef FLAT
  15799. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  15800. #else
  15801. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  15802. #endif
  15803. }
  15804. `;var xH=`in vec3 position3DHigh;
  15805. in vec3 position3DLow;
  15806. in vec2 st;
  15807. in float batchId;
  15808. out vec3 v_positionMC;
  15809. out vec3 v_positionEC;
  15810. out vec2 v_st;
  15811. void main()
  15812. {
  15813. vec4 p = czm_computePosition();
  15814. v_positionMC = position3DHigh + position3DLow; // position in model coordinates
  15815. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  15816. v_st = st;
  15817. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  15818. }
  15819. `;function rT(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:qi.fromType(qi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??xH,this._fragmentShaderSource=e.fragmentShaderSource??yH,this._renderState=xo.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(rT.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 rT.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});rT.VERTEX_FORMAT=Ne.POSITION_AND_ST;rT.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;rT.prototype.isTranslucent=xo.prototype.isTranslucent;rT.prototype.getRenderState=xo.prototype.getRenderState;var rPe=rT;function JS(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new tc(i),this._workerName="createSphereGeometry"}JS.packedLength=tc.packedLength;JS.pack=function(e,t,n){return tc.pack(e._ellipsoidGeometry,t,n)};var GOt=new tc,hy={radius:void 0,radii:new h,vertexFormat:new Ne,stackPartitions:void 0,slicePartitions:void 0};JS.unpack=function(e,t,n){let i=tc.unpack(e,t,GOt);return hy.vertexFormat=Ne.clone(i._vertexFormat,hy.vertexFormat),hy.stackPartitions=i._stackPartitions,hy.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,hy.radii),n._ellipsoidGeometry=new tc(hy),n):(hy.radius=i._radii.x,new JS(hy))};JS.createGeometry=function(e){return tc.createGeometry(e._ellipsoidGeometry)};var bH=JS;var HOt=1e5;function ZR(e){e=e??G.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new xt(t)),this._credit=t,this._radius=l(e.radius)?e.radius:HOt,this._image=e.image,this._transform=l(e.transform)?e.transform:R.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new bH({radius:this._radius,vertexFormat:Ne.ALL}),i=new Bt({geometry:n,modelMatrix:this._transform}),o=new qi({fabric:{type:"Image",uniforms:{image:this._image,repeat:new z(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Pn({geometryInstances:i,appearance:new go({material:o,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(ZR.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});ZR.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};ZR.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};ZR.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var aPe=ZR;function Nu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??Nu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??Nu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??Nu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??Nu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??Nu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new ye,this._nominalFrameRate=new ye,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){WOt(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(){qOt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Nu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Nu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Nu({scene:e})),e._frameRateMonitor};Object.defineProperties(Nu.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}}});Nu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Nu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Nu.prototype.isDestroyed=function(){return!1};Nu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),fe(this)};function WOt(e,t){if(e._pauseCount>0)return;let n=zi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/oi.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/oi.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/oi.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 qOt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var TH=Nu;var xne=class e{constructor(t){t=t??G.EMPTY_OBJECT;let n=YOt(t.geoJson),i=t.allowPicking??!0,o=t.ellipsoid??te.default,r=new Float64Array(0);function a(d){return r.length<d&&(r=new Float64Array(d)),r}if(this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,n.pointCount>0){let d={primitiveCountMax:n.pointCount,allowPicking:i};this._points=new rf(d)}if(n.polylineCount>0){let d={primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i};this._polylines=new sf(d)}if(n.polygonCount>0){let d={primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i};this._polygons=new af(d)}let s=new h,c=0,u=0,f=0;for(let d=0;d<n.features.length;d++){let p=n.features[d],g=p.featureId,m=this._properties[g];for(let A=0;A<p.points.length;A++){let y=c++;this._points.add({featureId:g,position:dPe(p.points[A],o,s),pickObject:i?yne(this,y,this._points,Jc,m):void 0})}for(let A=0;A<p.polylines.length;A++){let y=u++;this._polylines.add({featureId:g,positions:sPe(p.polylines[A],o,a),pickObject:i?yne(this,y,this._polylines,yc,m):void 0})}for(let A=0;A<p.polygons.length;A++){let y=p.polygons[A],x=f++;this._polygons.add({featureId:g,positions:sPe(y.positions,o,a),holes:y.holes,triangles:y.triangles,pickObject:i?yne(this,x,this._polygons,Ha,m):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof De?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=De.createIfNeeded(t),o=await i.fetchJson();if(!l(o))throw new re(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(o,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){this.show&&(l(this._points)&&this._points.update(t),l(this._polylines)&&this._polylines.update(t),l(this._polygons)&&this._polygons.update(t))}destroy(){return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(this._polylines.destroy(),this._polylines=void 0),this._polygons&&(this._polygons.destroy(),this._polygons=void 0),fe(this)}isDestroyed(){return!1}};function yne(e,t,n,i,o){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,o):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:o}}function YOt(e){let t=XOt(e),n=[],i=[],o=[],r=0,a=0,s=0,c=0,u=0,f=0,d=0;for(let p=0;p<t.length;p++){let g=t[p],m={points:[],polylines:[],polygons:[]};if(cPe(g.geometry,m),m.points.length===0&&m.polylines.length===0&&m.polygons.length===0)continue;let A=i.length;i.push(g.id),o.push(rMt(g.properties)?g.properties:G.EMPTY_OBJECT);for(let y=0;y<m.polygons.length;y++){let x=m.polygons[y];f+=x.holes.length,d+=x.triangles.length/3,u+=x.positions.length}for(let y=0;y<m.polylines.length;y++)s+=m.polylines[y].length;r+=m.points.length,a+=m.polylines.length,c+=m.polygons.length,n.push({featureId:A,points:m.points,polylines:m.polylines,polygons:m.polygons})}return{features:n,ids:i,properties:o,pointCount:r,polylineCount:a,polylineVertexCount:s,polygonCount:c,polygonVertexCount:u,polygonHoleCount:f,polygonTriangleCount:d}}function XOt(e){if(!l(e)||!l(e.type))throw new re("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(iMt(e.type))return[{type:"Feature",geometry:e,properties:G.EMPTY_OBJECT,id:void 0}];throw new re(`Unsupported GeoJSON type: ${e.type}`)}}function cPe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":lPe(e.coordinates,t.points);return;case"MultiPoint":QOt(e.coordinates,t.points);return;case"LineString":uPe(e.coordinates,t.polylines);return;case"MultiLineString":$Ot(e.coordinates,t.polylines);return;case"Polygon":fPe(e.coordinates,t.polygons);return;case"MultiPolygon":JOt(e.coordinates,t.polygons);return;case"GeometryCollection":KOt(e.geometries,t);return;default:return}}function KOt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)cPe(e[n],t)}function lPe(e,t){let n=bne(e);l(n)&&t.push(n)}function QOt(e,t){for(let n=0;n<e.length;n++)lPe(e[n],t)}function uPe(e,t){let n=ZOt(e);l(n)&&n.length>=2&&t.push(n)}function $Ot(e,t){for(let n=0;n<e.length;n++)uPe(e[n],t)}function fPe(e,t){let n=eMt(e);l(n)&&t.push(n)}function JOt(e,t){for(let n=0;n<e.length;n++)fPe(e[n],t)}function ZOt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=bne(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function eMt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let s=0;s<e.length;s++){let c=tMt(e[s]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],o=[],r=[];for(let s=0;s<t.length;s++){let c=t[s];if(!(c.length<3)){s>0&&r.push(o.length);for(let u=0;u<c.length;u++){let f=c[u];o.push(f),i.push(new z(f[0],f[1]))}}}if(o.length<3)return;let a=ni.triangulate(i,r);if(!(!l(a)||a.length<3))return{positions:o,holes:new Uint32Array(r),triangles:new Uint32Array(a)}}function tMt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=bne(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&nMt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function bne(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function nMt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function iMt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function dPe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var oMt=new h;function sPe(e,t,n){let i=e.length*3,o=n(i);for(let r=0;r<e.length;r++){let a=dPe(e[r],t,oMt);o[r*3]=a.x,o[r*3+1]=a.y,o[r*3+2]=a.z}return o.subarray(0,i)}function rMt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var hPe=xne;var aMt=1953029805,sMt=2917034100;function Tne(e,t){if(Tne.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new re("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===aMt||o===sMt)return t;let r=new DataView(e),a=0,s=t.byteLength,c=s-s%8,u=n,f,d=8;for(;a<c;)for(d=(d+8)%24,f=d;a<c&&f<u;)i.setUint32(a,i.getUint32(a,!0)^r.getUint32(f,!0),!0),i.setUint32(a+4,i.getUint32(a+4,!0)^r.getUint32(f+4,!0),!0),a+=8,f+=24;if(a<s)for(f>=u&&(d=(d+8)%24,f=d);a<s;)i.setUint8(a,i.getUint8(a)^r.getUint8(f)),a++,f++}Tne.passThroughDataForTesting=!1;var CH=Tne;var hMt=Na(Cne(),1);function cMt(e,t){return(e&t)!==0}var Wl=cMt;var lMt=[1,2,4,8],mPe=15,uMt=16,fMt=64,dMt=128;function Xp(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}Xp.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 Xp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Xp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Xp.prototype.hasSubtree=function(){return Wl(this._bits,uMt)};Xp.prototype.hasImagery=function(){return Wl(this._bits,fMt)};Xp.prototype.hasTerrain=function(){return Wl(this._bits,dMt)};Xp.prototype.hasChildren=function(){return Wl(this._bits,mPe)};Xp.prototype.hasChild=function(e){return Wl(this._bits,lMt[e])};Xp.prototype.getChildBitmask=function(){return this._bits&mPe};var EH=Xp;function mMt(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 pMt=mMt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y
  15820. wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB
  15821. \f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2
  15822. \xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1
  15823. ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS
  15824. >\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88
  15825. \x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Mf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Mf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Mf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new Mf;i._resource=n;try{await gMt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${gPe(i,"",1).url}: ${o}`;throw new re(r)}return i};Mf.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,a=0;Wl(t,r)?Wl(e,r)&&(a|=1):(a|=2,Wl(e,r)||(a|=1)),i+=a}return i};Mf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,a=+e[i-o];Wl(a,2)?Wl(a,1)||(t|=r):(n|=r,Wl(a,1)&&(t|=r))}return{x:t,y:n,level:i}};Mf.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 pPe=new Wn("decodeGoogleEarthEnterprisePacket");Mf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=gPe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,a=this.key;return o.then(function(s){return pPe.scheduleTask({buffer:s,quadKey:e,type:"Metadata",key:a},[s]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,A){return m.length-A.length});let g=p.length;for(let m=0;m<g;++m){let A=p[m];if(u[A]!==null){let x=EH.clone(u[A]),b=A.length;if(b===d)x.setParent(f);else if(b>1){let T=r[A.substring(0,A.length-1)];x.setParent(T)}r[A]=x}else r[A]=null}})})};Mf.prototype.populateSubtree=function(e,t,n,i){let o=Mf.tileXYToQuadKey(e,t,n);return Sne(this,o,i)};function Sne(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 a,s=e._subtreePromises,c=s[o];if(l(c))return c.then(function(){return a=new Cr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Sne(e,t,a)});if(!l(r)||!r.hasSubtree())return Promise.reject(new re(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return s[o]=c,c.then(function(){return a=new Cr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Sne(e,t,a)}).finally(function(){delete s[o]})}Mf.prototype.getTileInformation=function(e,t,n){let i=Mf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Mf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function gPe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Ene,vne;function gMt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(vne)){let n=Xt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;vne=RT(n).then(function(){Ene=window.cesiumGoogleEarthDbRootParser(hMt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return vne.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Ene.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,a=r+o.byteLength,s=e.key=o.buffer.slice(r,a);o=i.dbrootData,r=o.byteOffset,a=r+o.byteLength;let c=o.buffer.slice(r,a);return pPe.scheduleTask({buffer:c,type:"DbRoot",key:s},[c])}).then(function(n){let i=Ene.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let s=i.endSnippet.model;e.negativeAltitudeExponentBias=s.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=s.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],a=r.length;for(let s=0;s<a;++s){let c=r[s],u=c.copyrightString;l(u)&&(o[c.providerId]=new xt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=pMt})}var my=Mf;var _Pe=Na(Cne(),1);function wne(){this._image=new Image}wne.prototype.isReady=function(){return!0};wne.prototype.shouldDiscardImage=function(e){return e===this._image};function aT(e){e=e??G.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 oe(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new xt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new wne),this._errorEvent=new ye}Object.defineProperties(aT.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}}});aT.fromMetadata=function(e,t){if(!e.imageryPresent)throw new re(`The server ${e.url} doesn't have imagery`);let n=new aT(t);return n._metadata=e,n};aT.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]}};aT.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,a=my.tileXYToQuadKey(e,t,n),s=r.getTileInformation(e,t,n);if(!l(s)){if(r.isValid(a)){let u=new Cr({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!s.hasImagery())return Promise.resolve(o);let c=_Mt(this,s,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){CH(r.key,u);let f=new Uint8Array(u),d,p=r.protoImagery;if((!l(p)||!p)&&(d=AMt(f)),!l(d)&&(!l(p)||p)){let g=yMt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?o:I_({uint8Array:f,format:d,flipY:!0})})};aT.prototype.pickFeatures=function(e,t,n,i,o){};function _Mt(e,t,n,i,o,r){let a=my.tileXYToQuadKey(n,i,o),s=t.imageryVersion;return s=l(s)&&s>0?s:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${a}-i.${s.toString()}`,request:r})}function AMt(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 yMt(e){let t=_Pe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let a=t.uint32(),s;switch(a>>>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(s=i.copyrightIds,l(s)||(s=i.copyrightIds=[]),(a&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)s.push(t.uint32())}else s.push(t.uint32());break;default:t.skipType(a&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 re("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 APe=aT;var xMt=600;function Kp(e){e=e??G.EMPTY_OBJECT,this._key=l(e.key)?e.key:Ps.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Ps.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??xMt}Object.defineProperties(Kp.prototype,{});Kp.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,o=e.signature,{panoId:r}=e;l(r)||(r=(await this.getNearestPanoId(t)).panoId);let a=Ps.getDefaultCredit(),s=h.fromDegrees(D.toDegrees(t.longitude),D.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:r,signature:o})],[u,f,d,p,g,m]=await Promise.all(c),A=pt.localFrameToFixedFrameGenerator("north","down"),y=R.getMatrix3(A(s,te.default),new $);return new KS({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:y,credit:a})};Kp.prototype.getNearestPanoId=async function(e,t){let i=[D.toDegrees(e.latitude),D.toDegrees(e.longitude)].join(","),r=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(r.status!=="OK")throw new _e(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${r.status}`);return{panoId:r.pano_id,latitude:r.location.lat,longitude:r.location.lng}};Kp.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new _e(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};Kp.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new _e(`Failed to load Street View face image: ${t}`)}};Kp.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:o,signature:r}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:o,heading:t,pitch:n,key:this._key,...l(r)&&{signature:r}}}).url};Kp.fromUrl=async function(e){if(e=e??{},e.key=e.key??Ps.defaultStreetViewStaticApiKey??Ps.defaultApiKey,!l(e.key)&&!l(Ps.defaultStreetViewStaticApiKey)&&!l(Ps.defaultApiKey))throw new _e("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new Kp({...e})};Kp._parseMetadata=function(e){return{cartographic:de.fromDegrees(e.location.lng,e.location.lat,0)}};var yPe=Kp;var bMt=new U(1,1,1,.4),TMt=new U(0,1,0,.05),CMt=new U(0,.5,0,.2);function sT(e){e=e??G.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=e.cells??8,this._color=e.color??bMt,this._glowColor=e.glowColor??TMt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??CMt,this._errorEvent=new ye,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(sT.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}}});sT.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()};sT.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 a=this._color.toCssColorString();return i.strokeStyle=a,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};sT.prototype.getTileCredits=function(e,t,n){};sT.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};sT.prototype.pickFeatures=function(e,t,n,i,o){};var xPe=sT;function um(){}um._maxDecodingConcurrency=Math.max(cn.hardwareConcurrency-1,1);um._decodeTaskProcessor=new Wn("decodeI3S",um._maxDecodingConcurrency);um._promise=void 0;async function EMt(){if(await um._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return um._decodeTaskProcessor;throw new re("I3S decoder could not be initialized.")}um.decode=async function(e,t,n,i,o){return l(um._promise)||(um._promise=EMt()),um._promise.then(function(r){let a=n._parent._data,s=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(a.obb)?(c=a.obb.center[0],u=a.obb.center[1],f=a.obb.center[2]):l(a.mbs)&&(c=a.mbs[0],u=a.mbs[1],f=a.mbs[2]);let d=$.fromRotationX(-D.PI_OVER_TWO),p=new $;$.multiply(d,s,p);let g=de.fromDegrees(c,u,f),m=te.WGS84.cartographicToCartesian(g),A={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:te.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(A)})};var vH=um;function Ine(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(Ine.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});Ine.prototype.load=async function(){return this._data=await Qp.loadJson(this._resource),this._data};var SH=Ine;function Mg(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(Mg.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 wH(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 vMt(e){return e==="String"?1:wH(e)}async function SMt(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)}Mg.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=SMt(this).catch(function(e){console.error(e)}),this._loadPromise)};Mg.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}};Mg.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};Mg.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 a=0;a<this._header.count;++a)if(r.valueType!=="String"){let s=this._parseValue(e,r.valueType,t);this._values[o].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[a],c="";for(let u=0;u<s;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};Mg.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=wH(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=wH(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Mg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=vMt(i.valueType)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Mg.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new re(`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,a=this._storageInfo[r];if(l(a))if(a.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let s=wH(a.valueType);t+=s*this._header.count}else{if(!l(n))throw new re(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let s=0;s<this._header.count&&t<e.byteLength;++s){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new re(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var IH=Mg;function wMt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var ZS=wMt;function tO(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(tO.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});tO.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var IMt=new h,DMt=new h,PMt=new h,RMt=new h,OMt=new h;function Dne(e,t,n,i){let o=h.subtract(i,n,IMt),r=h.cross(o,h.subtract(e,n,DMt),RMt),a=h.cross(o,h.subtract(t,n,PMt),OMt);return h.dot(r,a)>=0}var MMt=new h,BMt=new h,LMt=new h,NMt=new h,FMt=new h,kMt=new h,zMt=new h,UMt=new h,VMt=new h,jMt=new h;tO.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,a,s,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,A;l(f)?(g=f[p],m=f[p+1],A=f[p+2]):(g=p*3,m=p*3+1,A=p*3+2);let y=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],MMt),x=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],BMt),b=new h(u[A*3],u[A*3+1],u[A*3+2],LMt);if(!Dne(i,y,x,b)||!Dne(i,x,y,b)||!Dne(i,b,y,x))continue;let T=h.subtract(x,y,NMt),E=h.subtract(b,y,FMt),S=h.cross(T,E,kMt);if(h.magnitude(S)===0)continue;let w=h.normalize(S,zMt),P=h.subtract(i,y,UMt),O=Math.abs(h.dot(P,w));if(O<o){o=O,r=p;let B=h.magnitudeSquared(h.subtract(i,y,P)),L=h.magnitudeSquared(h.subtract(i,x,VMt)),_=h.magnitudeSquared(h.subtract(i,b,jMt));B<L&&B<_?(s=g,c=y,a=B):L<_?(s=m,c=x,a=L):(s=A,c=b,a=_)}}if(l(r))return{index:s,distanceSquared:a,distance:Math.sqrt(a),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function bPe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(ZS(e[i])):t.push(e[i]);return t}tO.prototype._generateGltf=function(e,t,n,i,o,r,a,s){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let T=this._parent._data.mesh.material.definition;if(T>=0&&T<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[T],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let E="0";if(l(this._layer._data.textureSetDefinitions))for(let S=0;S<this._layer._data.textureSetDefinitions.length;S++){let w=this._layer._data.textureSetDefinitions[S];for(let P=0;P<w.formats.length;P++){let O=w.formats[P];if(O.format==="jpg"){E=O.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${E}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=bPe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=bPe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=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=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let A=[],y=n.length;for(let b=0;b<y;b++){let T=n[b].primitives,E=T.length;for(let S=0;S<E;S++){let w=T[S];if(l(w.material)){for(;w.material>=A.length;){let O=qe(c,!0);A.push(O)}let P=A[w.material];l(w.extra)&&w.extra.isTransparent?l(P.alphaMode)||(P.alphaMode="BLEND"):P.alphaMode==="BLEND"&&(P.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:A,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:a,extensionsUsed:s}};var nO=tO;function ul(e,t,n){let i,o,r,a;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:a=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=a,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(ul.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}}});ul.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Ph(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Qp.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 TPe(e,t){let n=new IH(e,t);return e._fields[t.name]=n,n.load()}ul.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(TPe(this,i))}return Promise.all(t)};ul.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 TPe(this,o)}return Promise.resolve()};ul.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)};ul.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};ul.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 ul(e,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};ul.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new nO(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 nO(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};ul.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new SH(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};ul.prototype._clearGeometryData=function(){this._geometryData=[]};ul.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=de.fromDegrees(e.center[0],e.center[1],e.center[2]):n=de.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let x=0;x<this._dataProvider._geoidDataList.length;x++){let b=this._dataProvider._geoidDataList[x],T=b.projection.project(n);if(T.x>b.nativeExtent.west&&T.x<b.nativeExtent.east&&T.y>b.nativeExtent.south&&T.y<b.nativeExtent.north){n.height+=qMt(T.x,T.y,b);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=te.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=te.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let a=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let x=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));a=r/x}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let x=this._data.lodThreshold;a=r/x}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let x=0;x<this._data.lodSelection.length;x++)this._data.lodSelection[x].metricType==="maxScreenThreshold"&&(a=r/this._data.lodSelection[x].maxError);a===1/0&&(a=1e5);let s=a*16,c=new kc(0,0,0),u=pt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new R(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),g=R.inverse(p,new R),m=R.clone(p);l(this._parent._globalTransform)&&R.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let A=[];for(let x=0;x<this._children.length;x++)A.push(this._children[x]._create3DTileDefinition());return{children:A,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:s}};ul.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};ul.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,a=this._geometryData[0],s=await vH.decode(o,r,a,this._featureData[0],this._symbologyData);if(!l(s))return;e=a._generateGltf(s.meshData.nodesInScene,s.meshData.nodes,s.meshData.meshes,s.meshData.buffers,s.meshData.bufferViews,s.meshData.accessors,s.meshData.rootExtensions,s.meshData.extensionsUsed),this._geometryData[0]._customAttributes=s.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function GMt(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 HMt(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 a=0;a<n.values.length;a++)if(n.values[a]===o){r=!0;break}return r}async function CPe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await GMt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let a=i[r];if(!HMt(o,e._fields[a.name],a)){n.setShow(o,!1);break}}}t.show=!0}ul.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=CPe(this,t);e.push(n)}return Promise.all(e)};Ph.prototype._hookedRequestContent=Ph.prototype.requestContent;Ph.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 De({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(()=>{CPe(e._i3sNode,n)})),e._isLoading=!1,t})}};function WMt(e,t,n,i,o,r){let a=n*(1-e)+i*e,s=o*(1-e)+r*e;return a*(1-t)+s*t}function DH(e,t,n,i){let o=e+t*n;return i[o]}function qMt(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),a=Math.floor(o),s=Math.floor(r);o-=a,r-=s;let c=a<n.width?a+1:a,u=s<n.height?s+1:s;s=n.height-1-s,u=n.height-1-u;let f=DH(a,s,n.width,n.buffer),d=DH(c,s,n.width,n.buffer),p=DH(a,u,n.width,n.buffer),g=DH(c,u,n.width,n.buffer),m=WMt(o,r,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Ph.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var iO=ul;function PH(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(PH.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function Pne(e,t){let n=[];for(let i=0;i<e.length;i++){let o=U.byteToFloat(e[i]);i<3?n.push(ZS(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function ew(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,a=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=Pne(r.color,r.transparency))):l(a)&&(n.edges={},l(a.color)&&(n.edges.color=Pne(a.color,a.transparency))),!t){let s=o.material;l(s)&&(n.material={colorMixMode:s.colorMixMode},l(s.color)&&(n.material.color=Pne(s.color,s.transparency)))}break}}return n}function YMt(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 a=ew(o[r].symbol,t),s=o[r].values;for(let c=0;c<s.length;c++){let u=s[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=a:(l(f[p])||(f[p]={}),f=f[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]=ew(o.symbol,t)}return n}}function XMt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let a=o.classMaxValue??o.classMinValue,s=r.classMaxValue??r.classMinValue;return a-s});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(ew(r.symbol,t)))}return i.symbols.push(void 0),i}}PH.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=ew(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=ew(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=YMt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=ew(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=XMt(i,n))}};function EPe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],a=e[r];return l(a)&&++n<t.length?EPe(a,t,n,i):a}}function KMt(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 QMt(e,t,n){let i=t[n],o=KMt(e.ranges,i);return e.symbols[o]}PH.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=>EPe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>QMt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let a=0;a<r.length;a++){let s=o(a);l(s)&&(t[a]=s)}}}return t};var RH=PH;function Fu(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 De({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(Fu.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}}});Fu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new re(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new RH(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()};Fu.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],a=[],s=!1;if(l(r.compressedAttributes)&&e){s=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)a.push(c[u])}else for(let c in r)c!=="offset"&&a.push(c);n.push({compressed:s,attributes:a,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)}};Fu.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,a=o.attributes;for(let s=0;s<t.length;s++)if(!a.includes(t[s])){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]}}};Fu.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 iO(this,t,!0)}else this._rootNode=new iO(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Fu.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]})};Fu._fetchJson=function(e){return e.fetchJson()};Fu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Fu._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]};Fu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=oe.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=oe.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Fu.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)?qe(e):{},e.outlineColor=U.fromCartesian4(se.fromArray(o))),this._tileset=await wa.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()})};Fu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Fu.prototype.filterByAttributes=function(e){this._filters=l(e)?qe(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var tw=Fu;function OH(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(OH.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}}});OH.prototype.load=async function(){return this._data=await Qp.loadJson(this._resource),this._data};OH.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 MH=OH;function oO(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(oO.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}}});oO._fromData=async function(e,t,n,i){let o=new oO(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let a=[];for(let c=0;c<r.length;c++){let u=oO._fromData(e,t,r[c],o);a.push(u)}let s=await Promise.all(a);for(let c=0;c<s.length;c++){let u=s[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),a=new De({url:r});a.setQueryParameters(e.resource.queryParameters),a.appendForwardSlash(),o._resource=a;let s=await Qp.loadJson(o._resource),c=new tw(e,s,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var BH=oO;var wPe=Na(vPe(),1);function Xa(e){e=e??G.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??G.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(Xa.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}}});Xa.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return fe(this)};Xa.prototype.isDestroyed=function(){return!1};Xa.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Xa.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Xa.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Xa.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 $Mt(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 SPe(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=$Mt(e,t.id);if(l(t.sublayers)){let o=[];for(let a=0;a<t.sublayers.length;a++){let s=BH._fromData(e,i,t.sublayers[a],e);o.push(s)}let r=await Promise.all(o);for(let a=0;a<r.length;a++){let s=r[a];e._sublayers.push(s),e._layers.push(...s._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new MH(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=oe.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 tw(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.`)}Xa.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Xa.loadJson(n),o=new Xa(t);if(o._resource=n,o._data=i,l(i.layers)){let a=[];for(let s=0;s<i.layers.length;s++){let c=SPe(o,i.layers[s],t);a.push(c)}await Promise.all(a)}else await SPe(o,i,t);o._computeExtent();let r=[];for(let a=0;a<o._layers.length;a++)r.push(o._layers[a].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};Xa._fetchJson=function(e){return e.fetchJson()};Xa.loadJson=async function(e){let t=await Xa._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 re(t.error)}return t};Xa.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 re(`Failed to load binary: ${e.url}`);return t};Xa.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 JMt=new z;function ZMt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,a=de.fromRadians(t.west,t.north),s=de.fromRadians(t.east,t.south),c=n.positionToTileXY(a,r),u=n.positionToTileXY(s,r);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=z.fromElements(d,p,JMt),m=g.toString();if(!o.hasOwnProperty(m)){let A={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=A,i.push(A)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},A=d[g],y="Geographic";n._projection instanceof di&&(y="WebMercator");let x={projectionType:y,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:A._height,width:A._width,scale:A._structure.heightScale,offset:A._structure.heightOffset};if(A._encoding===Jh.LERC){let b=wPe.default.decode(A._buffer);x.buffer=b.pixels[0]}else x.buffer=A._buffer;p.push(x)}return p})}async function eBt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await ZMt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Xa.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=eBt(this),this._geoidDataPromise)};Xa.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?oe.union(e,n,e):e=oe.clone(n)}this._extent=e};Xa.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Xa.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[]};Xa.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 Qp=Xa;var Ka={};Ka.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Ka.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Ka.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Ka.defaultAccessToken=void 0;Ka.defaultShareKey=void 0;Ka._getAuthorizationHeader=function(){return l(Ka.defaultShareKey)?`Basic ${Ka.defaultShareKey}`:`Bearer ${Ka.defaultAccessToken}`};Ka.apiEndpoint=new De({url:"https://api.bentley.com"});Ka.getExports=async function(e,t){let n=new De({url:`${Ka.apiEndpoint}mesh-export`,headers:{Authorization:Ka._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Ka.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new re(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new re("Not allowed, forbidden");if(i.statusCode===422)throw new re(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new re("Too many requests")}throw new re(`Unknown request failure ${i.statusCode}`)}};Ka.getRealityDataMetadata=async function(e,t){let n=new De({url:`${Ka.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Ka._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new re(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new re("Not allowed, forbidden");if(i.statusCode===404)throw new re(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new re(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new re("Too many requests")}throw new re(`Unknown request failure ${i.statusCode}`)}};Ka.getRealityDataURL=async function(e,t,n){let i=new De({url:`${Ka.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Ka._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,a=new URL(r);return a.pathname=`${a.pathname}/${n}`,a.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let a=r.error.details?.[0].code??"";throw new re(`Unauthorized, bad token, wrong scopes or headers bad. ${a}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new re("Not allowed, forbidden");if(o.statusCode===404)throw new re(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new re(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new re("Too many requests")}throw new re(`Unknown request failure ${o.statusCode}`)}};var As=Ka;var rO={};rO.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await As.getExports(e,t);if(i.length>0&&i.every(c=>c.status===As.ExportStatus.Invalid))throw new re(`All exports for this iModel are Invalid: ${e}`);let o=i.find(c=>c.status===As.ExportStatus.Complete);if(!l(o))return;let r=new URL(o._links.mesh.href);r.pathname=`${r.pathname}/tileset.json`;let a=r.toString(),s=new De({url:a});return wa.fromUrl(s,n)};rO.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:o}){if(!l(n)||!l(i)){let c=await As.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![As.RealityDataType.Cesium3DTiles,As.RealityDataType.PNTS,As.RealityDataType.RealityMesh3DTiles,As.RealityDataType.Terrain3DTiles,As.RealityDataType.GaussianSplat3DTiles].includes(n))throw new re(`Reality data type is not a mesh type: ${n}`);let a=await As.getRealityDataURL(e,t,i),s={maximumScreenSpaceError:4,...o};return wa.fromUrl(a,s)};rO.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let a=await As.getRealityDataMetadata(e,t);i=a.rootDocument,n=a.type}if(![As.RealityDataType.KML,As.RealityDataType.GeoJSON].includes(n))throw new re(`Reality data type is not a data source type: ${n}`);let r=await As.getRealityDataURL(e,t,i);return n===As.RealityDataType.GeoJSON?bb.load(r):xS.load(r)};rO.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,o=`${As.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new De({url:o,headers:{Authorization:As._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return bb.load(r)};var IPe=rO;function DPe(){}Object.defineProperties(DPe.prototype,{color:{get:_e.throwInstantiationError},intensity:{get:_e.throwInstantiationError}});var PPe=DPe;var tBt=0,nBt=14,iBt=-1e3,oBt=1e4,rBt=2*Math.PI*te.WGS84.maximumRadius,aBt=256,sBt=new oe,cBt=new oe,Rne=class{constructor(t,n){n=n??{},this._resource=De.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=oe.clone(n.extent),this._minZoom=n.minZoom??tBt,this._maxZoom=n.maxZoom??nBt,this._featureIdProperty=n.featureIdProperty,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=lBt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await wa.fromUrl(i,this._createTilesetLoadOptions())}catch(o){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,o}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,fe(this)}};function lBt(e,t){let n=new Ir,i=l(t.extent)?oe.clone(t.extent):oe.clone(n.rectangle),o=fBt(n,i,t.minZoom),r={boundingVolume:{region:MPe(i)},geometricError:OPe(0),refine:"REPLACE",children:[]};for(let a=o.minY;a<=o.maxY;a++)for(let s=o.minX;s<=o.maxX;s++){let c=RPe(n,e,i,t.minZoom,t.maxZoom,s,a);l(c)&&r.children.push(c)}return r.children.length===0&&(r.geometricError=0),{asset:{version:"1.1"},geometricError:r.geometricError,root:r}}function RPe(e,t,n,i,o,r,a){if(!dBt(e,i,r,a,n,sBt,cBt))return;let s=e.tileXYToRectangle(r,a,i,new oe),c={boundingVolume:{region:MPe(s)},geometricError:i<o?OPe(i):0,refine:"REPLACE",content:{uri:uBt(t,i,r,a)}};if(i>=o)return c;let u=i+1,f=[];for(let d=a*2;d<=a*2+1;d++)for(let p=r*2;p<=r*2+1;p++){let g=RPe(e,t,n,u,o,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function uBt(e,t,n,i){let r=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return Jd(r)}function OPe(e){return rBt/((1<<e)*aBt)}function MPe(e){return[e.west,e.south,e.east,e.north,iBt,oBt]}function fBt(e,t,n){let i=(1<<n)-1,o=de.fromRadians(t.west,t.north),r=de.fromRadians(t.east,t.south),a=e.positionToTileXY(o,n),s=e.positionToTileXY(r,n);return!l(a)||!l(s)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:D.clamp(Math.min(a.x,s.x),0,i),maxX:D.clamp(Math.max(a.x,s.x),0,i),minY:D.clamp(Math.min(a.y,s.y),0,i),maxY:D.clamp(Math.max(a.y,s.y),0,i)}}function dBt(e,t,n,i,o,r,a){let s=e.tileXYToRectangle(n,i,t,r);return l(oe.intersection(s,o,a))}var NH=Rne;var One=0,BPe=new h,FH=new h,hBt=new Ir;function mBt(e,t,n){let i=t.tileX,o=t.tileY,r=t.tileZ,a=n?.featureIdProperty,s=hBt.tileXYToRectangle(i,o,r),c=oe.center(s),u=h.fromRadians(c.longitude,c.latitude,0),f=4294967295,d=f,p=f,g=new Map,m=new Map,A=[],y=[],x=[],b=0;function T(){let k=(4-b%4)%4;k>0&&(x.push(new Uint8Array(k)),b+=k)}function E(k,V){T();let F=b;x.push(new Uint8Array(k.buffer,k.byteOffset,k.byteLength)),b+=k.byteLength;let W=A.length;return A.push({buffer:0,byteOffset:F,byteLength:k.byteLength,target:V}),W}function S(k,V){let F=E(k,V.target),W=ht.getComponentCount(V.type),q={bufferView:F,byteOffset:0,componentType:V.componentType,count:k.length/W,type:V.type};l(V.min)&&(q.min=V.min),l(V.max)&&(q.max=V.max);let J=y.length;return y.push(q),J}function w(k){let V=Number.POSITIVE_INFINITY,F=Number.POSITIVE_INFINITY,W=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,J=Number.NEGATIVE_INFINITY,H=Number.NEGATIVE_INFINITY;for(let Z=0;Z<k.length;Z+=3){let K=k[Z],le=k[Z+1],me=k[Z+2];K<V&&(V=K),le<F&&(F=le),me<W&&(W=me),K>q&&(q=K),le>J&&(J=le),me>H&&(H=me)}return{min:[V,F,W],max:[q,J,H]}}function P(k,V,F){if(F.length===0)return;let W=new Uint32Array(F),q=S(W,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER});k._FEATURE_ID_0=q;let J={featureCount:g.size,nullFeatureId:d,attribute:0};m.size>0&&(J.propertyTable=0),V.EXT_mesh_features={featureIds:[J]}}function O(k,V){V=V??4;let F=(V-b%V)%V;F>0&&(x.push(new Uint8Array(F)),b+=F);let W=b;x.push(k),b+=k.byteLength;let q=A.length;return A.push({buffer:0,byteOffset:W,byteLength:k.byteLength}),q}function B(){if(m.size===0)return;let k=new Map;for(let q of m.values())for(let[J,H]of Object.entries(q)){if(!l(H))continue;let Z=typeof H,K;Z==="string"?K="STRING":Z==="number"?K="SCALAR":Z==="boolean"?K="BOOLEAN":K="STRING";let le=k.get(J);l(le)?le!==K&&k.set(J,"STRING"):k.set(J,K)}if(k.size===0)return;let V={};for(let[q,J]of k)J==="SCALAR"?V[q]={type:"SCALAR",componentType:"FLOAT64"}:J==="BOOLEAN"?V[q]={type:"BOOLEAN"}:V[q]={type:"STRING"};let F={},W=g.size;for(let[q,J]of k)if(J==="SCALAR"){let H=new Float64Array(W);for(let K=0;K<W;K++){let me=m.get(K)?.[q];H[K]=typeof me=="number"&&Number.isFinite(me)?me:NaN}let Z=O(new Uint8Array(H.buffer,H.byteOffset,H.byteLength),8);F[q]={values:Z}}else if(J==="BOOLEAN"){let H=Math.ceil(W/8),Z=new Uint8Array(H);for(let le=0;le<W;le++)m.get(le)?.[q]&&(Z[le>>3]|=1<<(le&7));let K=O(Z);F[q]={values:K}}else{let H=new TextEncoder,Z=[],K=new Uint32Array(W+1),le=0;for(let we=0;we<W;we++){K[we]=le;let Be=m.get(we)?.[q],ke;Be==null?ke="":typeof Be=="string"?ke=Be:ke=String(Be);let Ge=H.encode(ke);Z.push(Ge),le+=Ge.byteLength}K[W]=le;let me=new Uint8Array(le),ae=0;for(let we of Z)me.set(we,ae),ae+=we.byteLength;let be=O(me),ge=O(new Uint8Array(K.buffer,K.byteOffset,K.byteLength));F[q]={values:be,stringOffsets:ge,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:V}}},propertyTables:[{class:"mvt_feature",count:W,properties:F}]}}let L=[],_=[],C=[u.x,u.y,u.z];for(let k of e.layers){let V=k.extent,F=[],W=[],q=[],J=[],H=[],Z=0,K=[],le=[],me=[],ae=[],be=[],ge=[],we=[],Ee=0;for(let Ge of k.features){let rt=l(a)?gBt(Ge,a,g)??d:pBt(Ge,g);if(rt!==d&&!m.has(rt)){let et=Object.assign({},Ge.properties);et._layer=k.name??"",m.set(rt,et)}if(Ge.type==="Point"){let et=Ge.geometry;for(let Pe of et)Mne(Pe,i,o,r,V,One,u,F),W.push(rt);continue}if(Ge.type==="LineString"){let et=Ge.geometry;for(let Pe of et){let Ye=q.length/3;for(let ut of Pe)Mne(ut,i,o,r,V,One,u,q),J.push(rt);for(let ut=0;ut<Pe.length;ut++)H.push(Ye+ut);H.push(p),Z++}continue}if(Ge.type==="Polygon"){let et=Ge.geometry,Pe=_Bt(et);for(let Ye of Pe){let ut=[Ye.outerRing,...Ye.holes],Ct=[],en=[],Gt=[],yt=0;for(let st=0;st<ut.length;st++){let Ln=ut[st];st>0&&Gt.push(yt);for(let Nn of Ln)Ct.push(new z(Nn.x,Nn.y)),Mne(Nn,i,o,r,V,One,u,en),yt++}if(Ct.length<3)continue;let wt=ni.triangulate(Ct,Gt.length>0?Gt:void 0);if(!l(wt)||wt.length===0){_t("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let xn=K.length/3,at=me.length;ae.push(xn),be.push(at),ge.push(Gt.length);for(let st=0;st<Gt.length;st++)we.push(xn+Gt[st]);for(let st=0;st<en.length;st++)K.push(en[st]);for(let st=0;st<en.length/3;st++)le.push(rt);for(let st=0;st<wt.length;st++)me.push(wt[st]+xn);Ee++}}}if(F.length===0&&q.length===0&&K.length===0)continue;H.length>0&&H[H.length-1]===p&&H.pop();let Be=[];if(F.length>0){let Ge=new Float32Array(F),rt=w(Ge),Pe={POSITION:S(Ge,{type:"VEC3",componentType:Y.FLOAT,target:ee.ARRAY_BUFFER,min:rt.min,max:rt.max})},Ye={CESIUM_mesh_vector:{vector:!0,count:Ge.length/3}};P(Pe,Ye,W),Be.push({mode:Re.POINTS,attributes:Pe,extensions:Ye})}if(q.length>0&&H.length>1){let Ge=new Float32Array(q),rt=new Uint32Array(H),et=w(Ge),Pe=S(Ge,{type:"VEC3",componentType:Y.FLOAT,target:ee.ARRAY_BUFFER,min:et.min,max:et.max}),Ye=S(rt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ELEMENT_ARRAY_BUFFER}),ut={POSITION:Pe},Ct={CESIUM_mesh_vector:{vector:!0,count:Z}};P(ut,Ct,J),Be.push({mode:Re.LINE_STRIP,indices:Ye,attributes:ut,extensions:Ct})}if(K.length>0&&me.length>=3){let Ge=new Float32Array(K),rt=new Uint32Array(me),et=new Uint32Array(ae),Pe=new Uint32Array(be),Ye=we.length>0,ut=Ye?new Uint32Array(ge):void 0,Ct=Ye?new Uint32Array(we):void 0,en=w(Ge),Gt=S(Ge,{type:"VEC3",componentType:Y.FLOAT,target:ee.ARRAY_BUFFER,min:en.min,max:en.max}),yt=S(rt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ELEMENT_ARRAY_BUFFER}),wt=S(et,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}),xn=S(Pe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}),at=l(ut)?S(ut,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}):void 0,st=l(Ct)?S(Ct,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:ee.ARRAY_BUFFER}):void 0,Ln={POSITION:Gt},Nn={CESIUM_mesh_vector:{vector:!0,count:Ee,polygonAttributeOffsets:wt,polygonIndicesOffsets:xn}};Ye&&(Nn.CESIUM_mesh_vector.polygonHoleCounts=at,Nn.CESIUM_mesh_vector.polygonHoleOffsets=st),P(Ln,Nn,le),Be.push({mode:Re.TRIANGLES,indices:yt,attributes:Ln,extensions:Nn})}if(Be.length===0)continue;let ke=L.length;L.push({primitives:Be}),_.push({name:k.name,mesh:ke,translation:C})}if(_.length===0)return;let v=B(),I=bBt(x,b),M=["CESIUM_mesh_vector"];g.size>0&&M.push("EXT_mesh_features"),l(v)&&M.push("EXT_structural_metadata");let N=_.map((k,V)=>V),j={asset:{version:"2.0"},extensionsUsed:M,scene:0,scenes:[{nodes:N}],nodes:_,meshes:L,accessors:y,bufferViews:A,buffers:[{byteLength:I.byteLength}],extensions:void 0};return l(v)&&(j.extensions={EXT_structural_metadata:v}),xBt(j,I)}function pBt(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function gBt(e,t,n){let i=e.properties;if(!l(i))return;let o=i[t];if(!l(o)||typeof o!="string"&&typeof o!="number"&&typeof o!="boolean"||typeof o=="number"&&!Number.isFinite(o))return;let r=`${typeof o}:${o}`,a=n.get(r);return l(a)||(a=n.size,n.set(r,a)),a}function _Bt(e){let t=[];for(let n of e){let i=yBt(n);if(i.length<3)continue;ABt(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function ABt(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function yBt(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function Mne(e,t,n,i,o,r,a,s){let c=1<<i,u=(t+e.x/o)/c,f=(n+e.y/o)/c,d=u*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*f)));h.fromRadians(d,p,r,void 0,BPe),h.subtract(BPe,a,FH),s.push(FH.x,FH.y,FH.z)}function xBt(e,t){let a=new TextEncoder().encode(JSON.stringify(e)),s=Math.ceil(a.length/4)*4,c=new Uint8Array(s);c.fill(32),c.set(a);let u=Math.ceil(t.byteLength/4)*4,f=new Uint8Array(u);f.set(t);let d=20+s+8+u,p=new Uint8Array(d),g=new DataView(p.buffer),m=0;return g.setUint32(m,1179937895,!0),m+=4,g.setUint32(m,2,!0),m+=4,g.setUint32(m,d,!0),m+=4,g.setUint32(m,s,!0),m+=4,g.setUint32(m,1313821514,!0),m+=4,p.set(c,m),m+=s,g.setUint32(m,u,!0),m+=4,g.setUint32(m,5130562,!0),m+=4,p.set(f,m),p}function bBt(e,t){let n=new Uint8Array(t),i=0;for(let o of e)n.set(o,i),i+=o.byteLength;return n}var kH=mBt;var TBt=new TextDecoder,zH={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},CBt={LAYERS:3},aO={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},Bne={TAGS:2,TYPE:3,GEOMETRY:4},cT={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},EBt=["Unknown","Point","LineString","Polygon"];function vBt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let o=UH(t,i,t.length),r=o.fieldNumber,a=o.wireType;if(i=o.newPos,r===CBt.LAYERS&&a===2){let s=Bg(t,i,t.length);i=s.newPos;let c=ku(i,s.value,t.length,"layer");n.push(SBt(t,i,c)),i=c}else i=VH(t,i,a,t.length)}return{layers:n}}function SBt(e,t,n){let i=t,o="",r=4096,a=[],s=[],c=[];for(;i<n;){let f=UH(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===aO.NAME&&p===2){let g=Bg(e,i,n);i=g.newPos;let m=ku(i,g.value,n,"layer name");o=Nne(e,i,g.value),i=m}else if(d===aO.FEATURES&&p===2){let g=Bg(e,i,n);i=g.newPos;let m=ku(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===aO.KEYS&&p===2){let g=Bg(e,i,n);i=g.newPos;let m=ku(i,g.value,n,"key");a.push(Nne(e,i,g.value)),i=m}else if(d===aO.VALUES&&p===2){let g=Bg(e,i,n);i=g.newPos;let m=ku(i,g.value,n,"value"),A=DBt(e,i,m);s.push(A),i=m}else if(d===aO.EXTENT&&p===0){let g=nw(e,i,n);r=g.value,i=g.newPos}else i=VH(e,i,p,n)}let u=c.map(({start:f,end:d})=>wBt(e,f,d,a,s));return{name:o,extent:r,features:u}}function wBt(e,t,n,i,o){let r=t,a=zH.UNKNOWN,s=[],c=[];for(;r<n;){let d=UH(e,r,n),p=d.fieldNumber,g=d.wireType;if(r=d.newPos,p===Bne.TYPE&&g===0){let m=nw(e,r,n);a=m.value,r=m.newPos}else if(p===Bne.TAGS&&g===2){let m=Bg(e,r,n);r=m.newPos;let A=ku(r,m.value,n,"feature tags");for(;r<A;){let y=nw(e,r,A);s.push(y.value),r=y.newPos}}else if(p===Bne.GEOMETRY&&g===2){let m=Bg(e,r,n);r=m.newPos;let A=ku(r,m.value,n,"feature geometry");for(;r<A;){let y=nw(e,r,A);c.push(y.value),r=y.newPos}}else r=VH(e,r,g,n)}let u={};for(let d=0;d<s.length-1;d+=2){let p=i[s[d]],g=o[s[d+1]];typeof p!="string"||g===void 0||(u[p]=g)}let f=IBt(a,c);return{type:EBt[a]??"Unknown",geometry:f,properties:u}}function IBt(e,t){let n=0,i=0,o=0;if(e===zH.POINT){let r=[];for(;n<t.length;){let a=t[n++],s=a&7,c=a>>3;if(s===1)for(let u=0;u<c;u++)i+=$p(t[n++]),o+=$p(t[n++]),r.push({x:i,y:o})}return r}if(e===zH.LINESTRING){let r=[],a=null;for(;n<t.length;){let s=t[n++],c=s&7,u=s>>3;if(c===1)a!==null&&r.push(a),a=[],i+=$p(t[n++]),o+=$p(t[n++]),a.push({x:i,y:o});else if(c===2)for(let f=0;f<u;f++)i+=$p(t[n++]),o+=$p(t[n++]),a.push({x:i,y:o})}return a!==null&&r.push(a),r}if(e===zH.POLYGON){let r=[],a=null;for(;n<t.length;){let s=t[n++],c=s&7,u=s>>3;if(c===1)a!==null&&r.push(a),a=[],i+=$p(t[n++]),o+=$p(t[n++]),a.push({x:i,y:o});else if(c===2)for(let f=0;f<u;f++)i+=$p(t[n++]),o+=$p(t[n++]),a.push({x:i,y:o});else c===7&&a!==null&&a.length>0&&(a.push({x:a[0].x,y:a[0].y}),r.push(a),a=null)}return a!==null&&r.push(a),r}return[]}function DBt(e,t,n){let i=t;for(;i<n;){let o=UH(e,i,n),r=o.fieldNumber,a=o.wireType;if(i=o.newPos,r===cT.STRING&&a===2){let s=Bg(e,i,n);i=s.newPos;let c=ku(i,s.value,n,"string value");return Nne(e,i,c-i)}else{if(r===cT.FLOAT&&a===5)return ku(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(r===cT.DOUBLE&&a===1)return ku(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(r===cT.INT64&&a===0){let s=iw(e,i,n);return Lne(s.value)}else if(r===cT.UINT64&&a===0){let s=iw(e,i,n);return Lne(s.value)}else if(r===cT.SINT64&&a===0){let s=iw(e,i,n);return Lne(PBt(s.value))}else if(r===cT.BOOL&&a===0)return nw(e,i,n).value!==0}i=VH(e,i,a,n)}}function UH(e,t,n){let i=nw(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function nw(e,t,n){let i=iw(e,t,n,5);if(i.value>0xffffffffn)throw new re("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function Bg(e,t,n){let i=iw(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new re("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function iw(e,t,n,i){let o=0n,r=0n,a=0,s=i??10;for(;;){if(t>=n||t>=e.length)throw new re("Invalid MVT: truncated varint.");let c=e[t++];if(o|=BigInt(c&127)<<r,a++,(c&128)===0)break;if(a>=s)throw new re("Invalid MVT: varint is too long.");r+=7n}return{value:o,newPos:t}}function Nne(e,t,n){let i=ku(t,n,e.length,"string");return TBt.decode(e.subarray(t,i))}function ku(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new re(`Invalid MVT ${i}: invalid length.`);let o=e+t;if(!Number.isFinite(o)||o<e||o>n)throw new re(`Invalid MVT ${i}: length exceeds available bytes.`);return o}function VH(e,t,n,i){if(n===0)return iw(e,t,i).newPos;if(n===1)return ku(t,8,i,"fixed64 field");if(n===2){let o=Bg(e,t,i);return ku(o.newPos,o.value,i,"length-delimited field")}else if(n===5)return ku(t,4,i,"fixed32 field");throw new re(`Unsupported protobuf wire type: ${n}`)}function $p(e){return e>>>1^-(e&1)}function PBt(e){return e>>1n^-(e&1n)}function Lne(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var jH=vBt;var GH=class extends NH{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=Fi.Z,t._modelForwardAxis=Fi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,o,r)=>{let a=jH(r),s=LPe(o.getUrlComponent(!0)),c=kH(a,s,{featureIdProperty:t});if(!l(c)){if(!RBt(a))return new H0(n,i);throw new re("Decoded MVT tile did not produce vector glTF content.")}return Wx.fromGltf(n,i,o,c)}}}};function LPe(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(_t("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function RBt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}GH._parseTileCoordinates=LPe;var NPe=GH;var OBt=/\/$/,FPe=new xt('&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 ow(e){e=e??G.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=De.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let a=l(e.scaleFactor)?"@2x":"",s=i.getUrlComponent();OBt.test(s)||(s+="/"),s+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${a}`,i.url=s,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new xt(c))):c=FPe,this._resource=i,this._imageryProvider=new Ca({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(ow.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}}});ow.prototype.getTileCredits=function(e,t,n){};ow.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ow.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};ow._defaultCredit=FPe;var kPe=ow;function Fne(e){}Fne.prototype.isReady=function(){return!0};Fne.prototype.shouldDiscardImage=function(e){return!1};var zPe=Fne;var MBt=new xt("MapQuest, Open Street Map and contributors, CC-BY-SA");function HH(e){e=e??G.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Ir({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,a=e.maximumLevel,s=e.rectangle??n.rectangle,c=n.positionToTileXY(oe.southwest(s),r),u=n.positionToTileXY(oe.northeast(s),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??MBt;typeof d=="string"&&(d=new xt(d)),Ca.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:a,rectangle:s})}l(Object.create)&&(HH.prototype=Object.create(Ca.prototype),HH.prototype.constructor=HH);var py=HH;function UPe(){_e.throwInstantiationError()}Object.defineProperties(UPe.prototype,{show:{get:_e.throwInstantiationError,set:_e.throwInstantiationError},transform:{get:_e.throwInstantiationError},credit:{get:_e.throwInstantiationError}});var VPe=UPe;function WH(){_e.throwInstantiationError()}Object.defineProperties(WH.prototype,{});WH.fromUrl=function(e){_e.throwInstantiationError()};WH.prototype.loadPanorama=function(e){_e.throwInstantiationError()};var jPe=WH;var BBt=new z(1,1);function kne(e){e=e??G.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=U.clone(e.startColor??U.WHITE),this.endColor=U.clone(e.endColor??U.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=z.clone(e.imageSize??BBt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(kne.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var GPe=new h;kne.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,GPe),h.add(this.position,GPe,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 sO=kne;function HPe(e){e=e??G.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(HPe.prototype,{complete:{get:function(){return this._complete}}});var WPe=HPe;function qPe(e){}qPe.prototype.emit=function(e){_e.throwInstantiationError()};var YPe=qPe;var XPe=new z(1,1);function cO(e){e=e??G.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new mH(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=R.clone(e.modelMatrix??R.IDENTITY),this._emitterModelMatrix=R.clone(e.emitterModelMatrix??R.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new R,this._startColor=U.clone(e.color??e.startColor??U.WHITE),this._endColor=U.clone(e.color??e.endColor??U.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=z.clone(e.imageSize??e.minimumImageSize??XPe),this._maximumImageSize=z.clone(e.imageSize??e.maximumImageSize??XPe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=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 ye,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(cO.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||!R.equals(this._modelMatrix,e),R.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!R.equals(this._emitterModelMatrix,e),R.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){U.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){U.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 LBt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let d=o.length;for(let p=0;p<d;++p)i+=o[p].maximum}let r=e._billboardCollection,a=e.image,s=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(s-c.length-u.length,0);for(let d=0;d<f;++d){let p=new sO;p._billboard=r.add({image:a,show:!1}),u.push(p)}e._particleEstimate=s}function NBt(e){let t=e._particlePool.pop();return l(t)||(t=new sO),t}function FBt(e,t){e._particlePool.push(t)}function kBt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,a=e._particleEstimate,s=r-Math.max(a-o-r,0);for(let c=s;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=s}function zBt(e){l(e._billboard)&&(e._billboard.show=!1)}function KPe(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=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),a=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new U(i,o,r,a),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function UBt(e,t){t.startColor=U.clone(e._startColor,t.startColor),t.endColor=U.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function VBt(e,t){if(e._isComplete)return 0;t=D.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 a=e.bursts[r],s=e._currentTime;l(a)&&!a._complete&&s>a.time&&(i+=D.randomBetween(a.minimum,a.maximum),a._complete=!0)}}return i}var qH=new h;cO.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new dd),this._updateParticlePool&&(LBt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=Q.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,a,s=n.length;for(r=0;r<s;++r)a=n[r],a.update(t,o)?KPe(this,a):(zBt(a),FBt(this,a),n[r]=n[s-1],--r,--s);n.length=s;let c=VBt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=R.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)a=NBt(this),this._emitter.emit(a),h.add(a.position,a.velocity,qH),R.multiplyByPoint(u,qH,qH),a.position=R.multiplyByPoint(u,a.position,a.position),h.subtract(qH,a.position,a.velocity),h.normalize(a.velocity,a.velocity),UBt(this,a),KPe(this,a)}if(this._billboardCollection.update(e),this._previousTime=Q.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=D.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&kBt(this)};cO.prototype.isDestroyed=function(){return!1};cO.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),fe(this)};var QPe=cO;var zne=class{constructor(){lt(this,"quadtree");lt(this,"tilingScheme");lt(this,"errorEvent");_e.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){_e.throwInstantiationError()}beginUpdate(t,n,i){_e.throwInstantiationError()}endUpdate(t,n,i){_e.throwInstantiationError()}getLevelMaximumGeometricError(t){_e.throwInstantiationError()}loadTile(t,n,i){_e.throwInstantiationError()}computeTileVisibility(t,n,i){_e.throwInstantiationError()}showTileThisFrame(t,n,i,o){_e.throwInstantiationError()}computeDistanceToTile(t,n){_e.throwInstantiationError()}isDestroyed(){_e.throwInstantiationError()}destroy(){_e.throwInstantiationError()}},$Pe=zne;function Une(e){e=e??1,this._radius=e??1}Object.defineProperties(Une.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Une.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),a=i*Math.cos(n);e.position=h.fromElements(o,r,a,e.position),e.velocity=h.normalize(e.position,e.velocity)};var JPe=Une;function lO(){}lO.prototype.evaluate=function(e,t){_e.throwInstantiationError()};lO.prototype.evaluateColor=function(e,t){_e.throwInstantiationError()};lO.prototype.getShaderFunction=function(e,t,n,i){_e.throwInstantiationError()};lO.prototype.getVariables=function(){_e.throwInstantiationError()};var ZPe=lO;var YH={};YH.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let a,s,c;t?(a=n<e,s=i<e,c=o<e):(a=n>e,s=i>e,c=o>e);let u=a+s+c,f,d,p,g,m,A;return u===1?a?(f=(e-n)/(i-n),d=(e-n)/(o-n),r.push(1),r.push(2),d!==1&&(r.push(-1),r.push(0),r.push(2),r.push(d)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):s?(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&&(m=(e-o)/(n-o),A=(e-o)/(i-o),r.push(0),r.push(1),A!==1&&(r.push(-1),r.push(2),r.push(1),r.push(A)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!a&&n!==e?(g=(e-i)/(n-i),m=(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(m)):!s&&i!==e?(A=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(A),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(d=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(d),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};YH.computeBarycentricCoordinates=function(e,t,n,i,o,r,a,s,c){let u=n-a,f=a-o,d=r-s,p=i-s,g=1/(d*u+f*p),m=t-s,A=e-a,y=(d*A+f*m)*g,x=(-p*A+u*m)*g,b=1-y-x;return l(c)?(c.x=y,c.y=x,c.z=b,c):new h(y,x,b)};YH.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,a,s,c){let u=(a-o)*(t-r)-(s-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),d=(s-r)*(n-e)-(a-o)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new z),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Jp=YH;function gy(e){e=e??G.EMPTY_OBJECT,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(a,s){return i[a]-i[s]}function r(a,s){return n[a]-n[s]}this._westIndices=KH(e.westIndices,o,t),this._southIndices=KH(e.southIndices,r,t),this._eastIndices=KH(e.eastIndices,o,t),this._northIndices=KH(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(gy.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 XH=[];function KH(e,t,n){XH.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)XH[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(XH.sort(t),Ue.createTypedArray(n,XH)):e}var e1e="createVerticesFromQuantizedTerrainMesh",jBt=new Wn(e1e),GBt=new Wn(e1e,Ef.maximumAsynchronousTasks);gy.prototype.createMesh=function(e){e=e??G.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),d=(s?GBt:jBt).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:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:a});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,A=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,y=Ue.createTypedArray(A,g.indices),x=new Float32Array(g.vertices),b=g.center,T=g.minimumHeight,E=g.maximumHeight,S=p._boundingSphere,w=p._orientedBoundingBox,P=h.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,O=g.vertexStride,B=yr.clone(g.encoding);return p._mesh=new vc(b,x,y,g.indexCountWithoutSkirts,m,T,E,u,S,P,O,w,B,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 HBt=new Wn("upsampleQuantizedTerrainMesh",Ef.maximumAsynchronousTasks);gy.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,a),p=HBt.scheduleTask({vertices:s.vertices,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});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 m=c?g*.5:this._westSkirtHeight,A=u?g*.5:this._southSkirtHeight,y=c?this._eastSkirtHeight:g*.5,x=u?this._northSkirtHeight:g*.5,b=this._credits;return Promise.resolve(p).then(function(T){let E=new Uint16Array(T.vertices),S=Ue.createTypedArray(E.length/3,T.indices),w;return l(T.encodedNormals)&&(w=new Uint8Array(T.encodedNormals)),new gy({quantizedVertices:E,indices:S,encodedNormals:w,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ce.clone(T.boundingSphere),orientedBoundingBox:$t.clone(T.orientedBoundingBox),horizonOcclusionPoint:h.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:m,southSkirtHeight:A,eastSkirtHeight:y,northSkirtHeight:x,childTileMask:0,credits:b,createdByUpsampling:!0})})};var Vne=32767,t1e=new h;gy.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=Vne;let o=D.clamp((n-e.south)/e.height,0,1);return o*=Vne,l(this._mesh)?XBt(this,i,o):KBt(this,i,o)};function n1e(e,t,n,i,o,r,a,s){let c=Math.min(n,o,a),u=Math.max(n,o,a),f=Math.min(i,r,s),d=Math.max(i,r,s);return e>=c&&e<=u&&t>=f&&t<=d}var WBt=new z,qBt=new z,YBt=new z;function XBt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,a=i.indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],d=a[s+2],p=r.decodeTextureCoordinates(o,u,WBt),g=r.decodeTextureCoordinates(o,f,qBt),m=r.decodeTextureCoordinates(o,d,YBt);if(n1e(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let A=Jp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,t1e);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let y=r.decodeHeight(o,u),x=r.decodeHeight(o,f),b=r.decodeHeight(o,d);return A.x*y+A.y*x+A.z*b}}}}function KBt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,a=e._indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],d=a[s+2],p=i[u],g=i[f],m=i[d],A=o[u],y=o[f],x=o[d];if(n1e(t,n,p,A,g,y,m,x)){let b=Jp.computeBarycentricCoordinates(t,n,p,A,g,y,m,x,t1e);if(b.x>=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){let T=b.x*r[u]+b.y*r[f]+b.z*r[d];return D.lerp(e._minimumHeight,e._maximumHeight,T/Vne)}}}}gy.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};gy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var rw=gy;function cw(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var lT=new oe;function QBt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let a=i[r];if(a.x===t&&a.y===n&&a.level===e)return!0}return!1}cw.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,a=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)QBt(e,g,p,a)||a.push(new aw(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,lT);let s=lT.west,c=lT.north;r.tileXYToRectangle(i,o,e,lT);let u=lT.east,f=lT.south,d=new tLt(e,s,f,u,c);for(let p=0;p<a.length;++p){let g=a[p];jne(g.extent,d)&&nLt(this._maximumLevel,g,d)}};cw.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(sw(i.extent,e)){t=i;break}}return l(t)?uO(void 0,t,e):-1};var $Bt=[],JBt=[],ZBt=new oe,eLt=new oe;cw.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=$Bt;t.length=0,e.east<e.west?(t.push(oe.fromRadians(-Math.PI,e.south,e.east,e.north,ZBt)),t.push(oe.fromRadians(e.west,e.south,Math.PI,e.north,eLt))):t.push(e);let n=JBt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)fO(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 i1e=new de;cw.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,lT);return oe.center(i,i1e),this.computeMaximumLevelAtPosition(i1e)>=e};cw.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 aw(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(aw.prototype,{nw:{get:function(){return this._nw||(this._nw=new aw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new aw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new aw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new aw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function tLt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function jne(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 nLt(e,t,n){for(;t.level<e;)if(QH(t.nw.extent,n))t=t.nw;else if(QH(t.ne.extent,n))t=t.ne;else if(QH(t.sw.extent,n))t=t.sw;else if(QH(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=Ao(t.rectangles,n.level,iLt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function iLt(e,t){return e.level-t}function QH(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function sw(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function uO(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&sw(t._nw.extent,n),a=t._ne&&sw(t._ne.extent,n),s=t._sw&&sw(t._sw.extent,n),c=t._se&&sw(t._se.extent,n);if(r+a+s+c>1){r&&(i=Math.max(i,uO(t,t._nw,n))),a&&(i=Math.max(i,uO(t,t._ne,n))),s&&(i=Math.max(i,uO(t,t._sw,n))),c&&(i=Math.max(i,uO(t,t._se,n)));break}else r?t=t._nw:a?t=t._ne:s?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let a=r.length-1;a>=0&&r[a].level>i;--a){let s=r[a];sw(s,n)&&(i=s.level)}t=t.parent}return i}function fO(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||jne(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let a=r[i];e[a.level]||(e[a.level]=n),e[a.level]=oLt(e[a.level],a)}fO(e,t._nw,n),fO(e,t._ne,n),fO(e,t._sw,n),fO(e,t._se,n)}function oLt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];jne(o,t)?(o.west<t.west&&n.push(new oe(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new oe(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new oe(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new oe(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Zp=cw;function rLt(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 r1e(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??te.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=[]}r1e.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 a1e(e,t,n){if(!t.format){let A="The tile format is not specified in the layer.json file.";throw e.previousError=Qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new re(A)}if(!t.tiles||t.tiles.length===0){let A="The layer.json file does not specify any tile URL templates.";throw e.previousError=Qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new re(A)}let i=!1,o=!1,r=!1,a=!0,s=!1;if(t.format==="heightmap-1.0")s=!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 A=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new re(A)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!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 Ir({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let A=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new re(A)}if(e.levelZeroMaximumGeometricError=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let A=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,A),new re(A)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,a=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new Zp(e.tilingScheme,p.length);for(let A=0;A<p.length;++A){let y=p[A],x=e.tilingScheme.getNumberOfYTilesAtLevel(A);l(e.overallAvailability[A])||(e.overallAvailability[A]=[]);for(let b=0;b<y.length;++b){let T=y[b],E=x-T.endY-1,S=x-T.startY-1;e.overallAvailability[A].push([T.startX,E,T.endX,S]),g.addAvailableTileRange(A,T.startX,E,T.endX,S)}}}else l(d)&&(f=new Zp(e.tilingScheme,u),g=new Zp(e.tilingScheme,u),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 rLt({resource:e.lastResource,version:t.version,isHeightmap:s,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:a}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await Wne(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function aLt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
  15826. ${t.message}`),e.previousError=Qo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return Wne(e,n);throw new re(i)}async function sLt(e,t,n){await a1e(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Zp(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let a=e.overallAvailability[r];for(let s=0;s<a.length;++s){let c=a[s];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new xt(e.attribution);e.tileCredits.push(o)}return!0}async function Wne(e,t){try{let n=await e.layerJsonResource.fetchJson();return sLt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await a1e(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):aLt(e,n,t)}}function fm(e){e=e??G.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=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new ye;let t=e.credit;typeof t=="string"&&(t=new xt(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 Gne={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function o1e(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 cLt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new ol({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 lLt(e,t,n,i,o,r){let a=r.littleEndianExtensionSize,s=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,A=Uint16Array.BYTES_PER_ELEMENT,y=A*m,x=new DataView(t),b=new h(x.getFloat64(s,!0),x.getFloat64(s+8,!0),x.getFloat64(s+16,!0));s+=f;let T=x.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;let E=x.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;let S=new ce(new h(x.getFloat64(s,!0),x.getFloat64(s+8,!0),x.getFloat64(s+16,!0)),x.getFloat64(s+f,!0));s+=d;let w=new h(x.getFloat64(s,!0),x.getFloat64(s+8,!0),x.getFloat64(s+16,!0));s+=f;let P=x.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let O=new Uint16Array(t,s,P*3);s+=P*g,P>64*1024&&(A=Uint32Array.BYTES_PER_ELEMENT,y=A*m);let B=O.subarray(0,P),L=O.subarray(P,2*P),_=O.subarray(P*2,3*P);on.zigZagDeltaDecode(B,L,_),s%A!==0&&(s+=A-s%A);let C=x.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let v=Ue.createTypedArrayFromArrayBuffer(P,t,s,C*m);s+=C*y;let I=0,M=v.length;for(let ae=0;ae<M;++ae){let be=v[ae];v[ae]=I-be,be===0&&++I}let N=x.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let j=Ue.createTypedArrayFromArrayBuffer(P,t,s,N);s+=N*A;let k=x.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let V=Ue.createTypedArrayFromArrayBuffer(P,t,s,k);s+=k*A;let F=x.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let W=Ue.createTypedArrayFromArrayBuffer(P,t,s,F);s+=F*A;let q=x.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let J=Ue.createTypedArrayFromArrayBuffer(P,t,s,q);s+=q*A;let H,Z;for(;s<x.byteLength;){let ae=x.getUint8(s,!0);s+=Uint8Array.BYTES_PER_ELEMENT;let be=x.getUint32(s,a);if(s+=Uint32Array.BYTES_PER_ELEMENT,ae===Gne.OCT_VERTEX_NORMALS&&e._requestVertexNormals)H=new Uint8Array(t,s,P*2);else if(ae===Gne.WATER_MASK&&e._requestWaterMask)Z=new Uint8Array(t,s,be);else if(ae===Gne.METADATA&&e._requestMetadata){let ge=x.getUint32(s,!0);if(ge>0){let Ee=Sr(new Uint8Array(t),s+Uint32Array.BYTES_PER_ELEMENT,ge).available;if(l(Ee))for(let Be=0;Be<Ee.length;++Be){let ke=n+Be+1,Ge=Ee[Be],rt=e._tilingScheme.getNumberOfYTilesAtLevel(ke);for(let et=0;et<Ge.length;++et){let Pe=Ge[et],Ye=rt-Pe.endY-1,ut=rt-Pe.startY-1;e.availability.addAvailableTileRange(ke,Pe.startX,Ye,Pe.endX,ut),r.availability.addAvailableTileRange(ke,Pe.startX,Ye,Pe.endX,ut)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}s+=be}let K=e.getLevelMaximumGeometricError(n)*5,le=e._tilingScheme.tileXYToRectangle(i,o,n),me=$t.fromRectangle(le,T,E,e._tilingScheme.ellipsoid);return new rw({center:b,minimumHeight:T,maximumHeight:E,boundingSphere:S,orientedBoundingBox:me,horizonOcclusionPoint:w,quantizedVertices:O,encodedNormals:H,indices:v,westIndices:j,southIndices:V,eastIndices:W,northIndices:J,westSkirtHeight:K,southSkirtHeight:K,eastSkirtHeight:K,northSkirtHeight:K,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:Z,credits:e._tileCredits})}fm.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,a=o.length,s=!1,c=Promise.resolve();if(a===1)r=o[0];else for(let u=0;u<a;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let d=qne(this,e,t,n,f,u===0);d.result&&(s=!0,c=c.then(()=>d.promise))}return!l(r)&&s?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):s1e(this,e,t,n,r,i)};function s1e(e,t,n,i,o,r){if(!l(o))return Promise.reject(new re("Terrain tile doesn't exist"));let a=o.tileUrlTemplates;if(a.length===0)return;let s;!e._scheme||e._scheme==="tms"?s=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:s=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 u,f,d=a[(t+s+i)%a.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=o1e(void 0)):u=o1e(c);let g=p.getDerivedResource({url:d,templateValues:{version:o.version,z:i,x:t,y:s},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?cLt(e,m,i,t,n):lLt(e,m,i,t,n,o):Promise.reject(new re("Mesh buffer doesn't exist."))})}Object.defineProperties(fm.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}}});fm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};fm.fromIonAssetId=async function(e,t){let n=await ya.fromAssetId(e);return fm.fromUrl(n,t)};fm.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new r1e(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Wne(i);let o=new fm(t);return i.build(o),o};fm.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(qne(this,e,t,n,i[r],r===0).result)return;return!1};fm.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 a=qne(this,e,t,n,i[r],r===0);if(l(a.promise))return a.promise}};function Hne(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,a=1<<i-r,s=t/a|0,c=n/a|0;return{level:r,x:s,y:c}}function qne(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let a,s=function(){delete o.availabilityPromiseCache[a]},c=o.availabilityTilesLoaded,u=o.availability,f=Hne(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!r&&(a=`${f.level}-${f.x}-${f.y}`,d=o.availabilityPromiseCache[a],!l(d))){let p=new Cr({throttle:!1,throttleByServer:!0,type:ts.TERRAIN});d=s1e(e,f.x,f.y,f.level,o,p),l(d)&&(o.availabilityPromiseCache[a]=d,d.then(s))}return{result:!0,promise:d}}f=Hne(o,f.x,f.y,f.level)}return{result:!1}}fm._getAvailabilityTile=Hne;var lw=fm;function uLt(e){return e=e??G.EMPTY_OBJECT,lw.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var $H=uLt;function fLt(e){return e=e??G.EMPTY_OBJECT,lw.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:te.WGS84})}var uw=fLt;function fw(e){this._ready=!1,this._provider=void 0,this._errorEvent=new ye,this._readyEvent=new ye,hLt(this,e)}Object.defineProperties(fw.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}}});fw.fromWorldTerrain=function(e){return new fw(uw(e))};fw.fromWorldBathymetry=function(e){return new fw($H(e))};function dLt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function hLt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){dLt(e._errorEvent,i)}}var JH=fw;function dw(){}dw.prototype.boundingVolume=void 0;dw.prototype.boundingSphere=void 0;dw.prototype.distanceToCamera=function(e){_e.throwInstantiationError()};dw.prototype.intersectPlane=function(e){_e.throwInstantiationError()};dw.prototype.createDebugVolume=function(e){_e.throwInstantiationError()};var c1e=dw;function dO(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Yi({ellipsoid:e.ellipsoid}),this._color=e.color??U.YELLOW,this._errorEvent=new ye,this._tileWidth=e.tileWidth??256,this._tileHeight=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(dO.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}}});dO.prototype.getTileCredits=function(e,t,n){};dO.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=a,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};dO.prototype.pickFeatures=function(e,t,n,i,o){};var ZH=dO;function Yne(e){_e.throwInstantiationError()}Yne.prototype.isReady=_e.throwInstantiationError;Yne.prototype.shouldDiscardImage=_e.throwInstantiationError;var l1e=Yne;var u1e={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(u1e);var f1e=u1e;function e5(e,t){this.show=!0,l(e)||(e=new Je),this.rectangle=Je.clone(e),l(t)||(t=qi.fromType(qi.ColorType,{color:new U(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}e5.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Je.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:Jt.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 He({sources:[this._material.shaderSource,dH]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ie.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};e5.prototype.isDestroyed=function(){return!1};e5.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),fe(this)};var d1e=e5;var Xne=class{constructor(){lt(this,"globalTransform");lt(this,"shapeTransform");lt(this,"shape");lt(this,"minBounds");lt(this,"maxBounds");lt(this,"dimensions");lt(this,"paddingBefore");lt(this,"paddingAfter");lt(this,"names");lt(this,"types");lt(this,"componentTypes");lt(this,"minimumValues");lt(this,"maximumValues");lt(this,"maximumTileCount");lt(this,"availableLevels");lt(this,"keyframeCount");lt(this,"timeIntervalCollection");_e.throwInstantiationError()}requestData(t){_e.throwInstantiationError()}},h1e=Xne;function Lg(){_e.throwInstantiationError()}Object.defineProperties(Lg.prototype,{orientedBoundingBox:{get:_e.throwInstantiationError},boundingSphere:{get:_e.throwInstantiationError},boundTransform:{get:_e.throwInstantiationError},shapeTransform:{get:_e.throwInstantiationError},shaderUniforms:{get:_e.throwInstantiationError},shaderDefines:{get:_e.throwInstantiationError},shaderMaximumIntersectionsLength:{get:_e.throwInstantiationError}});Lg.prototype.update=_e.throwInstantiationError;Lg.prototype.updateViewTransforms=_e.throwInstantiationError;Lg.prototype.convertLocalToShapeUvSpace=_e.throwInstantiationError;Lg.prototype.computeOrientedBoundingBoxForTile=_e.throwInstantiationError;Lg.prototype.computeOrientedBoundingBoxForSample=_e.throwInstantiationError;Lg.DefaultMinBounds=_e.throwInstantiationError;Lg.DefaultMaxBounds=_e.throwInstantiationError;var m1e=Lg;var mLt=new U,pLt=new U,gLt=new U,_Lt=new U,p1e=new se,hO=new Uint8Array(4);function g1e(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return U.lerp(t.color,n.color,o,i)}function t5(e,t){return{height:e,color:U.clone(t)}}function _1e(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,a=o?t.height===i[n-1].height:!0,s=r?t.height===i[n+1].height:!0;return!a||!s}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,a=o?U.equals(t.color,i[n-1].color):!1,s=r?U.equals(t.color,i[n+1].color):!1;return!a||!s}),e=e.filter(function(t,n,i){let o=n>0,r=o?U.equals(t.color,i[n-1].color):!1,a=o?t.height===i[n-1].height:!0;return!r||!a}),e}function ALt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],a=r.entries,s=a.length,c=[];for(n=0;n<s;n++){let g=a[n],m=D.clamp(g.height,zu._minimumHeight,zu._maximumHeight),A=U.clone(g.color,mLt);A.red*=A.alpha,A.green*=A.alpha,A.blue*=A.alpha,c.push(t5(m,A))}let u=!0,f=!0;for(n=0;n<s-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||xg(c,function(g,m){return D.sign(g.height-m.height)});let d=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,t5(zu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,t5(zu._maximumHeight,c[c.length-1].color)),c=_1e(c),i.push(c)}return i}function yLt(e){let t=ALt(e),n=[],i=[],o;function r(u,f){n.push(t5(u,f))}function a(u,f,d){let p=U.multiplyByScalar(d,1-f.alpha,_Lt);p=U.add(p,f,p),r(u,p)}let s=t.length;for(o=0;o<s;o++){let u=t[o],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,A=f>0?u[f-1]:void 0,y=f<p-1?u[f+1]:void 0,x=d<g?i[d]:void 0,b=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(m)&&l(x)&&m.height===x.height){let E=l(T)&&x.height===T.height,S=!l(b),w=!l(T),P=l(y)&&m.height===y.height,O=!l(A),B=!l(y);E?P?(a(m.height,m.color,x.color),a(m.height,y.color,T.color)):O?(r(m.height,x.color),a(m.height,m.color,T.color)):B?(a(m.height,m.color,x.color),r(m.height,T.color)):(a(m.height,m.color,x.color),a(m.height,m.color,T.color)):S?P?(r(m.height,m.color),a(m.height,y.color,x.color)):B?(r(m.height,m.color),r(m.height,x.color)):(O||r(m.height,m.color),a(m.height,m.color,x.color)):w?P?(a(m.height,m.color,x.color),r(m.height,y.color)):O?(r(m.height,x.color),r(m.height,m.color)):B?a(m.height,m.color,x.color):(a(m.height,m.color,x.color),r(m.height,m.color)):P?(a(m.height,m.color,x.color),a(m.height,y.color,x.color)):O?(r(m.height,x.color),a(m.height,m.color,x.color)):B?(a(m.height,m.color,x.color),r(m.height,x.color)):a(m.height,m.color,x.color),f+=P?2:1,d+=E?2:1}else if(l(m)&&l(x)&&l(b)&&m.height<x.height){let E=g1e(m.height,b,x,gLt);l(A)?l(y)?a(m.height,m.color,E):(a(m.height,m.color,E),r(m.height,E)):(r(m.height,E),a(m.height,m.color,E)),f++}else if(l(x)&&l(m)&&l(A)&&x.height<m.height){let E=g1e(x.height,A,m,pLt);l(b)?l(T)?a(x.height,E,x.color):(a(x.height,E,x.color),r(x.height,E)):(r(x.height,E),a(x.height,E,x.color)),d++}else l(m)&&(!l(x)||m.height<x.height)?(l(x)&&!l(b)&&!l(y)?(r(m.height,m.color),r(m.height,zu._emptyColor),r(x.height,zu._emptyColor)):(!l(x)&&l(b)&&!l(A)&&(r(b.height,zu._emptyColor),r(m.height,zu._emptyColor)),r(m.height,m.color)),f++):l(x)&&(!l(m)||x.height<m.height)&&(r(x.height,x.color),d++)}}return _1e(n)}function zu(e){let{scene:t,layers:n}=e??G.EMPTY_OBJECT,{context:i}=t,o=yLt(n),r=o.length,a,s,c;if(!zu._useFloatTexture(i)){s=je.UNSIGNED_BYTE,c=Xe.RGBA,a=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,p1e),se.pack(p1e,a,g*4)}else{s=je.FLOAT,c=i.webgl2?Xe.RED:Xe.LUMINANCE,a=new Float32Array(r);for(let g=0;g<r;g++)a[g]=o[g].height}let f=Dt.create({context:i,pixelFormat:c,pixelDatatype:s,source:{arrayBufferView:a,width:r,height:1},sampler:new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.NEAREST,magnificationFilter:ti.NEAREST})}),d=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(hO),d[g*4+0]=hO[0],d[g*4+1]=hO[1],d[g*4+2]=hO[2],d[g*4+3]=hO[3];let p=Dt.create({context:i,pixelFormat:Xe.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:new jt({wrapS:un.CLAMP_TO_EDGE,wrapT:un.CLAMP_TO_EDGE,minificationFilter:Vt.LINEAR,magnificationFilter:ti.LINEAR})});return qi.fromType("ElevationBand",{heights:f,colors:p})}zu._useFloatTexture=function(e){return e.floatingPointTexture};zu._maximumHeight=5906376425472;zu._minimumHeight=-5906376425472;zu._emptyColor=new U(0,0,0,0);var A1e=zu;async function xLt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??G.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||_t("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??Ps.defaultApiKey;if(!l(n))return bLt(t);let i,o=Ps.getDefaultCredit();l(o)&&(i=[o]);let r=new De({url:`${Ps.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return wa.fromUrl(r,t)}var y1e={};async function bLt(e){let i=y1e[2275207];l(i)||(i=ya.fromAssetId(2275207),y1e[2275207]=i);let o=await i;return wa.fromUrl(o,e)}var x1e=xLt;async function TLt(e){let t=await wa.fromIonAssetId(96188,e);e=e??G.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??U.WHITE).toCssColorString();n=new sA({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var b1e=TLt;function CLt(e){e=e??G.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=R.clone(e.modelMatrix??R.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Bt({geometry:kn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Yt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Bt({geometry:kn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Yt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Bt({geometry:kn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Yt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Pn({asynchronous:!1,geometryInstances:t,appearance:new hn({flat:!0,translucent:!1})})}var T1e=CLt;var ELt=15;function C1e(e){this.ellipsoid=e.ellipsoid??te.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}C1e.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 vLt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new xt(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,a={ellipsoid:e.ellipsoid};if(o===4326)a.rectangle=oe.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Yi(a);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),a.rectangleSouthwestInMeters=new z(r.xmin,r.ymin),a.rectangleNortheastInMeters=new z(r.xmax,r.ymax),e.tilingScheme=new Ir(a)}else throw new re("Invalid spatial reference");let s=t.tileInfo;if(!l(s))throw new re("tileInfo is required");e.width=s.rows+1,e.height=s.cols+1,e.encoding=s.format==="LERC"?Jh.LERC:Jh.NONE,e.lodCount=s.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Zp(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Zp(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=zo.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 SLt(e,t,n){try{let i=await t.fetchJson();vLt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Qo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function _y(e){e=e??G.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 ye}Object.defineProperties(_y.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}}});_y.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new C1e(t);await SLt(o,i);let r=new _y(t);return o.build(r),r._resource=n,r};_y.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,a=Promise.resolve(!0),s;if(r&&!l(Kne(this,n+1,e*2,t*2))){let d=E1e(this,n+1,e*2,t*2);a=d.promise,s=d.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(a))return;let u=this,f=this._tilesAvailable;return Promise.all([c,a]).then(function(d){return new ol({buffer:d[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):ELt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(s)&&s.state===Ai.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Ai.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function Kne(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}_y.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};_y.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=Kne(this,n,e,t);if(l(i))return i;E1e(this,n,e,t)};_y.prototype.loadTileDataAvailability=function(e,t,n){};function wLt(e,t,n,i){let o=t-1,r=n-1,a=i[e.y*t+e.x],s=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new z(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==a){f=!0;break}f?(s.push(new z(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let A=e.x;A<=p;++A)if(i[m+A]!==a){d=!0;break}d?(s.push(new z(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:s,range:c,value:a}}function ILt(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 s=[new z(0,0)];for(;s.length>0;){let c=s.pop(),u=wLt(c,n,i,o);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,r.push(d)}let f=u.endingIndices;f.length>0&&(s=s.concat(f))}return r}function E1e(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,a=Math.min(1<<t,128),s=`tilemap/${t}/${r}/${o}/${a}/${a}`,c=e._availableCache;if(l(c[s]))return c[s];let u=new Cr({throttle:!1,throttleByServer:!0,type:ts.TERRAIN}),d=e._resource.getDerivedResource({url:s,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=ILt(o,r,a,a,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+a,r+a);let m=e._tilesAvailable;for(let A=0;A<g.length;++A){let y=g[A];m.addAvailableTileRange(t,y.startX,y.startY,y.endX,y.endY)}return Kne(e,t,n,i)}),c[s]={promise:d,request:u},d=d.finally(function(p){return delete c[s],p}),{promise:d,request:u}):{}}var v1e=_y;var S1e="https://dev.virtualearth.net/REST/v1/Locations";function Qne(e){e=e??G.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:S1e,queryParameters:n}),this._credit=new xt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(Qne.prototype,{url:{get:function(){return S1e}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});Qne.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,a=r[0],s=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:oe.fromDegrees(s,a,u,c)}})})};var w1e=Qne;function $ne(){}Object.defineProperties($ne.prototype,{credit:{get:function(){}}});$ne.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 a=0;a<t.length;++a){let s=t[a].match(r);r.test(t[a])&&s.length===3&&(/^[ns]/i.test(s[2])?i=/^[n]/i.test(s[2])?+s[1]:-s[1]:/^[ew]/i.test(s[2])&&(n=/^[e]/i.test(s[2])?+s[1]:-s[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 I1e=$ne;var DLt=new se,D1e=new h,hw=new h;function PLt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],a=t[1];return function(s,c){l(c)||(c=new h);let u=(s-i)*o;return h.lerp(r,a,u,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[r])/(n[r+1]-n[r]),s=DLt;s.z=a,s.y=a*a,s.x=s.y*a,s.w=1;let c,u,f,d,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,D1e),h.multiplyByScalar(d,.5,d),p=R.multiplyByVector(yx.hermiteCoefficientMatrix,s,s)):r===t.length-2?(c=t[r],u=t[r+1],d=e.lastTangent,f=h.subtract(u,t[r-1],D1e),h.multiplyByScalar(f,.5,f),p=R.multiplyByVector(yx.hermiteCoefficientMatrix,s,s)):(c=t[r-1],u=t[r],f=t[r+1],d=t[r+2],p=R.multiplyByVector(Ay.catmullRomCoefficientMatrix,s,s)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(u,p.y,hw),h.add(o,hw,o),h.multiplyByScalar(f,p.z,hw),h.add(o,hw,o),h.multiplyByScalar(d,p.w,hw),h.add(o,hw,o)}}var RLt=new h,OLt=new h;function Ay(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=RLt,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=OLt,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=PLt(this),this._lastTimeIndex=0}Object.defineProperties(Ay.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}}});Ay.catmullRomCoefficientMatrix=new R(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Ay.prototype.findTimeInterval=To.prototype.findTimeInterval;Ay.prototype.wrapTime=To.prototype.wrapTime;Ay.prototype.clampTime=To.prototype.clampTime;Ay.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var P1e=Ay;var Jne={},MLt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},BLt=new de,LLt=new h,NLt=new R,FLt=new R,kLt=new R,zLt=new h,ULt=new h,VLt=new h,jLt=new h,GLt=new de,HLt=new z,mO=new h,WLt=new z,qLt=new h,YLt=new h,n5=function(e,t){return e-t};Jne.createMesh=async function(e){e=e??G.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:o,gltf:r,minimumHeight:a,maximumHeight:s,skirtHeight:c}=e,f=t!==1,d=ce.clone(e.boundingSphere,new ce),p=$t.clone(e.orientedBoundingBox,new $t),g=h.clone(e.horizonOcclusionPoint,new h),m=te.clone(e.ellipsoid,new te),A=oe.clone(e.rectangle,new oe);await(r.extensionsRequired!==void 0&&r.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?S_.ready:Promise.resolve(void 0));let b=A.west,T=A.south,E=A.north,S=A.width,w=A.height,P=oe.center(A,BLt);P.height=.5*(a+s);let O=de.toCartesian(P,m,LLt),B=pt.eastNorthUpToFixedFrame(O,m,NLt),L=R.inverseTransformation(B,FLt),_=R.unpack(r.nodes[0].matrix,0,kLt);_=R.multiply(Fi.Y_UP_TO_Z_UP,_,_);let C=SNt(r,i,MLt),v=zo.getSkirtVertexCount(C.edgeIndicesWest,C.edgeIndicesSouth,C.edgeIndicesEast,C.edgeIndicesNorth),I=C.positions,M=C.normals,N=C.indices,j=I.length/3,k=j+v,V=N.length,F=zo.getSkirtIndexCountWithFilledCorners(v),W=k<=65535?Uint16Array:Uint32Array,q=new W(V+F);q.set(N);let J=new W(C.edgeIndicesWest),H=new W(C.edgeIndicesSouth),Z=new W(C.edgeIndicesEast),K=new W(C.edgeIndicesNorth),le=new W(J).sort(),me=new W(H).sort(),ae=new W(Z).sort(),be=new W(K).sort(),ge=di.geodeticLatitudeToMercatorAngle(T),Ee=1/(di.geodeticLatitudeToMercatorAngle(E)-ge),Be=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,zLt),ke=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,ULt),Ge=new yr(d.center,void 0,void 0,void 0,void 0,i,o,f,t,n),rt=Ge.stride,et=new Float32Array(k*rt),Pe=0;for(let ut=0;ut<j;ut++){let Ct=h.unpack(I,ut*3,VLt),en=R.multiplyByPoint(_,Ct,jLt),Gt=de.fromCartesian(en,m,GLt),{longitude:yt,latitude:wt,height:xn}=Gt,at=(yt-b)/S,st=(wt-T)/w;at=D.clamp(at,0,1),st=D.clamp(st,0,1),Ao(le,ut,n5)>=0?at=0:Ao(ae,ut,n5)>=0&&(at=1),Ao(me,ut,n5)>=0?st=0:Ao(be,ut,n5)>=0&&(st=1);let Ln=z.fromElements(at,st,HLt),Nn;if(i){let no=h.unpack(M,ut*3,mO);no=R.multiplyByPointAsVector(_,no,mO),no=h.normalize(no,mO),Nn=on.octEncode(no,WLt)}let so;o&&(so=(di.geodeticLatitudeToMercatorAngle(wt)-ge)*Ee);let jo;f&&(jo=m.geodeticSurfaceNormal(en,qLt)),Pe=Ge.encode(et,Pe,en,Ln,xn,Nn,so,jo);let to=R.multiplyByPoint(L,en,YLt);Be=h.minimumByComponent(to,Be,Be),ke=h.maximumByComponent(to,ke,ke)}let Ye=new vc(h.clone(Ge.center,new h),et,q,V,j,a,s,A,ce.clone(d,new ce),h.clone(g,new h),rt,$t.clone(p,new $t),Ge,J,H,Z,K);return F1e(Ye,A,m,Be,ke,B,L,c),Promise.resolve(Ye)};var XLt=new z,KLt=new z,QLt=new Array(6),$Lt=new z,JLt=new z,ZLt=new z,eNt=new h,tNt=new h,nNt=new h,iNt=new de,oNt=new h,rNt=new de,aNt=new de,R1e=new h,sNt=new h,cNt=new h,lNt=new h,uNt=new h,fNt=new h,dNt=new h,hNt=new h,mNt=new R,pNt=new R,O1e=new z,gNt=new z,_Nt=new h,ANt=new ce,yNt=new $t,xNt=new Xf,M1e=new h,B1e=new z,bNt=new z,L1e=new h,TNt=new h;function CNt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let g=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(g.buffer,g.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let a=e.buffers[r.buffer].extras._pipeline.source,s=new Uint8Array(a.buffer,a.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(o*4);S_.decodeVertexBuffer(new Uint8Array(f.buffer),o,c,s);let d=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(o*3);for(let g=0;g<o;g++)p[g*3+0]=f[g*4+0]/d,p[g*3+1]=f[g*4+1]/d,p[g*3+2]=f[g*4+2]/d;return p}function ENt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let d=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(d.buffer,d.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let a=e.buffers[r.buffer].extras._pipeline.source,s=new Uint8Array(a.buffer,a.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,u=new Int8Array(o*c);S_.decodeVertexBuffer(new Uint8Array(u.buffer),o,c,s);let f=new Float32Array(o*3);for(let d=0;d<o;d++){let p=Math.max(u[d*4+0]/127,-1),g=Math.max(u[d*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(g));if(m<0){let y=p,x=g;p=(1-Math.abs(x))*D.signNotZero(y),g=(1-Math.abs(y))*D.signNotZero(x)}let A=mO;A.x=p,A.y=g,A.z=m,A=h.normalize(A,mO),f[d*3+0]=A.x,f[d*3+1]=A.y,f[d*3+2]=A.z}return f}function vNt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],o=n.count,r=n.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new r(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o)}let s=e.buffers[a.buffer].extras._pipeline.source,c=new Uint8Array(s.buffer,s.byteOffset+(a.byteOffset??0)+(n.byteOffset??0),a.byteLength),u=new r(o);return S_.decodeIndexBuffer(new Uint8Array(u.buffer),o,a.byteStride,c),u}function i5(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],o=e.bufferViews[i.bufferView],r=i.count,a=i.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let p=e.buffers[o.buffer].extras._pipeline.source;return new a(p.buffer,p.byteOffset+(o.byteOffset??0)+(i.byteOffset??0),r)}let c=e.buffers[s.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(s.byteOffset??0)+(i.byteOffset??0),s.byteLength),f=new a(r),d=s.byteStride;return S_.decodeIndexSequence(new Uint8Array(f.buffer),r,d,u),f}function SNt(e,t,n){return n.positions=CNt(e),n.normals=t?ENt(e):void 0,n.indices=vNt(e),n.edgeIndicesWest=i5(e,"left"),n.edgeIndicesSouth=i5(e,"bottom"),n.edgeIndicesEast=i5(e,"right"),n.edgeIndicesNorth=i5(e,"top"),n}Jne.upsampleMesh=function(e){e=e??G.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:o,skirtHeight:r}=e,a=e.parentIndexCountWithoutSkirts,s=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=yr.clone(e.parentEncoding,new yr),d=f.hasVertexNormals,p=f.hasWebMercatorT,g=f.exaggeration,m=f.exaggerationRelativeHeight,y=g!==1,x=oe.clone(e.rectangle,new oe),b=te.clone(e.ellipsoid),T=[],E=[],S=[],w=[],P=[],O=[],B=[],L=[];zNt(t,n,a,s,c,u,f,w,P,O,B,L,T,S,E);let _=oe.center(x,iNt);_.height=.5*(i+o);let C=de.toCartesian(_,b,oNt),v=T.length,I=new yr(C,void 0,void 0,void 0,void 0,d,p,y,g,m),M=I.stride,N=zo.getSkirtVertexCount(P,O,B,L),j=v+N,k=w.length,V=zo.getSkirtIndexCountWithFilledCorners(N),F=k+V,W=j<=65535?Uint16Array:Uint32Array,q=new W(F);q.set(w);let J=new W(P),H=new W(O),Z=new W(B),K=new W(L),le=new Float32Array(j*M),me=0,ae=pt.eastNorthUpToFixedFrame(C,b,mNt),be=R.inverseTransformation(ae,pNt),ge=x.west,we=x.east,Ee=x.south,Be=x.north,ke=di.geodeticLatitudeToMercatorAngle(Ee),rt=1/(di.geodeticLatitudeToMercatorAngle(Be)-ke),et=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,Ye=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,dNt),ut=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,hNt);for(let xn=0;xn<v;xn++){let at=T[xn],st=s[at*3+0],Ln=s[at*3+1],Nn=s[at*3+2],so=gNt;so.x=E[xn*2+0],so.y=E[xn*2+1];let jo=so.x,to=so.y,no=S[xn*2+0],jn=S[xn*2+1],Gn=1-no-jn,sn=f.decodeHeight(u,st),Qn=f.decodeHeight(u,Ln),Tr=f.decodeHeight(u,Nn),ma=sn*no+Qn*jn+Tr*Gn;et=Math.min(ma,et),Pe=Math.max(ma,Pe);let Qa=D.lerp(ge,we,jo),Ba=D.lerp(Ee,Be,to),$a=de.fromRadians(Qa,Ba,ma,aNt),lr=de.toCartesian($a,b,sNt),ii=R.multiplyByPoint(be,lr,lNt);Ye=h.minimumByComponent(ii,Ye,Ye),ut=h.maximumByComponent(ii,ut,ut);let Lr;if(d){let ai=f.decodeNormal(u,st,eNt),Oo=f.decodeNormal(u,Ln,tNt),uc=f.decodeNormal(u,Nn,nNt),Jr=h.fromElements(ai.x*no+Oo.x*jn+uc.x*Gn,ai.y*no+Oo.y*jn+uc.y*Gn,ai.z*no+Oo.z*jn+uc.z*Gn,M1e);Jr=h.normalize(Jr,M1e),Lr=on.octEncode(Jr,bNt)}let So;p&&(So=(di.geodeticLatitudeToMercatorAngle(Ba)-ke)*rt);let Di;y&&(Di=b.geodeticSurfaceNormal(lr,TNt)),me=I.encode(le,me,lr,so,ma,Lr,So,Di)}let Ct=$t.fromRectangle(x,et,Pe,b,yNt),en=ce.fromVertices(le,I.center,M,ANt),yt=new mp(b).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(I.center,le,M,I.center,et,_Nt),wt=new vc(h.clone(I.center,new h),le,q,k,v,et,Pe,x,ce.clone(en),h.clone(yt),M,$t.clone(Ct),I,J,H,Z,K);return F1e(wt,x,b,Ye,ut,ae,be,r),wt};function F1e(e,t,n,i,o,r,a,s){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:d,hasWebMercatorT:p,exaggeration:g,exaggerationRelativeHeight:m}=c,y=g!==1,x=e.vertexCountWithoutSkirts,b=x*u,T=f.length/u,E=T-x,S=e.indices,w=e.indexCountWithoutSkirts,P=e.westIndicesSouthToNorth,O=e.southIndicesEastToWest,B=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;zo.addSkirtIndicesWithFilledCorners(P,O,B,L,x,S,w);let _=0,C=_+P.length,v=C+O.length,I=v+B.length,M=[P,O,B,L],N=[_,C,v,I],j=[-1,0,1,0],k=[0,-1,0,1],V=h.clone(i,uNt),F=h.clone(o,fNt),W=e.maximumHeight,q=e.minimumHeight-s;for(let Z=0;Z<E;Z++){let K=0;for(K=0;K<3&&!(Z<N[K+1]);K++);let le=M[K][Z-N[K]],me=c.decodeTextureCoordinates(f,le,O1e),ae=1e-4,be=me.x+j[K]*ae,ge=me.y+k[K]*ae,we=D.lerp(t.west,t.east,be),Ee=D.clamp(D.lerp(t.south,t.north,ge),-D.PI_OVER_TWO,+D.PI_OVER_TWO),ke=c.decodeHeight(f,le)-s,Ge=de.fromRadians(we,Ee,ke,rNt),rt=de.toCartesian(Ge,n,R1e),et;d&&(et=c.getOctEncodedNormal(f,le,B1e));let Pe;p&&(Pe=c.decodeWebMercatorT(f,le));let Ye;y&&(Ye=n.geodeticSurfaceNormal(rt,L1e)),b=c.encode(f,b,rt,me,ke,et,Pe,Ye);let ut=R.multiplyByPoint(a,rt,cNt);h.minimumByComponent(ut,V,V),h.maximumByComponent(ut,F,F)}let J=Xf.fromCorners(V,F,xNt),H=new yr(c.center,J,q,W,r,c.hasVertexNormals,c.hasWebMercatorT,y,g,m);if(c.quantization!==H.quantization){let Z=H,K=Z.stride,le=new Float32Array(T*K),me=0;for(let ae=0;ae<T;ae++)me=Z.encode(le,me,c.decodePosition(f,ae,R1e),c.decodeTextureCoordinates(f,ae,O1e),c.decodeHeight(f,ae),c.hasVertexNormals?c.getOctEncodedNormal(f,ae,B1e):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,ae):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,ae,L1e):void 0);e.vertices=le,e.stride=K,e.encoding=Z}return e}var Zne=0,wNt=1,eie=2,tie=3,INt=4,DNt=new h,PNt=[new h,new h,new h,new h,new h,new h],RNt=[new z,new z,new z,new z,new z,new z],ONt=[new h,new h,new h,new h,new h,new h],MNt=[new z,new z,new z,new z,new z,new z];function N1e(e,t,n,i){switch(n){case Zne:return D.sign(i.x-e.x);case eie:return D.sign(t.x-i.x);case tie:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function BNt(e,t,n,i,o,r){let a,s,c;switch(n){case Zne:a=(e.x-i.x)/(o.x-i.x),s=e.x,c=i.y+(o.y-i.y)*a;break;case eie:a=(t.x-i.x)/(o.x-i.x),s=t.x,c=i.y+(o.y-i.y)*a;break;case tie:a=(e.y-i.y)/(o.y-i.y),s=i.x+(o.x-i.x)*a,c=e.y;break;default:a=(t.y-i.y)/(o.y-i.y),s=i.x+(o.x-i.x)*a,c=t.y;break}return h.fromElements(s,c,a,r)}var LNt={length:0,coordinates:[new z,new z,new z,new z,new z,new z],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function NNt(e,t,n,i,o,r,a,s){let c=0,u=RNt,f=PNt,d=3,p=MNt;z.clone(o,p[0]),z.clone(r,p[1]),z.clone(a,p[2]);let g=ONt;h.fromElements(1,0,0,g[0]),h.fromElements(0,1,0,g[1]),h.fromElements(0,0,1,g[2]);for(let m=0;m<t;m++){let A=(e+m)%INt,y=u,x=f;u=p,f=g,c=d,p=y,g=x,d=0;let b=c-1,T=u[b],E=f[b],S=N1e(n,i,A,T);for(let w=0;w<c;w++){let P=u[w],O=f[w],B=N1e(n,i,A,P);if(S*B===-1){let L=BNt(n,i,A,T,P,DNt),{x:_,y:C,z:v}=L,I=1-v,M=E.x*I+O.x*v,N=E.y*I+O.y*v,j=E.z*I+O.z*v;z.fromElements(_,C,p[d]),h.fromElements(M,N,j,g[d]),d++}B>=0&&(z.clone(P,p[d]),h.clone(O,g[d]),d++),b=w,T=P,E=O,S=B}if(d===0)break}s.length=d;for(let m=0;m<d;m++)z.clone(p[m],s.coordinates[m]),h.clone(g[m],s.barycentricCoordinates[m]);return s}function FNt(e,t,n,i,o,r,a,s){return NNt(e?t?tie:Zne:t?eie:wNt,2,n,i,o,r,a,s)}var kNt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function zNt(e,t,n,i,o,r,a,s,c,u,f,d,p,g,m){let A={},y=e?.5:0,x=e?1:.5,b=t?.5:0,T=t?1:.5,E=XLt;E.x=y,E.y=b;let S=KLt;S.x=x,S.y=T;let w=0;for(let P=0;P<n;P+=3){let O=i[P+0],B=i[P+1],L=i[P+2],_=a.decodeTextureCoordinates(r,O,$Lt),C=a.decodeTextureCoordinates(r,B,JLt),v=a.decodeTextureCoordinates(r,L,ZLt),I=FNt(e,t,E,S,_,C,v,LNt),M=I.length;if(M<3)continue;let N=QLt;for(let F=0;F<M;F++){let W=I.barycentricCoordinates[F],q=W.x,J=W.y,H=W.z,Z=Math.ceil(q)|Math.ceil(J)<<1|Math.ceil(H)<<2,K=kNt[Z],le,me=!1;if(K.length===1){let ae=K[0],ge=i[P+ae];le=A[ge],le===void 0&&(me=!0,le=w++,A[ge]=le)}else if(K.length===2){let ae=K[0],be=K[1],ge=i[P+ae],we=i[P+be],Ee=I.barycentricCoordinates[(F+M-1)%M],Be=Math.ceil(Ee.x)|Math.ceil(Ee.y)<<1|Math.ceil(Ee.z)<<2,ke=Z===Be,Ge=Math.min(ge,we),rt=Math.max(ge,we),et=o+2*(Ge*o+rt),Pe=et+0,Ye=et+1,ut=A[Pe],Ct=A[Ye],en=!ke==(ut===void 0||Ct===void 0);if(le=en?ut:Ct,le===void 0){me=!0,le=w++;let Gt=en?Pe:Ye;A[Gt]=le}}else me=!0,le=w++;if(N[F]=le,me){let ae=P/3;p.push(ae);let be=I.coordinates[F],ge=(be.x-y)/(x-y),we=(be.y-b)/(T-b);m.push(ge,we),g.push(q,J),ge===0?c.push(le):ge===1&&f.push(le),we===0?u.push(le):we===1&&d.push(le)}}let j=N[0],k=N[1],V=N[2];s.push(j,k,V);for(let F=3;F<M;F++)k=V,V=N[F],s.push(j,k,V)}c.sort(function(P,O){return m[P*2+1]-m[O*2+1]}),u.sort(function(P,O){return m[O*2+0]-m[P*2+0]}),f.sort(function(P,O){return m[O*2+1]-m[P*2+1]}),d.sort(function(P,O){return m[P*2+0]-m[O*2+0]})}var pO=Jne;function Fg(e){e=e??G.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ce.clone(e.boundingSphere,new ce),this._orientedBoundingBox=$t.clone(e.orientedBoundingBox,new $t),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(Fg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});Fg.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:z1e(i,e,t,n)};Fg.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};var k1e="createVerticesFromCesium3DTilesTerrain",UNt=new Wn(k1e),VNt=new Wn(k1e,Ef.maximumAsynchronousTasks);Fg.prototype.createMesh=function(e){e=e??G.EMPTY_OBJECT;let n=e.throttle??!0?VNt:UNt,i=e.tilingScheme,o=i.ellipsoid,r=e.x,a=e.y,s=e.level,c=i.tileXYToRectangle(r,a,s,new oe),u=this._gltf,f=n.scheduleTask({ellipsoid:o,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let d=this;return Promise.resolve(f).then(function(p){let g=p,m=yr.clone(g.encoding,new yr),A=new Float32Array(g.verticesBuffer),y=A.length/m.stride,x=g.vertexCountWithoutSkirts,b=y<=65535?Uint16Array:Uint32Array,T=new b(g.indicesBuffer),E=new b(g.westIndicesBuffer),S=new b(g.eastIndicesBuffer),w=new b(g.southIndicesBuffer),P=new b(g.northIndicesBuffer),O=g.indexCountWithoutSkirts,B=d._minimumHeight,L=d._maximumHeight,_=h.clone(m.center,new h),C=ce.clone(d._boundingSphere,new ce),v=h.clone(d._horizonOcclusionPoint,new h),I=$t.clone(d._orientedBoundingBox,new $t),M=new vc(_,A,T,O,x,B,L,c,C,v,m.stride,I,m,E,w,S,P);return d._mesh=M,Promise.resolve(M)})};Fg.prototype._createMeshSync=function(e){e=e??G.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,o=e.y,r=e.level,a=t.tileXYToRectangle(i,o,r,new oe),s=pO.createMesh({ellipsoid:n,rectangle:a,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(s).then(function(u){return c._mesh=u,Promise.resolve(u)})};Fg.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;return s===void 0?void 0:o5(!1,s,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};Fg.prototype._upsampleSync=function(e,t,n,i,o,r,a){let s=this._mesh;return s===void 0?void 0:o5(!0,s,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};Fg.prototype.wasCreatedByUpsampling=function(){return!1};function Ng(e){e=e??G.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}Ng.prototype.createMesh=function(e){return e=e??G.EMPTY_OBJECT,Promise.resolve(this._mesh)};Ng.prototype.upsample=function(e,t,n,i,o,r,a){return o5(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};Ng.prototype._upsampleSync=function(e,t,n,i,o,r,a){return o5(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};Ng.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return z1e(i,e,t,n)};Ng.prototype.wasCreatedByUpsampling=function(){return!0};Ng.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(Ng.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var jNt=new Wn("upsampleVerticesFromCesium3DTilesTerrain",Ef.maximumAsynchronousTasks);function o5(e,t,n,i,o,r,a,s,c,u,f){if(f-s>1)throw new _e("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,g=r*2!==c,m=a*2===u,A=o.tileXYToRectangle(c,u,f,new oe),y=o.ellipsoid,x={isEastChild:g,isNorthChild:m,rectangle:A,ellipsoid:y,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let T=pO.upsampleMesh(x),E=new Ng({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let b=jNt.scheduleTask(x);if(b!==void 0)return b.then(function(T){let E=yr.clone(T.encoding,new yr),S=E.stride,w=new Float32Array(T.verticesBuffer),P=w.length/S,O=T.vertexCountWithoutSkirts,B=P<=65535?Uint16Array:Uint32Array,L=new B(T.indicesBuffer),_=new B(T.westIndicesBuffer),C=new B(T.eastIndicesBuffer),v=new B(T.southIndicesBuffer),I=new B(T.northIndicesBuffer),M=T.indexCountWithoutSkirts,N=T.minimumHeight,j=T.maximumHeight,k=h.clone(E.center,new h),V=ce.clone(T.boundingSphere,new ce),F=h.clone(T.horizonOcclusionPoint,new h),W=$t.clone(T.orientedBoundingBox,new $t),q=new vc(k,w,L,M,O,N,j,A,V,F,S,W,E,_,v,C,I),J=new Ng({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(J)})}var GNt=new z,HNt=new z,WNt=new z,qNt=new h;function z1e(e,t,n,i){let o=D.clamp((n-t.west)/t.width,0,1),r=D.clamp((i-t.south)/t.height,0,1),{vertices:a,encoding:s,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],d=c[u+1],p=c[u+2],g=s.decodeTextureCoordinates(a,f,GNt),m=s.decodeTextureCoordinates(a,d,HNt),A=s.decodeTextureCoordinates(a,p,WNt),y=Math.min(g.x,m.x,A.x),x=Math.max(g.x,m.x,A.x),b=Math.min(g.y,m.y,A.y),T=Math.max(g.y,m.y,A.y);if(o>=y&&o<=x&&r>=b&&r<=T){let E=Jp.computeBarycentricCoordinates(o,r,g.x,g.y,m.x,m.y,A.x,A.y,qNt);if(E.x>=0&&E.y>=0&&E.z>=0){let S=s.decodeHeight(a,f),w=s.decodeHeight(a,d),P=s.decodeHeight(a,p);return E.x*S+E.y*w+E.z*P}}}return 0}var r5=Fg;function e0(e){e=e??G.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new xt(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new ye,this._ellipsoid=e.ellipsoid??te.WGS84,this._tilingScheme=new Yi({ellipsoid:this._ellipsoid}),this._subtreeCache=new uT({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}e0.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new re("Could not load tileset JSON",f)}let o=new e0(t);o._tileCredits=n.credits,o._resource=n;let r=i.root.children,a=r[0],s=r[1],c=i.schema,u=du.fromJson(c);return o._tileset0=new Q0(n,a,u),o._tileset1=new Q0(n,s,u),o};e0.fromIonAssetId=async function(e,t){let n=await ya.fromAssetId(e);return e0.fromUrl(n,t)};var YNt=new Array(3);e0.prototype.requestTileGeometry=async function(e,t,n,i){let o=V1e(n,e),r=o===0?this._tileset0:this._tileset1,a=j1e(r,n,e,t),s=a.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(o,s),f=this._requestWaterMask,d=this,p;if(u===void 0){let b=r.subtreeUriTemplate.getDerivedResource({templateValues:s.getTemplateValues()});p=r.baseResource.getDerivedResource({url:b.url}).fetchArrayBuffer().then(async function(E){if(u=c.find(o,s),u===void 0){let S=new Uint8Array(E);u=await O_.fromSubtreeJson(d._resource,void 0,S,r,s),c.addSubtree(o,u)}return u})}else p=Promise.resolve(u);let g=r.contentUriTemplates[0].getDerivedResource({templateValues:a.getTemplateValues()}),m=r.baseResource.getDerivedResource({url:g.url}),A=m.fetchArrayBuffer();if(A===void 0)return;let y=A.then(b=>zC(new Uint8Array(b))),x=YNt;x[0]=p,x[1]=y,x[2]=f?y.then(b=>XNt(b,m)):void 0;try{let b=await Promise.all(x),T=b[0],E=b[1],S=b[2],w=T.getTileMetadataView(a),P=w.getPropertyBySemantic(gh.TILE_MINIMUM_HEIGHT),O=w.getPropertyBySemantic(gh.TILE_MAXIMUM_HEIGHT),B=w.getPropertyBySemantic(gh.TILE_BOUNDING_SPHERE),L=ce.unpack(B,0,new ce),_=w.getPropertyBySemantic(gh.TILE_HORIZON_OCCLUSION_POINT),v=d._tilingScheme.tileXYToRectangle(e,t,n,new oe),I=d._ellipsoid,M=$t.fromRectangle(v,P,O,I,new $t),N=d.getLevelMaximumGeometricError(n)*5,j=a5(r,T,a,0,0),k=a5(r,T,a,1,0),V=a5(r,T,a,0,1),F=a5(r,T,a,1,1),W=(j?1:0)|(k?2:0)|(V?4:0)|(F?8:0),q=new r5({gltf:E,minimumHeight:P,maximumHeight:O,boundingSphere:L,orientedBoundingBox:M,horizonOcclusionPoint:_,skirtHeight:N,requestVertexNormals:d._requestVertexNormals,childTileMask:W,credits:d._tileCredits,waterMask:S});return Promise.resolve(q)}catch(b){console.log(`Could not load subtree: ${o} ${s.level} ${s.x} ${s.y}: ${b}`),console.log(`Could not load tile: ${o} ${a.level} ${a.x} ${a.y}: ${b}`);return}};e0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,o=V1e(n,e),r=o===0?this._tileset0:this._tileset1,a=j1e(r,n,e,t),s=a.getSubtreeCoordinates(),c=i.find(o,s);if(c!==void 0)return c.tileIsAvailableAtCoordinates(a);if(s.isImplicitTilesetRoot())return a.isSubtreeRoot()?!0:void 0;let u=s.getParentSubtreeCoordinates(),f=i.find(o,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(s)?a.isSubtreeRoot()?!0:void 0:!1};function V1e(e,t){let n=1<<e;return t/n|0}function j1e(e,t,n,i){let o=1<<t,r=t,a=n%o,s=o-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new $0({subdivisionScheme:c,subtreeLevels:u,level:r,x:a,y:s})}async function XNt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new lx({schema:n.schema});await i.load();let o=i.schema,r,a;if(l(o.classes)){for(let g in o.classes)if(o.classes.hasOwnProperty(g)&&(r=o.classes[g],a=r.propertiesBySemantic.WATERMASK,l(a)))break}if(!l(a))return;let s=n.propertyTextures.find(g=>g.class===r.id);if(!l(s))throw new _e(`Expected a propertyTexture with a class ${r.id}`);let c=s.properties[a.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,d=Pi.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await I_({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function a5(e,t,n,i,o){let r=n.isBottomOfSubtree(),s=nie(e,1,i,o),c=n.getDescendantCoordinates(s);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function nie(e,t,n,i){let{subdivisionScheme:o,subtreeLevels:r}=e;return new $0({subdivisionScheme:o,subtreeLevels:r,level:t,x:n,y:i})}e0.prototype.loadTileDataAvailability=function(e,t,n){};e0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(e0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function KNt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function uT(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new uy({comparator:uT.comparator}),this._provider=e.provider}uT.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};uT.prototype.addSubtree=function(e,t){let n=new KNt(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let o=i.getParentSubtreeCoordinates(),r=this.find(e,o)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};uT.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:o,x:r,y:a}=t;for(let s=0;s<n.length;s++){let c=i[s],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===o&&f.x===r&&f.y===a)return c.subtree}};uT.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,o=t<0?0:1,r=o===0?i._tileset0:i._tileset1,a=r.subtreeLevels,s=nie(r,0,0,0),c=this.find(o,s);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level,g=-D.PI,m=+D.PI,A=D.lerp(g,m,o/2),y=D.lerp(g,m,(o+1)/2),x=-D.PI*.5,b=+D.PI*.5,T=0,E=0,S=!0;for(;S;){let P=1/(1<<p),O=(y-A)*P,B=A+f*O,L=(b-x)*P,_=x+d*L;T=(t-B)/O,E=(n-_)/L;let C=U1e(r,u,T,E,a);if(c.childSubtreeIsAvailableAtCoordinates(C)){let v=this.find(o,C);if(v!==void 0)c=v,u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level;else return C}else S=!1}let w;for(let P=0;P<a;P++){let O=U1e(r,u,T,E,P);if(c.tileIsAvailableAtCoordinates(O))w=O;else break}return w};function U1e(e,t,n,i,o){let r=1<<o,a=D.clamp(n*r|0,0,r-1),s=D.clamp(i*r|0,0,r-1),c=nie(e,o,a,s);return t.getDescendantCoordinates(c)}uT.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var G1e=e0;function kg(e){e=e??G.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 vu(n),this._workerName="createCircleGeometry"}kg.packedLength=vu.packedLength;kg.pack=function(e,t,n){return vu.pack(e._ellipseGeometry,t,n)};var H1e=new vu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Ic={center:new h,radius:void 0,ellipsoid:te.clone(te.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Ne,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};kg.unpack=function(e,t,n){let i=vu.unpack(e,t,H1e);return Ic.center=h.clone(i._center,Ic.center),Ic.ellipsoid=te.clone(i._ellipsoid,Ic.ellipsoid),Ic.ellipsoid=te.clone(i._ellipsoid,H1e._ellipsoid),Ic.height=i._height,Ic.extrudedHeight=i._extrudedHeight,Ic.granularity=i._granularity,Ic.vertexFormat=Ne.clone(i._vertexFormat,Ic.vertexFormat),Ic.stRotation=i._stRotation,Ic.shadowVolume=i._shadowVolume,l(n)?(Ic.semiMajorAxis=i._semiMajorAxis,Ic.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new vu(Ic),n):(Ic.radius=i._semiMajorAxis,new kg(Ic))};kg.createGeometry=function(e){return vu.createGeometry(e._ellipseGeometry)};kg.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),a=n(i,o);return new kg({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:a,vertexFormat:Ne.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(kg.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var W1e=kg;function mw(e){e=e??G.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 Dd(n),this._workerName="createCircleOutlineGeometry"}mw.packedLength=Dd.packedLength;mw.pack=function(e,t,n){return Dd.pack(e._ellipseGeometry,t,n)};var QNt=new Dd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Bf={center:new h,radius:void 0,ellipsoid:te.clone(te.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};mw.unpack=function(e,t,n){let i=Dd.unpack(e,t,QNt);return Bf.center=h.clone(i._center,Bf.center),Bf.ellipsoid=te.clone(i._ellipsoid,Bf.ellipsoid),Bf.height=i._height,Bf.extrudedHeight=i._extrudedHeight,Bf.granularity=i._granularity,Bf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Bf.semiMajorAxis=i._semiMajorAxis,Bf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Dd(Bf),n):(Bf.radius=i._semiMajorAxis,new mw(Bf))};mw.createGeometry=function(e){return Dd.createGeometry(e._ellipseGeometry)};var q1e=mw;function pw(e){e=e??G.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Yi({ellipsoid:e.ellipsoid??te.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=zo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye;let n=e.credit;typeof n=="string"&&(n=new xt(n)),this._credit=n}Object.defineProperties(pw.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}}});pw.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,a=this._height;return Promise.resolve(o).then(function(s){let c=s;return Array.isArray(c)&&(c=new Float64Array(c)),new ol({buffer:c,width:r,height:a})})};pw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};pw.prototype.getTileDataAvailable=function(e,t,n){};pw.prototype.loadTileDataAvailability=function(e,t,n){};var Y1e=pw;function X1e(e){this.proxy=e}X1e.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var K1e=X1e;var Q1e={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(Q1e);var fT=Q1e;function s5(){_e.throwInstantiationError()}Object.defineProperties(s5.prototype,{credit:{get:_e.throwInstantiationError}});s5.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(xt.getIonCredit)};s5.prototype.geocode=_e.throwInstantiationError;var gO=s5;function $1e(){_e.throwInstantiationError()}$1e.createGeometry=function(e){_e.throwInstantiationError()};var J1e=$1e;function dT(e){e=e??G.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=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(dT.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var tRe="createVerticesFromGoogleEarthEnterpriseBuffer",$Nt=new Wn(tRe),JNt=new Wn(tRe,Ef.maximumAsynchronousTasks),Z1e=new oe,c5=new oe;dT.prototype.createMesh=function(e){e=e??G.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,Z1e),t.tileXYToRectangle(n,i,o,c5);let u=c.cartographicToCartesian(oe.center(c5)),d=40075.16/(1<<o);this._skirtHeight=Math.min(d*8,1e3);let g=(s?JNt:$Nt).scheduleTask({buffer:this._buffer,nativeRectangle:Z1e,rectangle:c5,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:a,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(A){return m._mesh=new vc(u,new Float32Array(A.vertices),new Uint16Array(A.indices),A.indexCountWithoutSkirts,A.vertexCountWithoutSkirts,A.minimumHeight,A.maximumHeight,c5,ce.clone(A.boundingSphere3D),h.clone(A.occludeePointInScaledSpace),A.numberOfAttributes,$t.clone(A.orientedBoundingBox),yr.clone(A.encoding),A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),m._minimumHeight=A.minimumHeight,m._maximumHeight=A.maximumHeight,m._buffer=void 0,m._mesh})};dT.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),o=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?iFt(this,i,o):aFt(this,i,o,e)};var ZNt=new Wn("upsampleQuantizedTerrainMesh",Ef.maximumAsynchronousTasks);dT.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,a),p=ZNt.scheduleTask({vertices:s.vertices,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let A=new Uint16Array(m.vertices),y=Ue.createTypedArray(A.length/3,m.indices),x=g._skirtHeight;return new rw({quantizedVertices:A,indices:y,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ce.clone(m.boundingSphere),orientedBoundingBox:$t.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:x,southSkirtHeight:x,eastSkirtHeight:x,northSkirtHeight:x,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};dT.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};dT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var eFt=new z,tFt=new z,nFt=new z,nRe=new h;function iFt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,a=i.indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],d=a[s+2],p=r.decodeTextureCoordinates(o,u,eFt),g=r.decodeTextureCoordinates(o,f,tFt),m=r.decodeTextureCoordinates(o,d,nFt),A=Jp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,nRe);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let y=r.decodeHeight(o,u),x=r.decodeHeight(o,f),b=r.decodeHeight(o,d);return A.x*y+A.y*x+A.z*b}}}var oFt=Uint16Array.BYTES_PER_ELEMENT,eRe=Uint32Array.BYTES_PER_ELEMENT,iie=Int32Array.BYTES_PER_ELEMENT,rFt=Float32Array.BYTES_PER_ELEMENT,oie=Float64Array.BYTES_PER_ELEMENT;function aFt(e,t,n,i){let o=e._buffer,r=0,a=0,s=0;n>.5?(t>.5?(r=2,a=.5):r=3,s=.5):t>.5&&(r=1,a=.5);let c=new DataView(o),u=0;for(let S=0;S<r;++S)u+=c.getUint32(u,!0),u+=eRe;u+=eRe,u+=2*oie;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=oie;let d=D.toRadians(c.getFloat64(u,!0)*180);u+=oie;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=iie;let A=c.getInt32(u,!0)*3;u+=iie,u+=iie;let y=new Array(m),x=new Array(m),b=new Array(m),T;for(T=0;T<m;++T)y[T]=a+c.getUint8(u++)*p,x[T]=s+c.getUint8(u++)*g,b[T]=c.getFloat32(u,!0)*6371010,u+=rFt;let E=new Array(A);for(T=0;T<A;++T)E[T]=c.getUint16(u,!0),u+=oFt;for(T=0;T<A;T+=3){let S=E[T],w=E[T+1],P=E[T+2],O=y[S],B=y[w],L=y[P],_=x[S],C=x[w],v=x[P],I=Jp.computeBarycentricCoordinates(t,n,O,_,B,C,L,v,nRe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*b[S]+I.y*b[w]+I.z*b[P]}}var _O=dT;var Wd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},l5=new Q;function u5(){this._terrainCache={},this._lastTidy=Q.now()}u5.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};u5.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};u5.prototype.tidy=function(){if(Q.now(l5),Q.secondsDifference(l5,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];Q.secondsDifference(l5,r.timestamp)>10&&delete e[o]}Q.clone(l5,this._lastTidy)}};function yy(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new oe(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new xt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new u5,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new ye}Object.defineProperties(yy.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(){}}});yy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new re(`The server ${e.url} doesn't have terrain`);let n=new yy(t);return n._metadata=e,n};var sFt=new Wn("decodeGoogleEarthEnterprisePacket");function iRe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Wd.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}yy.prototype.requestTileGeometry=function(e,t,n,i){let o=my.tileXYToQuadKey(e,t,n),r=this._terrainCache,a=this._metadata,s=a.getTileInformationFromQuadKey(o);if(!l(s))return Promise.reject(new re("Terrain tile doesn't exist"));let c=s.terrainState;l(c)||(c=s.terrainState=Wd.UNKNOWN);let u=r.get(o);if(l(u)){let x=a.providers[s.terrainProvider];return Promise.resolve(new _O({buffer:u,childTileMask:iRe(o,s,a),credits:l(x)?[x]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold}))}if(r.tidy(),s.ancestorHasTerrain){if(c===Wd.NONE)return Promise.reject(new re("Terrain tile doesn't exist"))}else return Promise.resolve(new ol({buffer:new Uint8Array(256),width:16,height:16}));let f,d=o,p=-1;switch(c){case Wd.SELF:p=s.terrainVersion;break;case Wd.PARENT:d=d.substring(0,d.length-1),f=a.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Wd.UNKNOWN:s.hasTerrain()?p=s.terrainVersion:(d=d.substring(0,d.length-1),f=a.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new re("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,A,y;if(l(g[d]))A=g[d],y=m[d];else{y=i;let x=cFt(this,d,p,y).fetchArrayBuffer();if(!l(x))return;A=x.then(function(b){return l(b)?sFt.scheduleTask({buffer:b,type:"Terrain",key:a.key},[b]).then(function(T){let E=a.getTileInformationFromQuadKey(d);E.terrainState=Wd.SELF,r.add(d,T[0]);let S=E.terrainProvider,w=T.length-1;for(let P=0;P<w;++P){let O=d+P.toString(),B=a.getTileInformationFromQuadKey(O);l(B)&&(r.add(O,T[P+1]),B.terrainState=Wd.PARENT,B.terrainProvider===0&&(B.terrainProvider=S))}}):Promise.reject(new re("Failed to load terrain."))}),g[d]=A,m[d]=y,A=A.finally(function(){delete g[d],delete m[d]})}return A.then(function(){let x=r.get(o);if(l(x)){let b=a.providers[s.terrainProvider];return new _O({buffer:x,childTileMask:iRe(o,s,a),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold})}return Promise.reject(new re("Failed to load terrain."))}).catch(function(x){return y.state===Ai.CANCELLED?(i.state=y.state,Promise.reject(x)):(s.terrainState=Wd.NONE,Promise.reject(x))})};yy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};yy.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=my.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let a=r.terrainState;if(a===Wd.NONE)return!1;if((!l(a)||a===Wd.UNKNOWN)&&(r.terrainState=Wd.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let s=i.getTileInformationFromQuadKey(o);if(!l(s)||!s.hasTerrain())return!1}return!0}if(i.isValid(o)){let a=new Cr({throttle:!1,throttleByServer:!0,type:ts.TERRAIN});i.populateSubtree(e,t,n,a)}return!1};yy.prototype.loadTileDataAvailability=function(e,t,n){};function cFt(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 oRe=yy;var lFt="https://maps.googleapis.com/maps/api/geocode/json",rRe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function rie(e){e=e??G.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:lFt,queryParameters:{key:t}}),this._credit=new xt(rRe,!0)}Object.defineProperties(rie.prototype,{credit:{get:function(){return this._credit}}});rie.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new re(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,a=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:oe.fromDegrees(r.lng,r.lat,a.lng,a.lat),attribution:{html:rRe,collapsible:!1}}})};var aRe=rie;var AO={};AO.type=void 0;AO.getRequiredDataPoints=_e.throwInstantiationError;AO.interpolateOrderZero=_e.throwInstantiationError;AO.interpolate=_e.throwInstantiationError;var sRe=AO;var cRe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(cRe);var xy=cRe;function aie(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(aie.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});aie.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===fT.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,a=o.bbox;if(l(a))r=oe.fromDegrees(a[0],a[1],a[2],a[3]);else{let s=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(s,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var f5=aie;function uFt(e){if(!Object.values(xy).some(t=>t===e))throw new _e(`Invalid geocodeProviderType: "${e}"`)}var lRe=Object.freeze({[xy.GOOGLE]:"google",[xy.BING]:"bing",[xy.DEFAULT]:void 0});function fFt(e){return lRe[e]}function dFt(e){return Object.entries(lRe).find(t=>t[1]===e)[0]}function sie(e){e=e??G.EMPTY_OBJECT;let t=e.geocodeProviderType??xy.DEFAULT,n=e.accessToken??Fm.defaultAccessToken,i=De.createIfNeeded(e.server??Fm.defaultServer);i.appendForwardSlash();let o=Fm.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(xt.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new f5(r),this.geocodeProviderType=t}Object.defineProperties(sie.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return dFt(this._pelias.url.queryParameters.geocoder)},set:function(e){uFt(e);let t={...this._pelias.url.queryParameters,geocoder:fFt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});sie.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var gw=sie;var cie=class{constructor(){lt(this,"ellipsoid")}project(t,n){_e.throwInstantiationError()}unproject(t,n){_e.throwInstantiationError()}},uRe=cie;function _w(e){e=e??G.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(_w.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});_w.prototype.findTimeInterval=To.prototype.findTimeInterval;_w.prototype.wrapTime=To.prototype.wrapTime;_w.prototype.clampTime=To.prototype.clampTime;_w.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 a=0;a<this._count;a++){let s=o*this._count+a;t[a]=n[s]*(1-r)+n[s+this._count]*r}return t};var fRe=_w;function lie(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new xt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(lie.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});lie.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:It(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=oe.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let{lng:a,lat:s}=i.geometry;o=h.fromDegrees(a,s)}return{displayName:i.formatted,destination:o}})})};var dRe=lie;var hFt={packedLength:void 0,pack:_e.throwInstantiationError,unpack:_e.throwInstantiationError},hRe=hFt;var mFt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:_e.throwInstantiationError,unpackInterpolationResult:_e.throwInstantiationError},mRe=mFt;function pRe(){_e.throwInstantiationError()}pRe.prototype.getURL=_e.throwInstantiationError;var gRe=pRe;function pFt(e,t,n,i,o,r,a){let s=$i.numberOfPoints(e,t,o),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,A=i.blue,y=i.alpha;if(U.equals(n,i)){for(c=0;c<s;c++)r[a++]=U.floatToByte(u),r[a++]=U.floatToByte(f),r[a++]=U.floatToByte(d),r[a++]=U.floatToByte(p);return a}let x=(g-u)/s,b=(m-f)/s,T=(A-d)/s,E=(y-p)/s,S=a;for(c=0;c<s;c++)r[S++]=U.floatToByte(u+c*x),r[S++]=U.floatToByte(f+c*b),r[S++]=U.floatToByte(d+c*T),r[S++]=U.floatToByte(p+c*E);return S}function yO(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??rn.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??te.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*U.packedLength:1,this.packedLength=o+te.packedLength+3}yO.pack=function(e,t,n){n=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 a=e._colors;for(r=l(a)?a.length:0,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};yO.unpack=function(e,t,n){t=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 a=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)a[i]=U.unpack(e,t);let s=te.unpack(e,t);t+=te.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=a,n._ellipsoid=s,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new yO({positions:r,colors:a,ellipsoid:s,colorsPerVertex:c,arcType:u,granularity:f})};var d5=new Array(2),h5=new Array(2),gFt={positions:d5,height:h5,ellipsoid:void 0,minDistance:void 0,granularity:void 0};yO.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,a=e._ellipsoid,s=D.chordLength(r,a.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,A=0;if(o===rn.GEODESIC||o===rn.RHUMB){let E,S,w;o===rn.GEODESIC?(E=D.chordLength(r,a.maximumRadius),S=$i.numberOfPoints,w=$i.generateArc):(E=r,S=$i.numberOfPointsRhumbLine,w=$i.generateRhumbArc);let P=$i.extractHeights(t,a),O=gFt;if(o===rn.GEODESIC?O.minDistance=s:O.granularity=r,O.ellipsoid=a,c){let B=0;for(u=0;u<f-1;u++)B+=S(t[u],t[u+1],E)+1;d=new Float64Array(B*3),g=new Uint8Array(B*4),O.positions=d5,O.height=h5;let L=0;for(u=0;u<f-1;++u){d5[0]=t[u],d5[1]=t[u+1],h5[0]=P[u],h5[1]=P[u+1];let _=w(O);if(l(n)){let C=_.length/3;m=n[u];for(let v=0;v<C;++v)g[L++]=U.floatToByte(m.red),g[L++]=U.floatToByte(m.green),g[L++]=U.floatToByte(m.blue),g[L++]=U.floatToByte(m.alpha)}d.set(_,A),A+=_.length}}else if(O.positions=t,O.height=P,d=new Float64Array(w(O)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],_=t[u+1],C=n[u],v=n[u+1];A=pFt(L,_,C,v,s,g,A)}let B=n[f-1];g[A++]=U.floatToByte(B.red),g[A++]=U.floatToByte(B.green),g[A++]=U.floatToByte(B.blue),g[A++]=U.floatToByte(B.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let E=0,S=0;for(u=0;u<f;++u){let w=t[u];if(c&&u>0&&(h.pack(w,d,E),E+=3,m=n[u-1],g[S++]=U.floatToByte(m.red),g[S++]=U.floatToByte(m.green),g[S++]=U.floatToByte(m.blue),g[S++]=U.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(w,d,E),E+=3,l(n)&&(m=n[u],g[S++]=U.floatToByte(m.red),g[S++]=U.floatToByte(m.green),g[S++]=U.floatToByte(m.blue),g[S++]=U.floatToByte(m.alpha))}}let y=new _n;y.position=new Me({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(y.color=new Me({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let x=(p-1)*2,b=Ue.createTypedArray(p,x),T=0;for(u=0;u<p-1;++u)b[T++]=u,b[T++]=u+1;return new At({attributes:y,indices:b,primitiveType:Re.LINES,boundingSphere:ce.fromPoints(t)})};var _Re=yO;var uie=class{constructor(t){lt(this,"ellipsoid");lt(this,"rectangle");lt(this,"projection")}getNumberOfXTilesAtLevel(t){_e.throwInstantiationError()}getNumberOfYTilesAtLevel(t){_e.throwInstantiationError()}rectangleToNativeRectangle(t,n){_e.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,o){_e.throwInstantiationError()}tileXYToRectangle(t,n,i,o){_e.throwInstantiationError()}positionToTileXY(t,n,i){_e.throwInstantiationError()}},ARe=uie;function _Ft(e,t){this.rectangle=e,this.maxLevel=t}function yRe(e){this.ellipsoid=e.ellipsoid??te.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}yRe.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 AFt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Yi({ellipsoid:e.ellipsoid});else throw new re(`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=zo.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 a=o[r],s=D.toRadians(parseFloat(a.getAttribute("minx"))),c=D.toRadians(parseFloat(a.getAttribute("miny"))),u=D.toRadians(parseFloat(a.getAttribute("maxx"))),f=D.toRadians(parseFloat(a.getAttribute("maxy"))),d=parseInt(a.getAttribute("maxlevel"),10);e.rectangles.push(new _Ft(new oe(s,c,u,f),d))}}function yFt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Qo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function xFt(e,t,n){try{let i=await t.fetchXML();AFt(e,i)}catch(i){yFt(t,i,n)}}function by(e){e=e??G.EMPTY_OBJECT,this._errorEvent=new ye,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 xt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(by.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(){}}});by.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=new yRe(t),i=De.createIfNeeded(e);await xFt(n,i);let o=new by(t);return n.build(o),o._resource=i,o};by.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),a=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(a))return;let s=this;return Promise.resolve(a).then(function(c){return new ol({buffer:mm(c),width:s._heightmapWidth,height:s._heightmapHeight,childTileMask:bFt(s,e,t,n),structure:s._terrainDataStructure})})};by.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var xRe=new oe;function bFt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,a=o.tileXYToRectangle(t,n,i),s=0;for(let c=0;c<r.length&&s!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=oe.intersection(f,a,xRe);l(d)&&(m5(o,f,t*2,n*2,i+1)&&(s|=4),m5(o,f,t*2+1,n*2,i+1)&&(s|=8),m5(o,f,t*2,n*2+1,i+1)&&(s|=1),m5(o,f,t*2+1,n*2+1,i+1)&&(s|=2))}return s}function m5(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(oe.intersection(r,t,xRe))}by.prototype.getTileDataAvailable=function(e,t,n){};by.prototype.loadTileDataAvailability=function(e,t,n){};var bRe=by;function hT(e){e=e??G.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=e.epoch??Qe.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(hT.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(hT.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=TFt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});hT.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,fe(this)};hT.prototype.isDestroyed=function(){return!1};hT.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};hT.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=this.epoch??Qe.MINIMUM_VALUE,a=Q.secondsDifference(o,r),s=t.duration,c,u=t.currentTime;t.loop?(a=a%s,a<0&&(a=s-a),c=a):a>s?c=s:a<0?c=0:c=a;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function TFt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var TRe=hT;var CRe={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};Object.freeze(CRe);var ERe=CRe;var CFt=new h;function EFt(e,t,n,i){let o=jT(e,t,n,i,CFt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var vRe=EFt;function vFt(e){switch(e){case ee.FLOAT:return"float";case ee.FLOAT_VEC2:return"vec2";case ee.FLOAT_VEC3:return"vec3";case ee.FLOAT_VEC4:return"vec4";case ee.FLOAT_MAT2:return"mat2";case ee.FLOAT_MAT3:return"mat3";case ee.FLOAT_MAT4:return"mat4";case ee.SAMPLER_2D:return"sampler2D";case ee.BOOL:return"bool"}}var SRe=vFt;function SFt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var p5=SFt;var wRe=`uniform sampler2D u_depthTexture;
  15827. in vec2 v_textureCoordinates;
  15828. void main()
  15829. {
  15830. float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
  15831. z_window = czm_reverseLogDepth(z_window);
  15832. float n_range = czm_depthRange.near;
  15833. float f_range = czm_depthRange.far;
  15834. float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
  15835. float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
  15836. out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
  15837. }
  15838. `;var IRe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(IRe);var DRe=IRe;var PRe={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(PRe);var RRe=PRe;function wFt(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 a=await e(i.parameters,o);r.result=a}catch(a){a instanceof Error?r.error={name:a.name,message:a.message,stack:a.stack}:r.error=a}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(a){r.result=void 0,r.error=`postMessage failed with error: ${B0(a)}
  15839. 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 ORe=wFt;globalThis.CESIUM_VERSION="1.142.0";var xO;typeof ko<"u"&&(xO=ko);(function(){/*!
  15840. * Knockout JavaScript library v3.5.1
  15841. * (c) The Knockout.js team - http://knockoutjs.com/
  15842. * License: MIT (http://www.opensource.org/licenses/mit-license.php)
  15843. */(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(a){a(t.ko={})})(function(a,s){function c(_,C){return _===null||typeof _ in A?_===C:!1}function u(_,C){var v;return function(){v||(v=m.a.setTimeout(function(){v=e,_()},C))}}function f(_,C){var v;return function(){clearTimeout(v),v=m.a.setTimeout(_,C)}}function d(_,C){C&&C!=="change"?C==="beforeChange"?this.pc(_):this.gb(_,C):this.qc(_)}function p(_,C){C!==null&&C.s&&C.s()}function g(_,C){var v=this.qd,I=v[E];I.ra||(this.Qb&&this.mb[C]?(v.uc(C,_,this.mb[C]),this.mb[C]=null,--this.Qb):I.I[C]||v.uc(C,_,I.J?{da:_}:v.$c(_)),_.Ja&&_.gd())}var m=typeof a<"u"?a:{};m.b=function(_,C){for(var v=_.split("."),I=m,M=0;M<v.length-1;M++)I=I[v[M]];I[v[v.length-1]]=C},m.L=function(_,C,v){_[C]=v},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=(function(){function _(H,Z){for(var K in H)M.call(H,K)&&Z(K,H[K])}function C(H,Z){if(Z)for(var K in Z)M.call(Z,K)&&(H[K]=Z[K]);return H}function v(H,Z){return H.__proto__=Z,H}function I(H,Z,K,le){var me=H[Z].match(q)||[];m.a.D(K.match(q),function(ae){m.a.Na(me,ae,le)}),H[Z]=me.join(" ")}var M=Object.prototype.hasOwnProperty,N={__proto__:[]}instanceof Array,j=typeof Symbol=="function",k={},V={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(k,function(H,Z){if(Z.length)for(var K=0,le=Z.length;K<le;K++)V[Z[K]]=H});var F={propertychange:!0},W=n&&(function(){for(var H=3,Z=n.createElement("div"),K=Z.getElementsByTagName("i");Z.innerHTML="<!--[if gt IE "+ ++H+"]><i></i><![endif]-->",K[0];);return 4<H?H:e})(),q=/\S+/g,J;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(H,Z,K){for(var le=0,me=H.length;le<me;le++)Z.call(K,H[le],le,H)},A:typeof Array.prototype.indexOf=="function"?function(H,Z){return Array.prototype.indexOf.call(H,Z)}:function(H,Z){for(var K=0,le=H.length;K<le;K++)if(H[K]===Z)return K;return-1},Lb:function(H,Z,K){for(var le=0,me=H.length;le<me;le++)if(Z.call(K,H[le],le,H))return H[le];return e},Pa:function(H,Z){var K=m.a.A(H,Z);0<K?H.splice(K,1):K===0&&H.shift()},wc:function(H){var Z=[];return H&&m.a.D(H,function(K){0>m.a.A(Z,K)&&Z.push(K)}),Z},Mb:function(H,Z,K){var le=[];if(H)for(var me=0,ae=H.length;me<ae;me++)le.push(Z.call(K,H[me],me));return le},jb:function(H,Z,K){var le=[];if(H)for(var me=0,ae=H.length;me<ae;me++)Z.call(K,H[me],me)&&le.push(H[me]);return le},Nb:function(H,Z){if(Z instanceof Array)H.push.apply(H,Z);else for(var K=0,le=Z.length;K<le;K++)H.push(Z[K]);return H},Na:function(H,Z,K){var le=m.a.A(m.a.bc(H),Z);0>le?K&&H.push(Z):K||H.splice(le,1)},Ba:N,extend:C,setPrototypeOf:v,Ab:N?v:C,P:_,Ga:function(H,Z,K){if(!H)return H;var le={},me;for(me in H)M.call(H,me)&&(le[me]=Z.call(K,H[me],me,H));return le},Tb:function(H){for(;H.firstChild;)m.removeNode(H.firstChild)},Yb:function(H){H=m.a.la(H);for(var Z=(H[0]&&H[0].ownerDocument||n).createElement("div"),K=0,le=H.length;K<le;K++)Z.appendChild(m.oa(H[K]));return Z},Ca:function(H,Z){for(var K=0,le=H.length,me=[];K<le;K++){var ae=H[K].cloneNode(!0);me.push(Z?m.oa(ae):ae)}return me},va:function(H,Z){if(m.a.Tb(H),Z)for(var K=0,le=Z.length;K<le;K++)H.appendChild(Z[K])},Xc:function(H,Z){var K=H.nodeType?[H]:H;if(0<K.length){for(var le=K[0],me=le.parentNode,ae=0,be=Z.length;ae<be;ae++)me.insertBefore(Z[ae],le);for(ae=0,be=K.length;ae<be;ae++)m.removeNode(K[ae])}},Ua:function(H,Z){if(H.length){for(Z=Z.nodeType===8&&Z.parentNode||Z;H.length&&H[0].parentNode!==Z;)H.splice(0,1);for(;1<H.length&&H[H.length-1].parentNode!==Z;)H.length--;if(1<H.length){var K=H[0],le=H[H.length-1];for(H.length=0;K!==le;)H.push(K),K=K.nextSibling;H.push(le)}}return H},Zc:function(H,Z){7>W?H.setAttribute("selected",Z):H.selected=Z},Db:function(H){return H===null||H===e?"":H.trim?H.trim():H.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(H,Z){return H=H||"",Z.length>H.length?!1:H.substring(0,Z.length)===Z},vd:function(H,Z){if(H===Z)return!0;if(H.nodeType===11)return!1;if(Z.contains)return Z.contains(H.nodeType!==1?H.parentNode:H);if(Z.compareDocumentPosition)return(Z.compareDocumentPosition(H)&16)==16;for(;H&&H!=Z;)H=H.parentNode;return!!H},Sb:function(H){return m.a.vd(H,H.ownerDocument.documentElement)},kd:function(H){return!!m.a.Lb(H,m.a.Sb)},R:function(H){return H&&H.tagName&&H.tagName.toLowerCase()},Ac:function(H){return m.onError?function(){try{return H.apply(this,arguments)}catch(Z){throw m.onError&&m.onError(Z),Z}}:H},setTimeout:function(H,Z){return setTimeout(m.a.Ac(H),Z)},Gc:function(H){setTimeout(function(){throw m.onError&&m.onError(H),H},0)},B:function(H,Z,K){var le=m.a.Ac(K);if(K=F[Z],m.options.useOnlyNativeEvents||K||!o)if(K||typeof H.addEventListener!="function")if(typeof H.attachEvent<"u"){var me=function(be){le.call(H,be)},ae="on"+Z;H.attachEvent(ae,me),m.a.K.za(H,function(){H.detachEvent(ae,me)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else H.addEventListener(Z,le,!1);else J||(J=typeof o(H).on=="function"?"on":"bind"),o(H)[J](Z,le)},Fb:function(H,Z){if(!H||!H.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var K;if(m.a.R(H)==="input"&&H.type&&Z.toLowerCase()=="click"?(K=H.type,K=K=="checkbox"||K=="radio"):K=!1,m.options.useOnlyNativeEvents||!o||K)if(typeof n.createEvent=="function")if(typeof H.dispatchEvent=="function")K=n.createEvent(V[Z]||"HTMLEvents"),K.initEvent(Z,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,H),H.dispatchEvent(K);else throw Error("The supplied element doesn't support dispatchEvent");else if(K&&H.click)H.click();else if(typeof H.fireEvent<"u")H.fireEvent("on"+Z);else throw Error("Browser doesn't support triggering events");else o(H).trigger(Z)},f:function(H){return m.O(H)?H():H},bc:function(H){return m.O(H)?H.v():H},Eb:function(H,Z,K){var le;Z&&(typeof H.classList=="object"?(le=H.classList[K?"add":"remove"],m.a.D(Z.match(q),function(me){le.call(H.classList,me)})):typeof H.className.baseVal=="string"?I(H.className,"baseVal",Z,K):I(H,"className",Z,K))},Bb:function(H,Z){var K=m.a.f(Z);(K===null||K===e)&&(K="");var le=m.h.firstChild(H);!le||le.nodeType!=3||m.h.nextSibling(le)?m.h.va(H,[H.ownerDocument.createTextNode(K)]):le.data=K,m.a.Ad(H)},Yc:function(H,Z){if(H.name=Z,7>=W)try{var K=H.name.replace(/[&<>'"]/g,function(le){return"&#"+le.charCodeAt(0)+";"});H.mergeAttributes(n.createElement("<input name='"+K+"'/>"),!1)}catch{}},Ad:function(H){9<=W&&(H=H.nodeType==1?H:H.parentNode,H.style&&(H.style.zoom=H.style.zoom))},wd:function(H){if(W){var Z=H.style.width;H.style.width=0,H.style.width=Z}},Pd:function(H,Z){H=m.a.f(H),Z=m.a.f(Z);for(var K=[],le=H;le<=Z;le++)K.push(le);return K},la:function(H){for(var Z=[],K=0,le=H.length;K<le;K++)Z.push(H[K]);return Z},Da:function(H){return j?Symbol(H):H},Zd:W===6,$d:W===7,W,Lc:function(H,Z){for(var K=m.a.la(H.getElementsByTagName("input")).concat(m.a.la(H.getElementsByTagName("textarea"))),le=typeof Z=="string"?function(be){return be.name===Z}:function(be){return Z.test(be.name)},me=[],ae=K.length-1;0<=ae;ae--)le(K[ae])&&me.push(K[ae]);return me},Nd:function(H){return typeof H=="string"&&(H=m.a.Db(H))?r&&r.parse?r.parse(H):new Function("return "+H)():null},hc:function(H,Z,K){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(m.a.f(H),Z,K)},Od:function(H,Z,K){K=K||{};var le=K.params||{},me=K.includeFields||this.Jc,ae=H;if(typeof H=="object"&&m.a.R(H)==="form")for(var ae=H.action,be=me.length-1;0<=be;be--)for(var ge=m.a.Lc(H,me[be]),we=ge.length-1;0<=we;we--)le[ge[we].name]=ge[we].value;Z=m.a.f(Z);var Ee=n.createElement("form");Ee.style.display="none",Ee.action=ae,Ee.method="post";for(var Be in Z)H=n.createElement("input"),H.type="hidden",H.name=Be,H.value=m.a.hc(m.a.f(Z[Be])),Ee.appendChild(H);_(le,function(ke,Ge){var rt=n.createElement("input");rt.type="hidden",rt.name=ke,rt.value=Ge,Ee.appendChild(rt)}),n.body.appendChild(Ee),K.submitter?K.submitter(Ee):Ee.submit(),setTimeout(function(){Ee.parentNode.removeChild(Ee)},0)}}})(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var C=this;if(arguments.length===1)return function(){return C.apply(_,arguments)};var v=Array.prototype.slice.call(arguments,1);return function(){var I=v.slice(0);return I.push.apply(I,arguments),C.apply(_,I)}}),m.a.g=new function(){var _=0,C="__ko__"+new Date().getTime(),v={},I,M;return m.a.W?(I=function(N,j){var k=N[C];if(!k||k==="null"||!v[k]){if(!j)return e;k=N[C]="ko"+_++,v[k]={}}return v[k]},M=function(N){var j=N[C];return j?(delete v[j],N[C]=null,!0):!1}):(I=function(N,j){var k=N[C];return!k&&j&&(k=N[C]={}),k},M=function(N){return N[C]?(delete N[C],!0):!1}),{get:function(N,j){var k=I(N,!1);return k&&k[j]},set:function(N,j,k){(N=I(N,k!==e))&&(N[j]=k)},Ub:function(N,j,k){return N=I(N,!0),N[j]||(N[j]=k)},clear:M,Z:function(){return _+++C}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(j,k){var V=m.a.g.get(j,I);return V===e&&k&&(V=[],m.a.g.set(j,I,V)),V}function C(j){var k=_(j,!1);if(k)for(var k=k.slice(0),V=0;V<k.length;V++)k[V](j);m.a.g.clear(j),m.a.K.cleanExternalData(j),N[j.nodeType]&&v(j.childNodes,!0)}function v(j,k){for(var V=[],F,W=0;W<j.length;W++)if((!k||j[W].nodeType===8)&&(C(V[V.length]=F=j[W]),j[W]!==F))for(;W--&&m.a.A(V,j[W])==-1;);}var I=m.a.g.Z(),M={1:!0,8:!0,9:!0},N={1:!0,9:!0};return{za:function(j,k){if(typeof k!="function")throw Error("Callback must be a function");_(j,!0).push(k)},yb:function(j,k){var V=_(j,!1);V&&(m.a.Pa(V,k),V.length==0&&m.a.g.set(j,I,e))},oa:function(j){return m.u.G(function(){M[j.nodeType]&&(C(j),N[j.nodeType]&&v(j.getElementsByTagName("*")))}),j},removeNode:function(j){m.oa(j),j.parentNode&&j.parentNode.removeChild(j)},cleanExternalData:function(j){o&&typeof o.cleanData=="function"&&o.cleanData([j])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),(function(){var _=[0,"",""],C=[1,"<table>","</table>"],v=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],M={thead:C,tbody:C,tfoot:C,tr:[2,"<table><tbody>","</tbody></table>"],td:v,th:v,option:I,optgroup:I},N=8>=m.a.W;m.a.ua=function(j,k){var V;if(o){if(o.parseHTML)V=o.parseHTML(j,k)||[];else if((V=o.clean([j],k))&&V[0]){for(var F=V[0];F.parentNode&&F.parentNode.nodeType!==11;)F=F.parentNode;F.parentNode&&F.parentNode.removeChild(F)}}else{(V=k)||(V=n);var F=V.parentWindow||V.defaultView||t,W=m.a.Db(j).toLowerCase(),q=V.createElement("div"),J;for(J=(W=W.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&M[W[1]]||_,W=J[0],J="ignored<div>"+J[1]+j+J[2]+"</div>",typeof F.innerShiv=="function"?q.appendChild(F.innerShiv(J)):(N&&V.body.appendChild(q),q.innerHTML=J,N&&q.parentNode.removeChild(q));W--;)q=q.lastChild;V=m.a.la(q.lastChild.childNodes)}return V},m.a.Md=function(j,k){var V=m.a.ua(j,k);return V.length&&V[0].parentElement||m.a.Yb(V)},m.a.fc=function(j,k){if(m.a.Tb(j),k=m.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),o)o(j).html(k);else for(var V=m.a.ua(k,j.ownerDocument),F=0;F<V.length;F++)j.appendChild(V[F])}})(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=(function(){function _(v,I){if(v){if(v.nodeType==8){var M=m.aa.Uc(v.nodeValue);M!=null&&I.push({ud:v,Kd:M})}else if(v.nodeType==1)for(var M=0,N=v.childNodes,j=N.length;M<j;M++)_(N[M],I)}}var C={};return{Xb:function(v){if(typeof v!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return C[I]=v,"<!--[ko_memo:"+I+"]-->"},bd:function(v,I){var M=C[v];if(M===e)throw Error("Couldn't find any memo with ID "+v+". Perhaps it's already been unmemoized.");try{return M.apply(null,I||[]),!0}finally{delete C[v]}},cd:function(v,I){var M=[];_(v,M);for(var N=0,j=M.length;N<j;N++){var k=M[N].ud,V=[k];I&&m.a.Nb(V,I),m.aa.bd(M[N].Kd,V),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(v){return(v=v.match(/^\[ko_memo\:(.*?)\]$/))?v[1]:null}}})(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=(function(){function _(){if(M){for(var k=M,V=0,F;j<M;)if(F=I[j++]){if(j>k){if(5e3<=++V){j=M,m.a.Gc(Error("'Too much recursion' after processing "+V+" task groups."));break}k=M}try{F()}catch(W){m.a.Gc(W)}}}}function C(){_(),j=M=I.length=0}var v,I=[],M=0,N=1,j=0;return t.MutationObserver?v=(function(k){var V=n.createElement("div");return new MutationObserver(k).observe(V,{attributes:!0}),function(){V.classList.toggle("foo")}})(C):v=n&&"onreadystatechange"in n.createElement("script")?function(k){var V=n.createElement("script");V.onreadystatechange=function(){V.onreadystatechange=null,n.documentElement.removeChild(V),V=null,k()},n.documentElement.appendChild(V)}:function(k){setTimeout(k,0)},{scheduler:v,zb:function(k){return M||m.na.scheduler(C),I[M++]=k,N++},cancel:function(k){k=k-(N-M),k>=j&&k<M&&(I[k]=null)},resetForTesting:function(){var k=M-j;return j=M=I.length=0,k},Sd:_}})(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,C){_.throttleEvaluation=C;var v=null;return m.$({read:_,write:function(I){clearTimeout(v),v=m.a.setTimeout(function(){_(I)},C)}})},rateLimit:function(_,C){var v,I,M;typeof C=="number"?v=C:(v=C.timeout,I=C.method),_.Hb=!1,M=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(N){return M(N,v,C)})},deferred:function(_,C){if(C!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(v){var I,M=!1;return function(){if(!M){m.na.cancel(I),I=m.na.zb(v);try{M=!0,_.notifySubscribers(e,"dirty")}finally{M=!1}}}}))},notify:function(_,C){_.equalityComparer=C=="always"?null:c}};var A={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,C,v){this.da=_,this.lc=C,this.mc=v,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,y),y.qb(this)};var y={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,C,v){var I=this;v=v||"change";var M=new m.ic(I,C?_.bind(C):_,function(){m.a.Pa(I.U[v],M),I.hb&&I.hb(v)});return I.Qa&&I.Qa(v),I.U[v]||(I.U[v]=[]),I.U[v].push(M),M},notifySubscribers:function(_,C){if(C=C||"change",C==="change"&&this.Gb(),this.Wa(C)){var v=C==="change"&&this.ed||this.U[C].slice(0);try{m.u.xc();for(var I=0,M;M=v[I];++I)M.Ib||M.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var C=this,v=m.O(C),I,M,N,j,k;C.gb||(C.gb=C.notifySubscribers,C.notifySubscribers=d);var V=_(function(){C.Ja=!1,v&&j===C&&(j=C.nc?C.nc():C());var F=M||k&&C.sb(N,j);k=M=I=!1,F&&C.gb(N=j)});C.qc=function(F,W){W&&C.Ja||(k=!W),C.ed=C.U.change.slice(0),C.Ja=I=!0,j=F,V()},C.pc=function(F){I||(N=F,C.gb(F,"beforeChange"))},C.rc=function(){k=!0},C.gd=function(){C.sb(N,C.v(!0))&&(M=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var C=0;return m.a.P(this.U,function(v,I){v!=="dirty"&&(C+=I.length)}),C},sb:function(_,C){return!this.equalityComparer||!this.equalityComparer(_,C)},toString:function(){return"[object Object]"},extend:function(_){var C=this;return _&&m.a.P(_,function(v,I){var M=m.Ta[v];typeof M=="function"&&(C=M(C,I)||C)}),C}};m.L(y,"init",y.qb),m.L(y,"subscribe",y.subscribe),m.L(y,"extend",y.extend),m.L(y,"getSubscriptionsCount",y.Bd),m.a.Ba&&m.a.setPrototypeOf(y,Function.prototype),m.T.fn=y,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=(function(){function _(N){v.push(I),I=N}function C(){I=v.pop()}var v=[],I,M=0;return{xc:_,end:C,cc:function(N){if(I){if(!m.Qc(N))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,N,N.fd||(N.fd=++M))}},G:function(N,j,k){try{return _(),N.apply(j,k||[])}finally{C()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}})(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var x=m.a.Da("_latestValue");m.ta=function(_){function C(){return 0<arguments.length?(C.sb(C[x],arguments[0])&&(C.ya(),C[x]=arguments[0],C.xa()),this):(m.u.cc(C),C[x])}return C[x]=_,m.a.Ba||m.a.extend(C,m.T.fn),m.T.fn.qb(C),m.a.Ab(C,b),m.options.deferUpdates&&m.Ta.deferred(C,!0),C};var b={equalityComparer:c,v:function(){return this[x]},xa:function(){this.notifySubscribers(this[x],"spectate"),this.notifySubscribers(this[x])},ya:function(){this.notifySubscribers(this[x],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(b,m.T.fn);var T=m.ta.Ma="__ko_proto__";b[T]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[T])&&_!==b[T]&&_!==m.o.fn[T])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[T]===b[T]||_[T]===m.o.fn[T]&&_.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",b),m.L(b,"peek",b.v),m.L(b,"valueHasMutated",b.xa),m.L(b,"valueWillMutate",b.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var C=this.v(),v=[],I=typeof _!="function"||m.O(_)?function(j){return j===_}:_,M=0;M<C.length;M++){var N=C[M];if(I(N)){if(v.length===0&&this.ya(),C[M]!==N)throw Error("Array modified during remove; cannot remove item");v.push(N),C.splice(M,1),M--}}return v.length&&this.xa(),v},removeAll:function(_){if(_===e){var C=this.v(),v=C.slice(0);return this.ya(),C.splice(0,C.length),this.xa(),v}return _?this.remove(function(I){return 0<=m.a.A(_,I)}):[]},destroy:function(_){var C=this.v(),v=typeof _!="function"||m.O(_)?function(N){return N===_}:_;this.ya();for(var I=C.length-1;0<=I;I--){var M=C[I];v(M)&&(M._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(C){return 0<=m.a.A(_,C)}):[]},indexOf:function(_){var C=this();return m.a.A(C,_)},replace:function(_,C){var v=this.indexOf(_);0<=v&&(this.ya(),this.v()[v]=C,this.xa())},sorted:function(_){var C=this().slice(0);return _?C.sort(_):C.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){m.Ha.fn[_]=function(){var C=this.v();this.ya(),this.zc(C,_,arguments);var v=C[_].apply(C,arguments);return this.xa(),v===C?this:v}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var C=this();return C[_].apply(C,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,C){function v(){function q(){if(k){var J=[].concat(_.v()||[]),H;_.Wa("arrayChange")&&((!M||1<k)&&(M=m.a.Pb(V,J,_.Ob)),H=M),V=J,M=null,k=0,H&&H.length&&_.notifySubscribers(H,"arrayChange")}}I?q():(I=!0,j=_.subscribe(function(){++k},null,"spectate"),V=[].concat(_.v()||[]),M=null,N=_.subscribe(q))}if(_.Ob={},C&&typeof C=="object"&&m.a.extend(_.Ob,C),_.Ob.sparse=!0,!_.zc){var I=!1,M=null,N,j,k=0,V,F=_.Qa,W=_.hb;_.Qa=function(q){F&&F.call(_,q),q==="arrayChange"&&v()},_.hb=function(q){W&&W.call(_,q),q!=="arrayChange"||_.Wa("arrayChange")||(N&&N.s(),j&&j.s(),j=N=null,I=!1,V=e)},_.zc=function(q,J,H){function Z(Ee,Be,ke){return K[K.length]={status:Ee,value:Be,index:ke}}if(I&&!k){var K=[],le=q.length,me=H.length,ae=0;switch(J){case"push":ae=le;case"unshift":for(J=0;J<me;J++)Z("added",H[J],ae+J);break;case"pop":ae=le-1;case"shift":le&&Z("deleted",q[ae],ae);break;case"splice":J=Math.min(Math.max(0,0>H[0]?le+H[0]:H[0]),le);for(var le=me===1?le:Math.min(J+(H[1]||0),le),me=J+me-2,ae=Math.max(le,me),be=[],ge=[],we=2;J<ae;++J,++we)J<le&&ge.push(Z("deleted",q[J],J)),J<me&&be.push(Z("added",H[we],J));m.a.Kc(ge,be);break;default:return}M=K}}}};var E=m.a.Da("_state");m.o=m.$=function(_,C,v){function I(){if(0<arguments.length){if(typeof M=="function")M.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||m.u.cc(I),(N.ka||N.J&&I.Xa())&&I.ha(),N.X}if(typeof _=="object"?v=_:(v=v||{},_&&(v.read=_)),typeof v.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var M=v.write,N={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:v.read,nb:C||v.owner,l:v.disposeWhenNodeIsRemoved||v.l||null,Sa:v.disposeWhen||v.Sa,Rb:null,I:{},V:0,Ic:null};return I[E]=N,I.Nc=typeof M=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,S),v.pure?(N.wb=!0,N.J=!0,m.a.extend(I,w)):v.deferEvaluation&&m.a.extend(I,P),m.options.deferUpdates&&m.Ta.deferred(I,!0),N.l&&(N.jc=!0,N.l.nodeType||(N.l=null)),N.J||v.deferEvaluation||I.ha(),N.l&&I.ja()&&m.a.K.za(N.l,N.Rb=function(){I.s()}),I};var S={equalityComparer:c,qa:function(){return this[E].V},Va:function(){var _=[];return m.a.P(this[E].I,function(C,v){_[v.Ka]=v.da}),_},Vb:function(_){if(!this[E].V)return!1;var C=this.Va();return m.a.A(C,_)!==-1?!0:!!m.a.Lb(C,function(v){return v.Vb&&v.Vb(_)})},uc:function(_,C,v){if(this[E].wb&&C===this)throw Error("A 'pure' computed must not be called recursively");this[E].I[_]=v,v.Ka=this[E].V++,v.La=C.ob()},Xa:function(){var _,C,v=this[E].I;for(_ in v)if(Object.prototype.hasOwnProperty.call(v,_)&&(C=v[_],this.Ia&&C.da.Ja||C.da.Dd(C.La)))return!0},Jd:function(){this.Ia&&!this[E].rb&&this.Ia(!1)},ja:function(){var _=this[E];return _.ka||0<_.V},Rd:function(){this.Ja?this[E].ka&&(this[E].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var C=_.subscribe(this.Jd,this,"dirty"),v=_.subscribe(this.Rd,this);return{da:_,s:function(){C.s(),v.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,C=_.throttleEvaluation;C&&0<=C?(clearTimeout(this[E].Ic),this[E].Ic=m.a.setTimeout(function(){_.ha(!0)},C)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var C=this[E],v=C.Sa,I=!1;if(!C.rb&&!C.ra){if(C.l&&!m.a.Sb(C.l)||v&&v()){if(!C.jc){this.s();return}}else C.jc=!1;C.rb=!0;try{I=this.zd(_)}finally{C.rb=!1}return I}},zd:function(_){var C=this[E],I=!1,v=C.wb?e:!C.V,I={qd:this,mb:C.I,Qb:C.V};m.u.xc({pd:I,od:g,o:this,Ya:v}),C.I={},C.V=0;var M=this.yd(C,I);return C.V?I=this.sb(C.X,M):(this.s(),I=!0),I&&(C.J?this.Gb():this.notifySubscribers(C.X,"beforeChange"),C.X=M,this.notifySubscribers(C.X,"spectate"),!C.J&&_&&this.notifySubscribers(C.X),this.rc&&this.rc()),v&&this.notifySubscribers(C.X,"awake"),I},yd:function(_,C){try{var v=_.Wc;return _.nb?v.call(_.nb):v()}finally{m.u.end(),C.Qb&&!_.J&&m.a.P(C.mb,p),_.sa=_.ka=!1}},v:function(_){var C=this[E];return(C.ka&&(_||!C.V)||C.J&&this.Xa())&&this.ha(),C.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[E].J||(this[E].sa?this.ha():this[E].ka=!1),this[E].X},this.Ia=function(C){this.pc(this[E].X),this[E].ka=!0,C&&(this[E].sa=!0),this.qc(this,!C)}},s:function(){var _=this[E];!_.J&&_.I&&m.a.P(_.I,function(C,v){v.s&&v.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},w={Qa:function(_){var C=this,v=C[E];if(!v.ra&&v.J&&_=="change"){if(v.J=!1,v.sa||C.Xa())v.I=null,v.V=0,C.ha()&&C.Gb();else{var I=[];m.a.P(v.I,function(M,N){I[N.Ka]=M}),m.a.D(I,function(M,N){var j=v.I[M],k=C.$c(j.da);k.Ka=N,k.La=j.La,v.I[M]=k}),C.Xa()&&C.ha()&&C.Gb()}v.ra||C.notifySubscribers(v.X,"awake")}},hb:function(_){var C=this[E];C.ra||_!="change"||this.Wa("change")||(m.a.P(C.I,function(v,I){I.s&&(C.I[v]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),C.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[E];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},P={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(S,m.T.fn);var O=m.ta.Ma;S[O]=m.o,m.Oc=function(_){return typeof _=="function"&&_[O]===S[O]},m.Fd=function(_){return m.Oc(_)&&_[E]&&_[E].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",S),m.L(S,"peek",S.v),m.L(S,"dispose",S.s),m.L(S,"isActive",S.ja),m.L(S,"getDependenciesCount",S.qa),m.L(S,"getDependencies",S.Va),m.xb=function(_,C){return typeof _=="function"?m.o(_,C,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,C))},m.b("pureComputed",m.xb),(function(){function _(I,M,N){if(N=N||new v,I=M(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var j=I instanceof Array?[]:{};return N.save(I,j),C(I,function(k){var V=M(I[k]);switch(typeof V){case"boolean":case"number":case"string":case"function":j[k]=V;break;case"object":case"undefined":var F=N.get(V);j[k]=F!==e?F:_(V,M,N)}}),j}function C(I,M){if(I instanceof Array){for(var N=0;N<I.length;N++)M(N);typeof I.toJSON=="function"&&M("toJSON")}else for(N in I)M(N)}function v(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(M){for(var N=0;m.O(M)&&10>N;N++)M=M();return M})},m.toJSON=function(I,M,N){return I=m.ad(I),m.a.hc(I,M,N)},v.prototype={constructor:v,save:function(I,M){var N=m.a.A(this.keys,I);0<=N?this.values[N]=M:(this.keys.push(I),this.values.push(M))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}})(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,C,v){function I(M){var N=m.xb(_,v).extend({ma:"always"}),j=N.subscribe(function(k){k&&(j.s(),M(k))});return N.notifySubscribers(N.v()),j}return typeof Promise!="function"||C?I(C.bind(v)):new Promise(I)},m.b("when",m.Wd),(function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,C,v){switch(m.a.R(_)){case"option":typeof C=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=C):(m.a.g.set(_,m.c.options.$b,C),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof C=="number"?C:"");break;case"select":(C===""||C===null)&&(C=e);for(var I=-1,M=0,N=_.options.length,j;M<N;++M)if(j=m.w.M(_.options[M]),j==C||j===""&&C===e){I=M;break}(v||0<=I||C===e&&1<_.size)&&(_.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(C===null||C===e)&&(C=""),_.value=C}}}})(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=(function(){function _(k){k=m.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=`
  15844. ,`;var V=[],F=k.match(I),W,q=[],J=0;if(1<F.length){for(var H=0,Z;Z=F[H];++H){var K=Z.charCodeAt(0);if(K===44){if(0>=J){V.push(W&&q.length?{key:W,value:q.join("")}:{unknown:W||q.join("")}),W=J=0,q=[];continue}}else if(K===58){if(!J&&!W&&q.length===1){W=q.pop();continue}}else{if(K===47&&1<Z.length&&(Z.charCodeAt(1)===47||Z.charCodeAt(1)===42))continue;K===47&&H&&1<Z.length?(K=F[H-1].match(M))&&!N[K[0]]&&(k=k.substr(k.indexOf(Z)+1),F=k.match(I),H=-1,Z="/"):K===40||K===123||K===91?++J:K===41||K===125||K===93?--J:W||q.length||K!==34&&K!==39||(Z=Z.slice(1,-1))}q.push(Z)}if(0<J)throw Error("Unbalanced parentheses, braces, or brackets")}return V}var C=["true","false","null","undefined"],v=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
  15845. |/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,N={in:1,return:1,typeof:1},j={};return{Ra:[],wa:j,ac:_,vb:function(k,V){function F(K,le){var me;if(!H){var ae=m.getBindingHandler(K);if(ae&&ae.preprocess&&!(le=ae.preprocess(le,K,F)))return;(ae=j[K])&&(me=le,0<=m.a.A(C,me)?me=!1:(ae=me.match(v),me=ae===null?!1:ae[1]?"Object("+ae[1]+")"+ae[2]:me),ae=me),ae&&q.push("'"+(typeof j[K]=="string"?j[K]:K)+"':function(_z){"+me+"=_z}")}J&&(le="function(){return "+le+" }"),W.push("'"+K+"':"+le)}V=V||{};var W=[],q=[],J=V.valueAccessors,H=V.bindingParams,Z=typeof k=="string"?_(k):k;return m.a.D(Z,function(K){F(K.key||K.unknown,K.value)}),q.length&&F("_ko_property_writers","{"+q.join(",")+" }"),W.join(",")},Id:function(k,V){for(var F=0;F<k.length;F++)if(k[F].key==V)return!0;return!1},eb:function(k,V,F,W,q){k&&m.O(k)?!m.Za(k)||q&&k.v()===W||k(W):(k=V.get("_ko_property_writers"))&&k[F]&&k[F](W)}}})(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),(function(){function _(F){return F.nodeType==8&&N.test(M?F.text:F.nodeValue)}function C(F){return F.nodeType==8&&j.test(M?F.text:F.nodeValue)}function v(F,W){for(var q=F,J=1,H=[];q=q.nextSibling;){if(C(q)&&(m.a.g.set(q,V,!0),J--,J===0))return H;H.push(q),_(q)&&J++}if(!W)throw Error("Cannot find closing comment tag to match: "+F.nodeValue);return null}function I(F,W){var q=v(F,W);return q?0<q.length?q[q.length-1].nextSibling:F.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",N=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,j=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},V="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(F){return _(F)?v(F):F.childNodes},Ea:function(F){if(_(F)){F=m.h.childNodes(F);for(var W=0,q=F.length;W<q;W++)m.removeNode(F[W])}else m.a.Tb(F)},va:function(F,W){if(_(F)){m.h.Ea(F);for(var q=F.nextSibling,J=0,H=W.length;J<H;J++)q.parentNode.insertBefore(W[J],q)}else m.a.va(F,W)},Vc:function(F,W){var q;_(F)?(q=F.nextSibling,F=F.parentNode):q=F.firstChild,q?W!==q&&F.insertBefore(W,q):F.appendChild(W)},Wb:function(F,W,q){q?(q=q.nextSibling,_(F)&&(F=F.parentNode),q?W!==q&&F.insertBefore(W,q):F.appendChild(W)):m.h.Vc(F,W)},firstChild:function(F){if(_(F))return!F.nextSibling||C(F.nextSibling)?null:F.nextSibling;if(F.firstChild&&C(F.firstChild))throw Error("Found invalid end comment, as the first child of "+F);return F.firstChild},nextSibling:function(F){if(_(F)&&(F=I(F)),F.nextSibling&&C(F.nextSibling)){var W=F.nextSibling;if(C(W)&&!m.a.g.get(W,V))throw Error("Found end comment without a matching opening comment, as child of "+F);return null}return F.nextSibling},Cd:_,Vd:function(F){return(F=(M?F.text:F.nodeValue).match(N))?F[1]:null},Sc:function(F){if(k[m.a.R(F)]){var W=F.firstChild;if(W)do if(W.nodeType===1){var q;q=W.firstChild;var J=null;if(q)do if(J)J.push(q);else if(_(q)){var H=I(q,!0);H?q=H:J=[q]}else C(q)&&(J=[q]);while(q=q.nextSibling);if(q=J)for(J=W.nextSibling,H=0;H<q.length;H++)J?F.insertBefore(q[H],J):F.appendChild(q[H])}while(W=W.nextSibling)}}}})(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),(function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,C){var v=this.getBindingsString(_,C),v=v?this.parseBindingsString(v,C,_):null;return m.j.tc(v,_,C,!1)},getBindingAccessors:function(_,C){var v=this.getBindingsString(_,C),v=v?this.parseBindingsString(v,C,_,{valueAccessors:!0}):null;return m.j.tc(v,_,C,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,C,v,I){try{var M=this.nd,N=_+(I&&I.valueAccessors||""),j;if(!(j=M[N])){var k,V="with($context){with($data||{}){return{"+m.m.vb(_,I)+"}}}";k=new Function("$context","$element",V),j=M[N]=k}return j(C,v)}catch(F){throw F.message=`Unable to parse bindings.
  15846. Bindings value: `+_+`
  15847. Message: `+F.message,F}}}),m.ga.instance=new m.ga})(),m.b("bindingProvider",m.ga),(function(){function _(ae){var be=(ae=m.a.g.get(ae,me))&&ae.N;be&&(ae.N=null,be.Tc())}function C(ae,be,ge){this.node=ae,this.yc=be,this.kb=[],this.H=!1,be.N||m.a.K.za(ae,_),ge&&ge.N&&(ge.N.kb.push(ae),this.Kb=ge)}function v(ae){return function(){return ae}}function I(ae){return ae()}function M(ae){return m.a.Ga(m.u.G(ae),function(be,ge){return function(){return ae()[ge]}})}function N(ae,be,ge){return typeof ae=="function"?M(ae.bind(null,be,ge)):m.a.Ga(ae,v)}function j(ae,be){return M(this.getBindings.bind(this,ae,be))}function k(ae,be){var ge=m.h.firstChild(be);if(ge){var we,Ee=m.ga.instance,Be=Ee.preprocessNode;if(Be){for(;we=ge;)ge=m.h.nextSibling(we),Be.call(Ee,we);ge=m.h.firstChild(be)}for(;we=ge;)ge=m.h.nextSibling(we),V(ae,we)}m.i.ma(be,m.i.H)}function V(ae,be){var ge=ae,we=be.nodeType===1;we&&m.h.Sc(be),(we||m.ga.instance.nodeHasBindings(be))&&(ge=W(be,null,ae).bindingContextForDescendants),ge&&!K[m.a.R(be)]&&k(ge,be)}function F(ae){var be=[],ge={},we=[];return m.a.P(ae,function Ee(Be){if(!ge[Be]){var ke=m.getBindingHandler(Be);ke&&(ke.after&&(we.push(Be),m.a.D(ke.after,function(Ge){if(ae[Ge]){if(m.a.A(we,Ge)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+we.join(", "));Ee(Ge)}}),we.length--),be.push({key:Be,Mc:ke})),ge[Be]=!0}}),be}function W(ae,be,ge){var we=m.a.g.Ub(ae,me,{}),Ee=we.hd;if(!be){if(Ee)throw Error("You cannot apply bindings multiple times to the same element.");we.hd=!0}Ee||(we.context=ge),we.Zb||(we.Zb={});var Be;if(be&&typeof be!="function")Be=be;else{var ke=m.ga.instance,Ge=ke.getBindingAccessors||j,rt=m.$(function(){return(Be=be?be(ge,ae):Ge.call(ke,ae,ge))&&(ge[J]&&ge[J](),ge[Z]&&ge[Z]()),Be},null,{l:ae});Be&&rt.ja()||(rt=null)}var et=ge,Pe;if(Be){var Ye=function(){return m.a.Ga(rt?rt():Be,I)},ut=rt?function(Ct){return function(){return I(rt()[Ct])}}:function(Ct){return Be[Ct]};Ye.get=function(Ct){return Be[Ct]&&I(ut(Ct))},Ye.has=function(Ct){return Ct in Be},m.i.H in Be&&m.i.subscribe(ae,m.i.H,function(){var Ct=(0,Be[m.i.H])();if(Ct){var en=m.h.childNodes(ae);en.length&&Ct(en,m.Ec(en[0]))}}),m.i.pa in Be&&(et=m.i.Cb(ae,ge),m.i.subscribe(ae,m.i.pa,function(){var Ct=(0,Be[m.i.pa])();Ct&&m.h.firstChild(ae)&&Ct(ae)})),we=F(Be),m.a.D(we,function(Ct){var en=Ct.Mc.init,Gt=Ct.Mc.update,yt=Ct.key;if(ae.nodeType===8&&!m.h.ea[yt])throw Error("The binding '"+yt+"' cannot be used with virtual elements");try{typeof en=="function"&&m.u.G(function(){var wt=en(ae,ut(yt),Ye,et.$data,et);if(wt&&wt.controlsDescendantBindings){if(Pe!==e)throw Error("Multiple bindings ("+Pe+" and "+yt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Pe=yt}}),typeof Gt=="function"&&m.$(function(){Gt(ae,ut(yt),Ye,et.$data,et)},null,{l:ae})}catch(wt){throw wt.message='Unable to process binding "'+yt+": "+Be[yt]+`"
  15848. Message: `+wt.message,wt}})}return we=Pe===e,{shouldBindDescendants:we,bindingContextForDescendants:we&&et}}function q(ae,be){return ae&&ae instanceof m.fa?ae:new m.fa(ae,e,e,be)}var J=m.a.Da("_subscribable"),H=m.a.Da("_ancestorBindingInfo"),Z=m.a.Da("_dataDependency");m.c={};var K={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ae){return m.c[ae]};var le={};m.fa=function(ae,be,ge,we,Ee){function Be(){var ut=et?rt():rt,Ct=m.a.f(ut);return be?(m.a.extend(ke,be),H in be&&(ke[H]=be[H])):(ke.$parents=[],ke.$root=Ct,ke.ko=m),ke[J]=Pe,Ge?Ct=ke.$data:(ke.$rawData=ut,ke.$data=Ct),ge&&(ke[ge]=Ct),we&&we(ke,be,Ct),be&&be[J]&&!m.S.o().Vb(be[J])&&be[J](),Ye&&(ke[Z]=Ye),ke.$data}var ke=this,Ge=ae===le,rt=Ge?e:ae,et=typeof rt=="function"&&!m.O(rt),Pe,Ye=Ee&&Ee.dataDependency;Ee&&Ee.exportDependencies?Be():(Pe=m.xb(Be),Pe.v(),Pe.ja()?Pe.equalityComparer=null:ke[J]=e)},m.fa.prototype.createChildContext=function(ae,be,ge,we){if(!we&&be&&typeof be=="object"&&(we=be,be=we.as,ge=we.extend),be&&we&&we.noChildContext){var Ee=typeof ae=="function"&&!m.O(ae);return new m.fa(le,this,null,function(Be){ge&&ge(Be),Be[be]=Ee?ae():ae},we)}return new m.fa(ae,this,be,function(Be,ke){Be.$parentContext=ke,Be.$parent=ke.$data,Be.$parents=(ke.$parents||[]).slice(0),Be.$parents.unshift(Be.$parent),ge&&ge(Be)},we)},m.fa.prototype.extend=function(ae,be){return new m.fa(le,this,null,function(ge){m.a.extend(ge,typeof ae=="function"?ae(ge):ae)},be)};var me=m.a.g.Z();C.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},C.prototype.sd=function(ae){m.a.Pa(this.kb,ae),!this.kb.length&&this.H&&this.Cc()},C.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ae,be,ge,we,Ee){var Be=m.a.g.Ub(ae,me,{});return Be.Fa||(Be.Fa=new m.T),Ee&&Ee.notifyImmediately&&Be.Zb[be]&&m.u.G(ge,we,[ae]),Be.Fa.subscribe(ge,we,be)},ma:function(ae,be){var ge=m.a.g.get(ae,me);if(ge&&(ge.Zb[be]=!0,ge.Fa&&ge.Fa.notifySubscribers(ae,be),be==m.i.H)){if(ge.N)ge.N.Cc();else if(ge.N===e&&ge.Fa&&ge.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ae,be){var ge=m.a.g.Ub(ae,me,{});return ge.N||(ge.N=new C(ae,ge,be[H])),be[H]==ge?be:be.extend(function(we){we[H]=ge})}},m.Td=function(ae){return(ae=m.a.g.get(ae,me))&&ae.context},m.ib=function(ae,be,ge){return ae.nodeType===1&&m.h.Sc(ae),W(ae,be,q(ge))},m.ld=function(ae,be,ge){return ge=q(ge),m.ib(ae,N(be,ge,ae),ge)},m.Oa=function(ae,be){be.nodeType!==1&&be.nodeType!==8||k(q(ae),be)},m.vc=function(ae,be,ge){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(be=n.body,!be)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!be||be.nodeType!==1&&be.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");V(q(ae,ge),be)},m.Dc=function(ae){return!ae||ae.nodeType!==1&&ae.nodeType!==8?e:m.Td(ae)},m.Ec=function(ae){return(ae=m.Dc(ae))?ae.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)})(),(function(_){function C(j,k){var V=Object.prototype.hasOwnProperty.call(M,j)?M[j]:_,F;V?V.subscribe(k):(V=M[j]=new m.T,V.subscribe(k),v(j,function(W,q){var J=!(!q||!q.synchronous);N[j]={definition:W,Gd:J},delete M[j],F||J?V.notifySubscribers(W):m.na.zb(function(){V.notifySubscribers(W)})}),F=!0)}function v(j,k){I("getConfig",[j],function(V){V?I("loadComponent",[j,V],function(F){k(F,V)}):k(null,null)})}function I(j,k,V,F){F||(F=m.j.loaders.slice(0));var W=F.shift();if(W){var q=W[j];if(q){var J=!1;if(q.apply(W,k.concat(function(H){J?V(null):H!==null?V(H):I(j,k,V,F)}))!==_&&(J=!0,!W.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(j,k,V,F)}else V(null)}var M={},N={};m.j={get:function(j,k){var V=Object.prototype.hasOwnProperty.call(N,j)?N[j]:_;V?V.Gd?m.u.G(function(){k(V.definition)}):m.na.zb(function(){k(V.definition)}):C(j,k)},Bc:function(j){delete N[j]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function _(V,F,W,q){function J(){--Z===0&&q(H)}var H={},Z=2,K=W.template;W=W.viewModel,K?M(F,K,function(le){m.j.oc("loadTemplate",[V,le],function(me){H.template=me,J()})}):J(),W?M(F,W,function(le){m.j.oc("loadViewModel",[V,le],function(me){H[k]=me,J()})}):J()}function C(V,F,W){if(typeof F=="function")W(function(J){return new F(J)});else if(typeof F[k]=="function")W(F[k]);else if("instance"in F){var q=F.instance;W(function(){return q})}else"viewModel"in F?C(V,F.viewModel,W):V("Unknown viewModel value: "+F)}function v(V){switch(m.a.R(V)){case"script":return m.a.ua(V.text);case"textarea":return m.a.ua(V.value);case"template":if(I(V.content))return m.a.Ca(V.content.childNodes)}return m.a.Ca(V.childNodes)}function I(V){return t.DocumentFragment?V instanceof DocumentFragment:V&&V.nodeType===11}function M(V,F,W){typeof F.require=="string"?s||t.require?(s||t.require)([F.require],function(q){q&&typeof q=="object"&&q.Xd&&q.default&&(q=q.default),W(q)}):V("Uses require, but no AMD loader is present"):W(F)}function N(V){return function(F){throw Error("Component '"+V+"': "+F)}}var j={};m.j.register=function(V,F){if(!F)throw Error("Invalid configuration for "+V);if(m.j.tb(V))throw Error("Component "+V+" is already registered");j[V]=F},m.j.tb=function(V){return Object.prototype.hasOwnProperty.call(j,V)},m.j.unregister=function(V){delete j[V],m.j.Bc(V)},m.j.Fc={getConfig:function(V,F){F(m.j.tb(V)?j[V]:null)},loadComponent:function(V,F,W){var q=N(V);M(q,F,function(J){_(V,q,J,W)})},loadTemplate:function(V,F,W){if(V=N(V),typeof F=="string")W(m.a.ua(F));else if(F instanceof Array)W(F);else if(I(F))W(m.a.la(F.childNodes));else if(F.element)if(F=F.element,t.HTMLElement?F instanceof HTMLElement:F&&F.tagName&&F.nodeType===1)W(v(F));else if(typeof F=="string"){var q=n.getElementById(F);q?W(v(q)):V("Cannot find element with ID "+F)}else V("Unknown element type: "+F);else V("Unknown template value: "+F)},loadViewModel:function(V,F,W){C(N(V),F,W)}};var k="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=j})(),(function(){function _(v,I){var M=v.getAttribute("params");if(M){var M=C.parseBindingsString(M,I,v,{valueAccessors:!0,bindingParams:!0}),M=m.a.Ga(M,function(k){return m.o(k,null,{l:v})}),N=m.a.Ga(M,function(k){var V=k.v();return k.ja()?m.o({read:function(){return m.a.f(k())},write:m.Za(V)&&function(F){k()(F)},l:v}):V});return Object.prototype.hasOwnProperty.call(N,"$raw")||(N.$raw=M),N}return{$raw:{}}}m.j.getComponentNameForNode=function(v){var I=m.a.R(v);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+v=="[object HTMLUnknownElement]"||8>=m.a.W&&v.tagName===I))return I},m.j.tc=function(v,I,M,N){if(I.nodeType===1){var j=m.j.getComponentNameForNode(I);if(j){if(v=v||{},v.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:j,params:_(I,M)};v.component=N?function(){return k}:k}}return v};var C=new m.ga;9>m.a.W&&(m.j.register=(function(v){return function(I){return v.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(v){return function(){var I=v(),M=m.j.dd,N;for(N in M);return I}})(n.createDocumentFragment))})(),(function(){function _(I,M,N){if(M=M.template,!M)throw Error("Component '"+I+"' has no template");I=m.a.Ca(M),m.h.va(N,I)}function C(I,M,N){var j=I.createViewModel;return j?j.call(I,M,N):M}var v=0;m.c.component={init:function(I,M,N,j,k){function V(){var H=F&&F.dispose;typeof H=="function"&&H.call(F),q&&q.s(),W=F=q=null}var F,W,q,J=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,V),m.o(function(){var H=m.a.f(M()),Z,K;if(typeof H=="string"?Z=H:(Z=m.a.f(H.name),K=m.a.f(H.params)),!Z)throw Error("No component name specified");var le=m.i.Cb(I,k),me=W=++v;m.j.get(Z,function(ae){if(W===me){if(V(),!ae)throw Error("Unknown component '"+Z+"'");_(Z,ae,I);var be=C(ae,K,{element:I,templateNodes:J});ae=le.createChildContext(be,{extend:function(ge){ge.$component=be,ge.$componentTemplateNodes=J}}),be&&be.koDescendantsComplete&&(q=m.i.subscribe(I,m.i.pa,be.koDescendantsComplete,be)),F=be,m.Oa(ae,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var B={class:"className",for:"htmlFor"};m.c.attr={update:function(_,C){var v=m.a.f(C())||{};m.a.P(v,function(I,M){M=m.a.f(M);var N=I.indexOf(":"),N="lookupNamespaceURI"in _&&0<N&&_.lookupNamespaceURI(I.substr(0,N)),j=M===!1||M===null||M===e;j?N?_.removeAttributeNS(N,I):_.removeAttribute(I):M=M.toString(),8>=m.a.W&&I in B?(I=B[I],j?_.removeAttribute(I):_[I]=M):j||(N?_.setAttributeNS(N,I,M):_.setAttribute(I,M)),I==="name"&&m.a.Yc(_,j?"":M)})}},(function(){m.c.checked={after:["value","attr"],init:function(_,C,v){function I(){var H=_.checked,Z=N();if(!m.S.Ya()&&(H||!k&&!m.S.qa())){var K=m.u.G(C);if(F){var le=W?K.v():K,me=J;J=Z,me!==Z?H&&(m.a.Na(le,Z,!0),m.a.Na(le,me,!1)):m.a.Na(le,Z,H),W&&m.Za(K)&&K(le)}else j&&(Z===e?Z=H:H||(Z=e)),m.m.eb(K,v,"checked",Z,!0)}}function M(){var H=m.a.f(C()),Z=N();F?(_.checked=0<=m.a.A(H,Z),J=Z):_.checked=j&&Z===e?!!H:N()===H}var N=m.xb(function(){if(v.has("checkedValue"))return m.a.f(v.get("checkedValue"));if(q)return v.has("value")?m.a.f(v.get("value")):_.value}),j=_.type=="checkbox",k=_.type=="radio";if(j||k){var V=C(),F=j&&m.a.f(V)instanceof Array,W=!(F&&V.push&&V.splice),q=k||F,J=F?N():e;k&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(I,null,{l:_}),m.a.B(_,"click",I),m.o(M,null,{l:_}),V=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,C){_.value=m.a.f(C())}}})(),m.c.class={update:function(_,C){var v=m.a.Db(m.a.f(C()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=v,m.a.Eb(_,v,!0)}},m.c.css={update:function(_,C){var v=m.a.f(C());v!==null&&typeof v=="object"?m.a.P(v,function(I,M){M=m.a.f(M),m.a.Eb(_,I,M)}):m.c.class.update(_,C)}},m.c.enable={update:function(_,C){var v=m.a.f(C());v&&_.disabled?_.removeAttribute("disabled"):v||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,C){m.c.enable.update(_,function(){return!m.a.f(C())})}},m.c.event={init:function(_,C,v,I,M){var N=C()||{};m.a.P(N,function(j){typeof j=="string"&&m.a.B(_,j,function(k){var V,F=C()[j];if(F){try{var W=m.a.la(arguments);I=M.$data,W.unshift(I),V=F.apply(I,W)}finally{V!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}v.get(j+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var C=_(),v=m.a.bc(C);return!v||typeof v.length=="number"?{foreach:C,templateEngine:m.ba.Ma}:(m.a.f(C),{foreach:v.data,as:v.as,noChildContext:v.noChildContext,includeDestroyed:v.includeDestroyed,afterAdd:v.afterAdd,beforeRemove:v.beforeRemove,afterRender:v.afterRender,beforeMove:v.beforeMove,afterMove:v.afterMove,templateEngine:m.ba.Ma})}},init:function(_,C){return m.c.template.init(_,m.c.foreach.Rc(C))},update:function(_,C,v,I,M){return m.c.template.update(_,m.c.foreach.Rc(C),v,I,M)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,C,v){function I(j){_.__ko_hasfocusUpdating=!0;var k=_.ownerDocument;if("activeElement"in k){var V;try{V=k.activeElement}catch{V=k.body}j=V===_}k=C(),m.m.eb(k,v,"hasfocus",j,!0),_.__ko_hasfocusLastValue=j,_.__ko_hasfocusUpdating=!1}var M=I.bind(null,!0),N=I.bind(null,!1);m.a.B(_,"focus",M),m.a.B(_,"focusin",M),m.a.B(_,"blur",N),m.a.B(_,"focusout",N),_.__ko_hasfocusLastValue=!1},update:function(_,C){var v=!!m.a.f(C());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===v||(v?_.focus():_.blur(),!v&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,v?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.fc(_,C())}},(function(){function _(C,v,I){m.c[C]={init:function(M,N,j,k,V){var F,W,q={},J,H,Z;if(v){k=j.get("as");var K=j.get("noChildContext");Z=!(k&&K),q={as:k,noChildContext:K,exportDependencies:Z}}return H=(J=j.get("completeOn")=="render")||j.has(m.i.pa),m.o(function(){var le=m.a.f(N()),me=!I!=!le,ae=!W,be;(Z||me!==F)&&(H&&(V=m.i.Cb(M,V)),me&&((!v||Z)&&(q.dataDependency=m.S.o()),be=v?V.createChildContext(typeof le=="function"?le:N,q):m.S.qa()?V.extend(null,q):V),ae&&m.S.qa()&&(W=m.a.Ca(m.h.childNodes(M),!0)),me?(ae||m.h.va(M,m.a.Ca(W)),m.Oa(be,M)):(m.h.Ea(M),J||m.i.ma(M,m.i.H)),F=me)},null,{l:M}),{controlsDescendantBindings:!0}}},m.m.Ra[C]=!1,m.h.ea[C]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)})(),m.c.let={init:function(_,C,v,I,M){return C=M.extend(C),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,C,v){function I(){return m.a.jb(_.options,function(K){return K.selected})}function M(K,le,me){var ae=typeof le;return ae=="function"?le(K):ae=="string"?K[le]:me}function N(K,le){if(H&&F)m.i.ma(_,m.i.H);else if(J.length){var me=0<=m.a.A(J,m.w.M(le[0]));m.a.Zc(le[0],me),H&&!me&&m.u.G(m.a.Fb,null,[_,"change"])}}var j=_.multiple,k=_.length!=0&&j?_.scrollTop:null,V=m.a.f(C()),F=v.get("valueAllowUnset")&&v.has("value"),W=v.get("optionsIncludeDestroyed");C={};var q,J=[];F||(j?J=m.a.Mb(I(),m.w.M):0<=_.selectedIndex&&J.push(m.w.M(_.options[_.selectedIndex]))),V&&(typeof V.length>"u"&&(V=[V]),q=m.a.jb(V,function(K){return W||K===e||K===null||!m.a.f(K._destroy)}),v.has("optionsCaption")&&(V=m.a.f(v.get("optionsCaption")),V!==null&&V!==e&&q.unshift(L)));var H=!1;if(C.beforeRemove=function(K){_.removeChild(K)},V=N,v.has("optionsAfterRender")&&typeof v.get("optionsAfterRender")=="function"&&(V=function(K,le){N(0,le),m.u.G(v.get("optionsAfterRender"),null,[le[0],K!==L?K:e])}),m.a.ec(_,q,function(K,le,me){return me.length&&(J=!F&&me[0].selected?[m.w.M(me[0])]:[],H=!0),le=_.ownerDocument.createElement("option"),K===L?(m.a.Bb(le,v.get("optionsCaption")),m.w.cb(le,e)):(me=M(K,v.get("optionsValue"),K),m.w.cb(le,m.a.f(me)),K=M(K,v.get("optionsText"),me),m.a.Bb(le,K)),[le]},C,V),!F){var Z;j?Z=J.length&&I().length<J.length:Z=J.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==J[0]:J.length||0<=_.selectedIndex,Z&&m.u.G(m.a.Fb,null,[_,"change"])}(F||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),k&&20<Math.abs(k-_.scrollTop)&&(_.scrollTop=k)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,C,v){function I(){var j=C(),k=[];m.a.D(_.getElementsByTagName("option"),function(V){V.selected&&k.push(m.w.M(V))}),m.m.eb(j,v,"selectedOptions",k)}function M(){var j=m.a.f(C()),k=_.scrollTop;j&&typeof j.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(V){var F=0<=m.a.A(j,m.w.M(V));V.selected!=F&&m.a.Zc(V,F)}),_.scrollTop=k}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var N;m.i.subscribe(_,m.i.H,function(){N?I():(m.a.B(_,"change",I),N=m.o(M,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,C){var v=m.a.f(C()||{});m.a.P(v,function(I,M){if(M=m.a.f(M),(M===null||M===e||M===!1)&&(M=""),o)o(_).css(I,M);else if(/^--/.test(I))_.style.setProperty(I,M);else{I=I.replace(/-(\w)/g,function(j,k){return k.toUpperCase()});var N=_.style[I];_.style[I]=M,M===N||_.style[I]!=N||isNaN(M)||(_.style[I]=M+"px")}})}},m.c.submit={init:function(_,C,v,I,M){if(typeof C()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(N){var j,k=C();try{j=k.call(M.$data,_)}finally{j!==!0&&(N.preventDefault?N.preventDefault():N.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.Bb(_,C())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var _=function(q){if(q)return parseFloat(q[1])},C=t.navigator.userAgent,v,I,M,N,j;(v=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(j=_(C.match(/Edge\/([^ ]+)$/)))||_(C.match(/Chrome\/([^ ]+)/))||(I=_(C.match(/Version\/([^ ]+) Safari/)))||(M=_(C.match(/Firefox\/([^ ]+)/)))||(N=m.a.W||_(C.match(/MSIE ([^ ]+)/)))||(N=_(C.match(/rv:([^ )]+)/)))}if(8<=N&&10>N)var k=m.a.g.Z(),V=m.a.g.Z(),F=function(q){var J=this.activeElement;(J=J&&m.a.g.get(J,V))&&J(q)},W=function(q,J){var H=q.ownerDocument;m.a.g.get(H,k)||(m.a.g.set(H,k,!0),m.a.B(H,"selectionchange",F)),m.a.g.set(q,V,J)};m.c.textInput={init:function(q,J,H){function Z(Be,ke){m.a.B(q,Be,ke)}function K(){var Be=m.a.f(J());(Be===null||Be===e)&&(Be=""),ge!==e&&Be===ge?m.a.setTimeout(K,4):q.value!==Be&&(Ee=!0,q.value=Be,Ee=!1,ae=q.value)}function le(){be||(ge=q.value,be=m.a.setTimeout(me,4))}function me(){clearTimeout(be),ge=be=e;var Be=q.value;ae!==Be&&(ae=Be,m.m.eb(J(),H,"textInput",Be))}var ae=q.value,be,ge,we=m.a.W==9?le:me,Ee=!1;N&&Z("keypress",me),11>N&&Z("propertychange",function(Be){Ee||Be.propertyName!=="value"||we(Be)}),N==8&&(Z("keyup",me),Z("keydown",me)),W&&(W(q,we),Z("dragend",le)),(!N||9<=N)&&Z("input",we),5>I&&m.a.R(q)==="textarea"?(Z("keydown",le),Z("paste",le),Z("cut",le)):11>v?Z("keydown",le):4>M?(Z("DOMAutoComplete",me),Z("dragdrop",me),Z("drop",me)):j&&q.type==="number"&&Z("keydown",le),Z("change",me),Z("blur",me),m.o(K,null,{l:q})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(q,J,H){H("textInput",q)}}})(),m.c.uniqueName={init:function(_,C){if(C()){var v="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,v)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,C,v,I,M){var N;return v.has("as")&&(N={as:v.get("as"),noChildContext:v.get("noChildContext")}),C=M.createChildContext(C,N),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,C,v){var I=m.a.R(_),M=I=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var N=[],j=v.get("valueUpdate"),k=!1,V=null;j&&(typeof j=="string"?N=[j]:N=m.a.wc(j),m.a.Pa(N,"change"));var F=function(){V=null,k=!1;var J=C(),H=m.w.M(_);m.m.eb(J,v,"value",H)};!m.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(N,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){k=!0}),m.a.B(_,"focus",function(){k=!1}),m.a.B(_,"blur",function(){k&&F()})),m.a.D(N,function(J){var H=F;m.a.Ud(J,"after")&&(H=function(){V=m.w.M(_),m.a.setTimeout(F,0)},J=J.substring(5)),m.a.B(_,J,H)});var W;if(W=M&&_.type=="file"?function(){var J=m.a.f(C());J===null||J===e||J===""?_.value="":m.u.G(F)}:function(){var J=m.a.f(C()),H=m.w.M(_);V!==null&&J===V?m.a.setTimeout(W,0):(J!==H||H===e)&&(I==="select"?(H=v.get("valueAllowUnset"),m.w.cb(_,J,H),H||J===m.w.M(_)||m.u.G(F)):m.w.cb(_,J))},I==="select"){var q;m.i.subscribe(_,m.i.H,function(){q?v.get("valueAllowUnset")?W():F():(m.a.B(_,"change",F),q=m.o(W,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",F),m.o(W,null,{l:_})}else m.ib(_,{checkedValue:C})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,C){var v=m.a.f(C()),I=_.style.display!="none";v&&!I?_.style.display="":!v&&I&&(_.style.display="none")}},m.c.hidden={update:function(_,C){m.c.visible.update(_,function(){return!m.a.f(C())})}},(function(_){m.c[_]={init:function(C,v,I,M,N){return m.c.event.init.call(this,C,function(){var j={};return j[_]=v(),j},I,M,N)}}})("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,C){if(typeof _=="string"){C=C||n;var v=C.getElementById(_);if(!v)throw Error("Cannot find template with ID "+_);return new m.C.F(v)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,C,v,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,C,v,I)},m.ca.prototype.isTemplateRewritten=function(_,C){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,C).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,C,v){_=this.makeTemplateSource(_,v),C=C(_.text()),_.text(C),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function _(I,M,N,j){I=m.m.ac(I);for(var k=m.m.Ra,V=0;V<I.length;V++){var F=I[V].key;if(Object.prototype.hasOwnProperty.call(k,F)){var W=k[F];if(typeof W=="function"){if(F=W(I[V].value))throw Error(F)}else if(!W)throw Error("This template engine does not support the '"+F+"' binding within its templates")}}return N="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+N.toLowerCase()+"')",j.createJavaScriptEvaluatorBlock(N)+M}var C=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,v=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,M,N){M.isTemplateRewritten(I,N)||M.rewriteTemplate(I,function(j){return m.kc.Ld(j,M)},N)},Ld:function(I,M){return I.replace(C,function(N,j,k,V,F){return _(F,j,k,M)}).replace(v,function(N,j){return _(j,"<!-- ko -->","#comment",M)})},md:function(I,M){return m.aa.Xb(function(N,j){var k=N.nextSibling;k&&k.nodeName.toLowerCase()===M&&m.ib(k,I,j)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(v){if(this.F=v){var I=m.a.R(v);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&v.content&&v.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var v=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[v];var I=arguments[0];v==="innerHTML"?m.a.fc(this.F,I):this.F[v]=I};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(v){if(arguments.length===1)return m.a.g.get(this.F,_+v);m.a.g.set(this.F,_+v,arguments[1])};var C=m.a.g.Z();m.C.F.prototype.nodes=function(){var v=this.F;if(arguments.length==0){var I=m.a.g.get(v,C)||{},M=I.lb||(this.ab===3?v.content:this.ab===4?v:e);if(!M||I.jd){var N=this.text();N&&N!==I.bb&&(M=m.a.Md(N,v.ownerDocument),m.a.g.set(v,C,{lb:M,bb:N,jd:!0}))}return M}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(v,C,{lb:I})},m.C.ia=function(v){this.F=v},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var v=m.a.g.get(this.F,C)||{};return v.bb===e&&v.lb&&(v.bb=v.lb.innerHTML),v.bb}m.a.g.set(this.F,C,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)})(),(function(){function _(V,F,W){var q;for(F=m.h.nextSibling(F);V&&(q=V)!==F;)V=m.h.nextSibling(q),W(q,V)}function C(V,F){if(V.length){var W=V[0],q=V[V.length-1],J=W.parentNode,H=m.ga.instance,Z=H.preprocessNode;if(Z){if(_(W,q,function(K,le){var me=K.previousSibling,ae=Z.call(H,K);ae&&(K===W&&(W=ae[0]||le),K===q&&(q=ae[ae.length-1]||me))}),V.length=0,!W)return;W===q?V.push(W):(V.push(W,q),m.a.Ua(V,J))}_(W,q,function(K){K.nodeType!==1&&K.nodeType!==8||m.vc(F,K)}),_(W,q,function(K){K.nodeType!==1&&K.nodeType!==8||m.aa.cd(K,[F])}),m.a.Ua(V,J)}}function v(V){return V.nodeType?V:0<V.length?V[0]:null}function I(V,F,W,q,J){J=J||{};var H=(V&&v(V)||W||{}).ownerDocument,Z=J.templateEngine||N;if(m.kc.xd(W,Z,H),W=Z.renderTemplate(W,q,J,H),typeof W.length!="number"||0<W.length&&typeof W[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(H=!1,F){case"replaceChildren":m.h.va(V,W),H=!0;break;case"replaceNode":m.a.Xc(V,W),H=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+F)}return H&&(C(W,q),J.afterRender&&m.u.G(J.afterRender,null,[W,q[J.as||"$data"]]),F=="replaceChildren"&&m.i.ma(V,m.i.H)),W}function M(V,F,W){return m.O(V)?V():typeof V=="function"?V(F,W):V}var N;m.gc=function(V){if(V!=e&&!(V instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");N=V},m.dc=function(V,F,W,q,J){if(W=W||{},(W.templateEngine||N)==e)throw Error("Set a template engine before calling renderTemplate");if(J=J||"replaceChildren",q){var H=v(q);return m.$(function(){var K=F&&F instanceof m.fa?F:new m.fa(F,null,null,null,{exportDependencies:!0}),Z=M(V,K.$data,K),K=I(q,J,Z,K,W);J=="replaceNode"&&(q=K,H=v(q))},null,{Sa:function(){return!H||!m.a.Sb(H)},l:H&&J=="replaceNode"?H.parentNode:H})}return m.aa.Xb(function(Z){m.dc(V,F,W,Z,"replaceNode")})},m.Qd=function(V,F,W,q,J){function H(ge,we){m.u.G(m.a.ec,null,[q,ge,K,W,Z,we]),m.i.ma(q,m.i.H)}function Z(ge,we){C(we,le),W.afterRender&&W.afterRender(we,ge),le=null}function K(ge,we){le=J.createChildContext(ge,{as:me,noChildContext:W.noChildContext,extend:function(Be){Be.$index=we,me&&(Be[me+"Index"]=we)}});var Ee=M(V,ge,le);return I(q,"ignoreTargetNode",Ee,le,W)}var le,me=W.as,ae=W.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!W.includeDestroyed;if(ae||W.beforeRemove||!m.Pc(F))return m.$(function(){var ge=m.a.f(F)||[];typeof ge.length>"u"&&(ge=[ge]),ae&&(ge=m.a.jb(ge,function(we){return we===e||we===null||!m.a.f(we._destroy)})),H(ge)},null,{l:q});H(F.v());var be=F.subscribe(function(ge){H(F(),ge)},null,"arrayChange");return be.l(q),be};var j=m.a.g.Z(),k=m.a.g.Z();m.c.template={init:function(V,F){var W=m.a.f(F());if(typeof W=="string"||"name"in W)m.h.Ea(V);else if("nodes"in W){if(W=W.nodes||[],m.O(W))throw Error('The "nodes" option must be a plain, non-observable array.');var q=W[0]&&W[0].parentNode;q&&m.a.g.get(q,k)||(q=m.a.Yb(W),m.a.g.set(q,k,!0)),new m.C.ia(V).nodes(q)}else if(W=m.h.childNodes(V),0<W.length)q=m.a.Yb(W),new m.C.ia(V).nodes(q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(V,F,W,q,J){var H=F();F=m.a.f(H),W=!0,q=null,typeof F=="string"?F={}:(H="name"in F?F.name:V,"if"in F&&(W=m.a.f(F.if)),W&&"ifnot"in F&&(W=!m.a.f(F.ifnot)),W&&!H&&(W=!1)),"foreach"in F?q=m.Qd(H,W&&F.foreach||[],F,V,J):W?(W=J,"data"in F&&(W=J.createChildContext(F.data,{as:F.as,noChildContext:F.noChildContext,exportDependencies:!0})),q=m.dc(H,W,F,V)):m.h.Ea(V),J=q,(F=m.a.g.get(V,j))&&typeof F.s=="function"&&F.s(),m.a.g.set(V,j,!J||J.ja&&!J.ja()?e:J)}},m.m.Ra.template=function(V){return V=m.m.ac(V),V.length==1&&V[0].unknown||m.m.Id(V,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0})(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,C,v){if(_.length&&C.length){var I,M,N,j,k;for(I=M=0;(!v||I<v)&&(j=_[M]);++M){for(N=0;k=C[N];++N)if(j.value===k.value){j.moved=k.index,k.moved=j.index,C.splice(N,1),I=N=0;break}I+=N}}},m.a.Pb=(function(){function _(C,v,I,M,N){var j=Math.min,k=Math.max,V=[],F,W=C.length,q,J=v.length,H=J-W||1,Z=W+J+1,K,le,me;for(F=0;F<=W;F++)for(le=K,V.push(K=[]),me=j(J,F+H),q=k(0,F-1);q<=me;q++)K[q]=q?F?C[F-1]===v[q-1]?le[q-1]:j(le[q]||Z,K[q-1]||Z)+1:q+1:F+1;for(j=[],k=[],H=[],F=W,q=J;F||q;)J=V[F][q]-1,q&&J===V[F][q-1]?k.push(j[j.length]={status:I,value:v[--q],index:q}):F&&J===V[F-1][q]?H.push(j[j.length]={status:M,value:C[--F],index:F}):(--q,--F,N.sparse||j.push({status:"retained",value:v[q]}));return m.a.Kc(H,k,!N.dontLimitMoves&&10*W),j.reverse()}return function(C,v,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},C=C||[],v=v||[],C.length<v.length?_(C,v,"added","deleted",I):_(v,C,"deleted","added",I)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function _(I,M,N,j,k){var V=[],F=m.$(function(){var W=M(N,k,m.a.Ua(V,I))||[];0<V.length&&(m.a.Xc(V,W),j&&m.u.G(j,null,[N,W,k])),V.length=0,m.a.Nb(V,W)},null,{l:I,Sa:function(){return!m.a.kd(V)}});return{Y:V,$:F.ja()?F:e}}var C=m.a.g.Z(),v=m.a.g.Z();m.a.ec=function(I,M,N,j,k,V){function F(Ct){Ee={Aa:Ct,pb:m.ta(le++)},Z.push(Ee),H||we.push(Ee)}function W(Ct){Ee=J[Ct],le!==Ee.pb.v()&&ge.push(Ee),Ee.pb(le++),m.a.Ua(Ee.Y,I),Z.push(Ee)}function q(Ct,en){if(Ct)for(var Gt=0,yt=en.length;Gt<yt;Gt++)m.a.D(en[Gt].Y,function(wt){Ct(wt,Gt,en[Gt].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),j=j||{};var J=m.a.g.get(I,C),H=!J,Z=[],K=0,le=0,me=[],ae=[],be=[],ge=[],we=[],Ee,Be=0;if(H)m.a.D(M,F);else{if(!V||J&&J._countWaitingForRemove){var ke=m.a.Mb(J,function(Ct){return Ct.Aa});V=m.a.Pb(ke,M,{dontLimitMoves:j.dontLimitMoves,sparse:!0})}for(var ke=0,Ge,rt,et;Ge=V[ke];ke++)switch(rt=Ge.moved,et=Ge.index,Ge.status){case"deleted":for(;K<et;)W(K++);rt===e&&(Ee=J[K],Ee.$&&(Ee.$.s(),Ee.$=e),m.a.Ua(Ee.Y,I).length&&(j.beforeRemove&&(Z.push(Ee),Be++,Ee.Aa===v?Ee=null:be.push(Ee)),Ee&&me.push.apply(me,Ee.Y))),K++;break;case"added":for(;le<et;)W(K++);rt!==e?(ae.push(Z.length),W(rt)):F(Ge.value)}for(;le<M.length;)W(K++);Z._countWaitingForRemove=Be}m.a.g.set(I,C,Z),q(j.beforeMove,ge),m.a.D(me,j.beforeRemove?m.oa:m.removeNode);var Pe,Ye,ut;try{ut=I.ownerDocument.activeElement}catch{}if(ae.length)for(;(ke=ae.shift())!=e;){for(Ee=Z[ke],Pe=e;ke;)if((Ye=Z[--ke].Y)&&Ye.length){Pe=Ye[Ye.length-1];break}for(M=0;K=Ee.Y[M];Pe=K,M++)m.h.Wb(I,K,Pe)}for(ke=0;Ee=Z[ke];ke++){for(Ee.Y||m.a.extend(Ee,_(I,N,Ee.Aa,k,Ee.pb)),M=0;K=Ee.Y[M];Pe=K,M++)m.h.Wb(I,K,Pe);!Ee.Ed&&k&&(k(Ee.Aa,Ee.Y,Ee.pb),Ee.Ed=!0,Pe=Ee.Y[Ee.Y.length-1])}for(ut&&I.ownerDocument.activeElement!=ut&&ut.focus(),q(j.beforeRemove,be),ke=0;ke<be.length;++ke)be[ke].Aa=v;q(j.afterMove,ge),q(j.afterAdd,we)}})(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,C,v,I){return(C=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(C.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var C=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(v,I,M,N){if(N=N||n,M=M||{},2>C)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var j=v.data("precompiled");return j||(j=v.text()||"",j=o.template(null,"{{ko_with $item.koBindingContext}}"+j+"{{/ko_with}}"),v.data("precompiled",j)),v=[I.$data],I=o.extend({koBindingContext:I},M.templateOptions),I=o.tmpl(j,v,I),I.appendTo(N.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(v){return"{{ko_code ((function() { return "+v+" })()) }}"},this.addTemplate=function(v,I){n.write("<script type='text/html' id='"+v+"'>"+I+"<\/script>")},0<C&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)})()})})()})()})();var IFt=ko;typeof window<"u"?(ko=window.ko,typeof xO<"u"?window.ko=xO:delete window.ko):(ko=global.ko,typeof xO<"u"?global.ko=xO:delete global.ko);var Aw=IFt;/**
  15849. * @license
  15850. * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
  15851. * Copyright (c) Steve Sanderson
  15852. * MIT license
  15853. */var fie="__knockoutObservables",die="__knockoutSubscribable";function MRe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=BRe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===fie||o===die)&&!(o in i)){var r=e[o],a=r instanceof Array,s=n.isObservable(r)?r:a?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),i[o]=s,a&&PFt(n,s)}}),e}function BRe(e,t){var n=e[fie];return!n&&t&&(n={},Object.defineProperty(e,fie,{value:n})),n}function DFt(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),MRe.call(i,e,[t]),e}function PFt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=RFt(e,t,i))})}function RFt(e,t,n){var i=OFt(e,n);return i.subscribe(t)}function OFt(e,t){var n=t[die];if(!n){n=new e.subscribable,Object.defineProperty(t,die,{value:n});var i={};MFt(t,n,i),BFt(e,t,n,i)}return n}function MFt(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 BFt(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 LRe(e,t){if(!e)return null;var n=BRe(e,!1);return n&&n[t]||null}function LFt(e,t){var n=LRe(e,t);n&&n.valueHasMutated()}function NFt(e){e.track=MRe,e.getObservable=LRe,e.valueHasMutated=LFt,e.defineProperty=DFt}var g5={attachToKo:NFt};var NRe="http://www.w3.org/2000/svg",FRe="cesium-svgPath-svg",FFt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(NRe,"svg:svg");i.setAttribute("class",FRe);let o=document.createElementNS(NRe,"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 a=e.unwrap(r.width),s=e.unwrap(r.height);i.setAttribute("width",a),i.setAttribute("height",s),i.setAttribute("viewBox",`0 0 ${a} ${s}`),r.css&&i.setAttribute("class",`${FRe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},_5=FFt;g5.attachToKo(Aw);_5.register(Aw);var ve=Aw;function bO(e){l(e)||(e=new pp),this._clock=e,this._eventHelper=new Yr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=ve.observable(Q.now()),this.systemTime.equalityComparer=Q.equals,this.startTime=ve.observable(e.startTime),this.startTime.equalityComparer=Q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=ve.observable(e.stopTime),this.stopTime.equalityComparer=Q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=ve.observable(e.currentTime),this.currentTime.equalityComparer=Q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=ve.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=ve.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=ve.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=ve.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=ve.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),ve.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(bO.prototype,{clock:{get:function(){return this._clock}}});bO.prototype.synchronize=function(){let e=this._clock;this.systemTime=Q.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};bO.prototype.isDestroyed=function(){return!1};bO.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var A5=bO;function kFt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,_e.throwInstantiationError()}var kRe=kFt;var yw={};yw.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let a=`checked: ${t}`;return l(n)&&(a+=`, enable: ${n}`),r.setAttribute("data-bind",a),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};yw.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 a=document.createElement("div");return a.className="cesium-cesiumInspector-sectionContent",o.appendChild(a),a};yw.createRangeInput=function(e,t,n,i,o,r){r=r??t;let a=document.createElement("input");a.setAttribute("data-bind",`value: ${r}`),a.type="number";let s=document.createElement("input");s.type="range",s.min=n,s.max=i,s.step=o??"any",s.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(s);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(a),u.appendChild(c),u};yw.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let a=document.createElement("div");a.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-slider",s.appendChild(document.createTextNode(e)),s.appendChild(o),s.appendChild(a),s};yw.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 Lf=yw;function zRe(e,t){this._command=e,t=t??G.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",ve.track(this,["toggled","tooltip"])}Object.defineProperties(zRe.prototype,{command:{get:function(){return this._command}}});var mT=zRe;function zFt(e,t){t=t??!0;let n=new ye,i=new ye;function o(){let r={args:arguments,cancel:!1},a;return n.raiseEvent(r),r.cancel||(a=e.apply(null,arguments),i.raiseEvent(a)),a}return o.canExecute=t,ve.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Dn=zFt;function UFt(e,t,n,i,o){return n.call(i,e[t]),ve.getObservable(e,t).subscribe(n,i,o)}var Dc=UFt;var pT="http://www.w3.org/2000/svg",jRe="http://www.w3.org/1999/xlink",y5,TO=U.fromCssColorString("rgba(247,250,255,0.384)"),x5=U.fromCssColorString("rgba(143,191,255,0.216)"),hie=U.fromCssColorString("rgba(153,197,255,0.098)"),b5=U.fromCssColorString("rgba(255,255,255,0.086)"),VFt=U.fromCssColorString("rgba(255,255,255,0.267)"),jFt=U.fromCssColorString("rgba(255,255,255,0)"),URe=U.fromCssColorString("rgba(66,67,68,0.3)"),VRe=U.fromCssColorString("rgba(0,0,0,0.5)");function Ty(e){return U.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var CO={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 dm(e){let t=document.createElementNS(pT,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(dm(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(jRe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function mie(e,t,n){let i=document.createElementNS(pT,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(pT,"tspan");return o.textContent=n,i.appendChild(o),i}function GFt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var T5=new U;function Ma(e,t){let n=t.alpha,i=1-n;return T5.red=e.red*i+t.red*n,T5.green=e.green*i+t.green*n,T5.blue=e.blue*i+t.blue*n,T5.toCssColorString()}function pie(e,t,n){let i=CO[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 dm(o)}function HFt(e,t,n){let i=CO[n],o=CO.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 dm(r)}function WFt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&y5!==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,s=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>s.right||c<s.left||u<s.top||u>s.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-o-s.left,p=u-r-s.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(y5=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===y5&&(y5=void 0),n.shuttleRingDragging=!1}function zg(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=[Dc(t,"toggled",this.setToggled,this),Dc(t,"tooltip",this.setTooltip,this),Dc(t.command,"canExecute",this.setEnabled,this)]}zg.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();fe(this)};zg.prototype.isDestroyed=function(){return!1};zg.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")}};zg.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")))};zg.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function xw(e,t){e=Bn(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(pT,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",jRe);let a=document.createElementNS(pT,"g");this._topG=a,this._realtimeSVG=new zg(HFt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new zg(pie(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new zg(pie(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new zg(pie(84,99,"animation_pathPause"),t.pauseViewModel);let s=document.createElementNS(pT,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);let c=dm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=CO.animation_pathSwooshFX,f=CO.animation_pathPointer,d=dm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=dm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=dm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=dm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=dm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=mie(0,-24,""),this._knobTime=mie(0,-7,""),this._knobStatus=mie(0,-41,"");let A=dm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),y=document.createElementNS(pT,"g");y.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),a.appendChild(y),a.appendChild(p),a.appendChild(s),y.appendChild(c),y.appendChild(d),y.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(A),r.appendChild(a),e.appendChild(r);let x=this;function b(P){WFt(x,P)}this._mouseCallback=b,c.addEventListener("mousedown",b,!0),c.addEventListener("touchstart",b,!0),d.addEventListener("mousedown",b,!0),d.addEventListener("touchstart",b,!0),n.addEventListener("mousemove",b,!0),n.addEventListener("touchmove",b,!0),n.addEventListener("mouseup",b,!0),n.addEventListener("touchend",b,!0),n.addEventListener("touchcancel",b,!0),this._shuttleRingPointer.addEventListener("mousedown",b,!0),this._shuttleRingPointer.addEventListener("touchstart",b,!0),this._knobOuter.addEventListener("mousedown",b,!0),this._knobOuter.addEventListener("touchstart",b,!0);let T=this._knobTime.childNodes[0],E=this._knobDate.childNodes[0],S=this._knobStatus.childNodes[0],w;this._subscriptions=[Dc(t.pauseViewModel,"toggled",function(P){w!==P&&(w=P,w?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Dc(t,"shuttleRingAngle",function(P){GFt(x._shuttleRingPointer,x._knobOuter,P)}),Dc(t,"dateLabel",function(P){E.textContent!==P&&(E.textContent=P)}),Dc(t,"timeLabel",function(P){T.textContent!==P&&(T.textContent=P)}),Dc(t,"multiplierLabel",function(P){S.textContent!==P&&(S.textContent=P)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(xw.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});xw.prototype.isDestroyed=function(){return!1};xw.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 fe(this)};xw.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,a=t;e===0&&t===0?(r=i,a=o):e===0?(a=t,r=i*(t/o)):t===0&&(r=e,a=o*(e/i));let s=r/i,c=a/o;n.style.cssText=`width: ${r}px; height: ${a}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",a),n.setAttribute("viewBox",`0 0 ${r} ${a}`),this._topG.setAttribute("transform",`scale(${s},${c})`),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};xw.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=Ty(this._themeNormal),n=Ty(this._themeHover),i=Ty(this._themeSelect),o=Ty(this._themeDisabled),r=Ty(this._themeKnob),a=Ty(this._themePointer),s=Ty(this._themeSwoosh),c=Ty(this._themeSwooshHover),u=dm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ma(t,TO)},{tagName:"stop",offset:"12%","stop-color":Ma(t,x5)},{tagName:"stop",offset:"46%","stop-color":Ma(t,hie)},{tagName:"stop",offset:"81%","stop-color":Ma(t,b5)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ma(n,TO)},{tagName:"stop",offset:"12%","stop-color":Ma(n,x5)},{tagName:"stop",offset:"46%","stop-color":Ma(n,hie)},{tagName:"stop",offset:"81%","stop-color":Ma(n,b5)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ma(i,TO)},{tagName:"stop",offset:"12%","stop-color":Ma(i,x5)},{tagName:"stop",offset:"46%","stop-color":Ma(i,hie)},{tagName:"stop",offset:"81%","stop-color":Ma(i,b5)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ma(o,VFt)},{tagName:"stop",offset:"75%","stop-color":Ma(o,jFt)}]},{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":s.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":s.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":s.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":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Ma(a,VRe)},{tagName:"stop",offset:"100%","stop-color":Ma(a,VRe)}]},{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":Ma(r,TO)},{tagName:"stop",offset:"60%","stop-color":Ma(r,URe)},{tagName:"stop",offset:"85%","stop-color":Ma(r,x5)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Ma(r,URe)},{tagName:"stop",offset:"60%","stop-color":Ma(r,TO)},{tagName:"stop",offset:"85%","stop-color":Ma(r,b5)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var C5=xw;var qFt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Cy=15,bw=105;function GRe(e,t){return e-t}function gie(e,t){let n=Ao(t,e,GRe);return n<0?~n:n}function YFt(e,t){if(Math.abs(e)<=Cy)return e/Cy;let n=Cy,i=bw,o,r=0,a;return e>0?(o=Math.log(t[t.length-1]),a=(o-r)/(i-n),Math.exp(r+a*(e-n))):(o=Math.log(-t[0]),a=(o-r)/(i-n),-Math.exp(r+a*(Math.abs(e)-n)))}function XFt(e,t,n){if(n.clockStep===Bo.SYSTEM_CLOCK)return Cy;if(Math.abs(e)<=1)return e*Cy;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=Cy,r=bw,a,s=0,c;return e>0?(a=Math.log(i),c=(a-s)/(r-o),(Math.log(e)-s)/c+o):(a=Math.log(-t[0]),c=(a-s)/(r-o),-((Math.log(Math.abs(e))-s)/c+o))}function qd(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=qd.defaultDateFormatter,this._timeFormatter=qd.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,ve.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(qd.defaultTicks),this.timeLabel=void 0,ve.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,ve.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,ve.defineProperty(this,"multiplierLabel",function(){let a=t._clockViewModel;if(a.clockStep===Bo.SYSTEM_CLOCK)return"Today";let s=a.multiplier;return s%1===0?`${s.toFixed(0)}x`:`${s.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,ve.defineProperty(this,"shuttleRingAngle",{get:function(){return XFt(e.multiplier,t._allShuttleRingTicks,e)},set:function(a){a=Math.max(Math.min(a,bw),-bw);let s=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Bo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(a)===bw){c.multiplier=a>0?s[s.length-1]:s[0];return}let u=YFt(a,s);if(t.snapToTicks)u=s[gie(u,s)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>Cy?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,ve.defineProperty(this,"_canAnimate",function(){let a=t._clockViewModel,s=a.clockRange;if(t.shuttleRingDragging||s===Pa.UNBOUNDED)return!0;let c=a.multiplier,u=a.currentTime,f=a.startTime,d=!1;if(s===Pa.LOOP_STOP)d=Q.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=a.stopTime;d=Q.greaterThan(u,f)&&Q.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(a.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,ve.defineProperty(this,"_isSystemTimeAvailable",function(){let a=t._clockViewModel;if(a.clockRange===Pa.UNBOUNDED)return!0;let c=a.systemTime;return Q.greaterThanOrEquals(c,a.startTime)&&Q.lessThanOrEquals(c,a.stopTime)}),this._isAnimating=void 0,ve.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Dn(function(){let a=t._clockViewModel;a.shouldAnimate?a.shouldAnimate=!1:t._canAnimate&&(a.shouldAnimate=!0)});this._pauseViewModel=new mT(n,{toggled:ve.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Dn(function(){let a=t._clockViewModel,s=a.multiplier;s>0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playReverseViewModel=new mT(i,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Dn(function(){let a=t._clockViewModel,s=a.multiplier;s<0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playForwardViewModel=new mT(o,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Bo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Dn(function(){t._clockViewModel.clockStep=Bo.SYSTEM_CLOCK},ve.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new mT(r,{toggled:ve.computed(function(){return e.clockStep===Bo.SYSTEM_CLOCK}),tooltip:ve.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Dn(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=gie(c,s)-1;u>=0&&(a.multiplier=s[u])}),this._faster=Dn(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=gie(c,s)+1;u<s.length&&(a.multiplier=s[u])})}qd.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${qFt[n.month-1]} ${n.day} ${n.year}`};qd.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];qd.defaultTimeFormatter=function(e,t){let n=Q.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`};qd.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};qd.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(GRe);let a=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&a.push(-i);Jn(a,r),this._allShuttleRingTicks=a};Object.defineProperties(qd.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}}});qd._maxShuttleRingAngle=bw;qd._realtimeShuttleRingAngle=Cy;var E5=qd;function HRe(e){e=e??G.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??G.EMPTY_ARRAY,i=e.terrainProviderViewModels??G.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,ve.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=ve.getObservable(this,"imageryProviderViewModels"),r=ve.pureComputed(function(){let d=o(),p={},g;for(g=0;g<d.length;g++){let y=d[g],x=y.category;l(p[x])?p[x].push(y):p[x]=[y]}let m=Object.keys(p),A=[];for(g=0;g<m.length;g++){let y=m[g];A.push({name:y,providers:p[y]})}return A});this._imageryProviders=r;let a=ve.getObservable(this,"terrainProviderViewModels"),s=ve.pureComputed(function(){let d=a(),p={},g;for(g=0;g<d.length;g++){let y=d[g],x=y.category;l(p[x])?p[x].push(y):p[x]=[y]}let m=Object.keys(p),A=[];for(g=0;g<m.length;g++){let y=m[g];A.push({name:y,providers:p[y]})}return A});this._terrainProviders=s,this.buttonTooltip=void 0,ve.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g}
  15854. ${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,ve.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=ve.observable();this._currentImageryLayers=[],ve.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,A=this._globe.imageryLayers,y=!1;for(p=0;p<m;p++){let x=A.length;for(let b=0;b<x;b++){let T=A.get(b);if(T===g[p]){A.remove(T),y=!0;break}}}if(l(d)){let x=d.creationCommand();if(Array.isArray(x)){let b=x.length;for(this._currentImageryLayers=[],p=b-1;p>=0;p--){let T=va.fromProviderAsync(x[p]);A.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let b=va.fromProviderAsync(x);if(b.name=d.name,y)A.add(b,0);else{let T=A.get(0);l(T)&&A.remove(T),A.add(b,0)}this._currentImageryLayers.push(b)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=ve.observable();ve.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof Ag),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),y=new JH(p).readyEvent.addEventListener(x=>{g||(this._globe.depthTestAgainstTerrain=!(x instanceof Ag),this._globe.terrainProvider=x,y())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Dn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(HRe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var v5=HRe;function S5(e,t){e=Bn(e);let n=new v5(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 a=document.createElement("div");a.className="cesium-baseLayerPicker-sectionTitle",a.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),a.innerHTML="Imagery",r.appendChild(a);let s=document.createElement("div");s.className="cesium-baseLayerPicker-section",s.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(s);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",s.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let A=document.createElement("div");A.className="cesium-baseLayerPicker-section",A.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(A);let y=document.createElement("div");y.className="cesium-baseLayerPicker-category",A.appendChild(y);let x=document.createElement("div");x.className="cesium-baseLayerPicker-categoryTitle",x.setAttribute("data-bind","text: name"),y.appendChild(x);let b=document.createElement("div");b.className="cesium-baseLayerPicker-choices",b.setAttribute("data-bind","foreach: providers"),y.appendChild(b);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),b.appendChild(T);let E=document.createElement("img");E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),T.appendChild(E);let S=document.createElement("div");S.className="cesium-baseLayerPicker-itemLabel",S.setAttribute("data-bind","text: name"),T.appendChild(S),ve.applyBindings(n,i),ve.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(w){i.contains(w.target)||r.contains(w.target)||(n.dropDownVisible=!1)},cn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(S5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});S5.prototype.isDestroyed=function(){return!1};S5.prototype.destroy=function(){return cn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._element),ve.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),fe(this)};var w5=S5;function WRe(e){let t=e.creationFunction;l(t.canExecute)||(t=Dn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",ve.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(WRe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var cr=WRe;function KFt(){let e=[],t=devicePixelRatio>=2;return e.push(new cr({name:"Bing Maps Aerial",iconUrl:Xt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Q_({style:K_.AERIAL})}})),e.push(new cr({name:"Bing Maps Aerial with Labels",iconUrl:Xt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Q_({style:K_.AERIAL_WITH_LABELS})}})),e.push(new cr({name:"Bing Maps Roads",iconUrl:Xt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Q_({style:K_.ROAD})}})),e.push(new cr({name:"ArcGIS World Imagery",iconUrl:Xt("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
  15855. https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return X_.fromBasemapType(Zm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new cr({name:"ArcGIS World Hillshade",iconUrl:Xt("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
  15856. https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return X_.fromBasemapType(Zm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new cr({name:"Esri World Ocean",iconUrl:Xt("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
  15857. https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return X_.fromBasemapType(Zm.OCEANS,{enablePickFeatures:!1})}})),e.push(new cr({name:"Open\xADStreet\xADMap",iconUrl:Xt("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
  15858. http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new py({url:"https://tile.openstreetmap.org/"})}})),e.push(new cr({name:"Stadia x Stamen Watercolor",iconUrl:Xt("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.
  15859. https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new py({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
  15860. &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
  15861. &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
  15862. &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new cr({name:"Stadia x Stamen Toner",iconUrl:Xt("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.
  15863. https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new py({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
  15864. &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
  15865. &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
  15866. &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new cr({name:"Stadia Alidade Smooth",iconUrl:Xt("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.
  15867. https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new py({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
  15868. &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
  15869. &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new cr({name:"Stadia Alidade Smooth Dark",iconUrl:Xt("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.
  15870. https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new py({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
  15871. &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
  15872. &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new cr({name:"Sentinel-2",iconUrl:Xt("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 Au.fromAssetId(3954)}})),e.push(new cr({name:"Blue Marble",iconUrl:Xt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Au.fromAssetId(3845)}})),e.push(new cr({name:"Earth at night",iconUrl:Xt("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 Au.fromAssetId(3812)}})),e.push(new cr({name:"Natural Earth\xA0II",iconUrl:Xt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
  15873. http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return vx.fromUrl(Xt("Assets/Textures/NaturalEarthII"))}})),e.push(new cr({name:"Google Maps Satellite",iconUrl:Xt("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return Au.fromAssetId(3830182)}})),e.push(new cr({name:"Google Maps Satellite with Labels",iconUrl:Xt("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return Au.fromAssetId(3830183)}})),e.push(new cr({name:"Google Maps Roadmap",iconUrl:Xt("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return Au.fromAssetId(3830184)}})),e.push(new cr({name:"Google Maps Contour",iconUrl:Xt("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return Au.fromAssetId(3830186)}})),e.push(new cr({name:"Azure Maps Aerial",iconUrl:Xt("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return Au.fromAssetId(3891168)}})),e.push(new cr({name:"Azure Maps Roads",iconUrl:Xt("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return Au.fromAssetId(3891169)}})),e}var I5=KFt;function QFt(){let e=[];return e.push(new cr({name:"WGS84 Ellipsoid",iconUrl:Xt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Ag({ellipsoid:te.WGS84})}})),e.push(new cr({name:"Cesium World Terrain",iconUrl:Xt("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 uw({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var D5=QFt;function $Ft(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof wa&&(e.tileset=n.primitive),e.pickActive=!1}}function YRe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof wa&&(e.tileset=i.primitive)},Sn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Sn.MOUSE_MOVE),e.picking=e.picking)}var JFt={maximumFractionDigits:3};function EO(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,JFt):Math.round(t).toLocaleString()}function vO(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[or.PICK]:e._statisticsPerPass[or.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>${EO(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${EO(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${EO(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function XRe(){let e=Pi.statistics;return`
  15874. <ul class="cesium-cesiumInspector-statistics">
  15875. <li><strong>Geometry Memory (MB): </strong>${EO(e.geometryByteLength)}</li>
  15876. <li><strong>Texture Memory (MB): </strong>${EO(e.texturesByteLength)}</li>
  15877. </ul>
  15878. `}var ZFt=[{text:"Highlight",value:Qu.HIGHLIGHT},{text:"Replace",value:Qu.REPLACE},{text:"Mix",value:Qu.MIX}],qRe=new U(1,1,0,.4),e2t=new U,P5=new U;function lc(e,t){let n=this,i=e.canvas;this._eventHandler=new zd(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new ny({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,ve.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=ve.observable({}),this.properties=[],ve.defineProperty(this,"properties",function(){let F=[],W=n._properties();for(let q in W)W.hasOwnProperty(q)&&F.push(q);return F});let o=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(F){o(F),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=F)}}),this.dynamicScreenSpaceError=!1;let r=ve.observable();ve.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(F){r(F),l(n._tileset)&&(n._tileset.colorBlendMode=F,n._scene.requestRender())}}),this.colorBlendMode=Qu.HIGHLIGHT;let a=ve.observable(),s=ve.observable();ve.defineProperty(this,"picking",{get:function(){return s()},set:function(F){s(F),F?n._eventHandler.setInputAction(function(W){let q=e.pick(W.endPosition);if(q instanceof as?(n.feature=q,n.tile=q.content.tile):l(q)&&l(q.content)?(n.feature=void 0,n.tile=q.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(a&&l(q)&&l(q.content)){let J;e.pickPositionSupported&&(J=e.pickPosition(W.endPosition),l(J)&&(n._tileset.debugPickPosition=J)),n._tileset.debugPickedTile=q.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=ve.observable();ve.defineProperty(this,"colorize",{get:function(){return c()},set:function(F){c(F),l(n._tileset)&&(n._tileset.debugColorizeTiles=F,n._scene.requestRender())}}),this.colorize=!1;let u=ve.observable();ve.defineProperty(this,"wireframe",{get:function(){return u()},set:function(F){u(F),l(n._tileset)&&(n._tileset.debugWireframe=F,n._scene.requestRender())}}),this.wireframe=!1;let f=ve.observable();ve.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(F){f(F),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=F,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=ve.observable();ve.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(F){d(F),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=F,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=ve.observable();ve.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(F){p(F),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=F,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=ve.observable();ve.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(F){g(F),l(n._tileset)&&(n._tileset.debugFreezeFrame=F,n._scene.debugShowFrustumPlanes=F,n._scene.requestRender())}}),this.freezeFrame=!1,ve.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return a()},set:function(F){a(F),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=F,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=ve.observable();ve.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(F){m(F),l(n._tileset)&&(n._tileset.debugShowGeometricError=F,n._scene.requestRender())}}),this.showGeometricError=!1;let A=ve.observable();ve.defineProperty(this,"showRenderingStatistics",{get:function(){return A()},set:function(F){A(F),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=F,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let y=ve.observable();ve.defineProperty(this,"showMemoryUsage",{get:function(){return y()},set:function(F){y(F),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=F,n._scene.requestRender())}}),this.showMemoryUsage=!1;let x=ve.observable();ve.defineProperty(this,"showUrl",{get:function(){return x()},set:function(F){x(F),l(n._tileset)&&(n._tileset.debugShowUrl=F,n._scene.requestRender())}}),this.showUrl=!1;let b=ve.observable();ve.defineProperty(this,"maximumScreenSpaceError",{get:function(){return b()},set:function(F){F=Number(F),isNaN(F)||(b(F),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=F))}}),this.maximumScreenSpaceError=16;let T=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(F){F=Number(F),isNaN(F)||(T(F),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=F))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,ve.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(T(),1/6)},set:function(F){let W=Math.pow(F,6);T(W),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=W)}});let E=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return E()},set:function(F){F=Number(F),isNaN(F)||(E(F),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=F))}}),this.dynamicScreenSpaceErrorFactor=24;let S=$Ft(this),w=ve.observable();ve.defineProperty(this,"pickActive",{get:function(){return w()},set:function(F){w(F),F?n._eventHandler.setInputAction(S,Sn.LEFT_CLICK):n._eventHandler.removeInputAction(Sn.LEFT_CLICK)}});let P=ve.observable();ve.defineProperty(this,"pointCloudShading",{get:function(){return P()},set:function(F){P(F),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=F)}}),this.pointCloudShading=!1;let O=ve.observable();ve.defineProperty(this,"geometricErrorScale",{get:function(){return O()},set:function(F){F=Number(F),isNaN(F)||(O(F),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=F))}}),this.geometricErrorScale=1;let B=ve.observable();ve.defineProperty(this,"maximumAttenuation",{get:function(){return B()},set:function(F){F=Number(F),isNaN(F)||(B(F),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=F===0?void 0:F))}}),this.maximumAttenuation=0;let L=ve.observable();ve.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(F){F=Number(F),isNaN(F)||(L(F),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=F===0?void 0:F))}}),this.baseResolution=0;let _=ve.observable();ve.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(F){_(F),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=F)}}),this.eyeDomeLighting=!1;let C=ve.observable();ve.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return C()},set:function(F){F=Number(F),isNaN(F)||(C(F),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=F))}}),this.eyeDomeLightingStrength=1;let v=ve.observable();ve.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return v()},set:function(F){F=Number(F),isNaN(F)||(v(F),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=F))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=ve.observable();ve.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(F){I(F),l(n._tileset)&&(n._tileset.skipLevelOfDetail=F)}}),this.skipLevelOfDetail=!0;let M=ve.observable();ve.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(F){F=Number(F),isNaN(F)||(M(F),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=F))}}),this.skipScreenSpaceErrorFactor=16;let N=ve.observable();ve.defineProperty(this,"baseScreenSpaceError",{get:function(){return N()},set:function(F){F=Number(F),isNaN(F)||(N(F),l(n._tileset)&&(n._tileset.baseScreenSpaceError=F))}}),this.baseScreenSpaceError=1024;let j=ve.observable();ve.defineProperty(this,"skipLevels",{get:function(){return j()},set:function(F){F=Number(F),isNaN(F)||(j(F),l(n._tileset)&&(n._tileset.skipLevels=F))}}),this.skipLevels=1;let k=ve.observable();ve.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(F){k(F),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=F)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let V=ve.observable();ve.defineProperty(this,"loadSiblings",{get:function(){return V()},set:function(F){V(F),l(n._tileset)&&(n._tileset.loadSiblings=F)}}),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)||YRe(this,!0)}Object.defineProperties(lc.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 ZFt}},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=vO(e,!1),this._pickStatisticsText=vO(e,!0),this._resourceCacheStatisticsText=XRe(),YRe(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,e2t):U.WHITE:t.color=P5,this._scene.requestRender()),l(e)&&(U.clone(e.color,P5),e.color=qRe,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()&&!_ie(t.content)&&(t.color=P5,this._scene.requestRender()),l(e)&&!_ie(e.content)&&(U.clone(e.color,P5),e.color=qRe,this._scene.requestRender()),this._tile=e}}});function _ie(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(!_ie(t[i]))return!1;return!0}return!1}lc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};lc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};lc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};lc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};lc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};lc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};lc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};lc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};lc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};lc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};lc.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 sA(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};lc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,s=n.value.slice(i,o).split(`
  15879. `),c=s.length,u;if(t.shiftKey)for(u=0;u<c;++u)s[u][0]===" "&&(s[u][1]===" "?(s[u]=s[u].substr(2),r-=2):(s[u]=s[u].substr(1),r-=1));else for(u=0;u<c;++u)s[u]=` ${s[u]}`,r+=2;let f=s.join(`
  15880. `);n.value=n.value.slice(0,i)+f+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};lc.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=vO(e,!1),this._pickStatisticsText=vO(e,!0),this._resourceCacheStatisticsText=XRe())};lc.prototype.isDestroyed=function(){return!1};lc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),fe(this)};lc.getStatistics=vO;var R5=lc;function O5(e,t){e=Bn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new R5(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 a=document.createElement("div");a.className="cesium-cesiumInspector-dropDown",n.appendChild(a);let s=Lf.createSection,c=Lf.createCheckbox,u=Lf.createRangeInput,f=Lf.createButton,d=s(a,"Tileset","tilesetVisible","toggleTileset"),p=s(a,"Display","displayVisible","toggleDisplay"),g=s(a,"Update","updateVisible","toggleUpdate"),m=s(a,"Logging","loggingVisible","toggleLogging"),A=s(a,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),y=s(a,"Style","styleVisible","toggleStyle"),x=s(a,"Optimization","optimizationVisible","toggleOptimization"),b=document.createElement("div");b.className="field-group";let T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));let E=document.createElement("div");E.setAttribute("data-bind","text: properties"),b.appendChild(T),b.appendChild(E),d.appendChild(b),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let S=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),w=document.createElement("p");w.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),w.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),w.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",S.appendChild(w),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 P=document.createElement("div");P.setAttribute("data-bind","visible: pointCloudShading"),P.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),P.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),P.appendChild(u("Base Resolution","baseResolution",0,1,.01)),P.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(P);let O=document.createElement("div");O.setAttribute("data-bind","visible: eyeDomeLighting"),O.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),O.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),P.appendChild(O),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let B=document.createElement("div");B.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(B);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let C=document.createElement("div");C.className="cesium-3dTilesInspector-statistics",C.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(C),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let v=document.createElement("div");v.className="cesium-3dTilesInspector-statistics",v.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(v);let I=document.createElement("div");y.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(M);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(N);let j=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(j);let k=document.createElement("div");k.className="cesium-cesiumInspector-error",k.setAttribute("data-bind","text: editorError"),I.appendChild(k),A.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),A.appendChild(c("Geometric Error","showGeometricError")),A.appendChild(c("Rendering Statistics","showRenderingStatistics")),A.appendChild(c("Memory Usage (MB)","showMemoryUsage")),A.appendChild(c("Url","showUrl")),x.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let V=document.createElement("div");V.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),x.appendChild(V);let F=document.createElement("div");F.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),x.appendChild(F);let W=document.createElement("div");W.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),x.appendChild(W),x.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),x.appendChild(c("Load siblings of visible tiles","loadSiblings")),ve.applyBindings(o,n)}Object.defineProperties(O5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});O5.prototype.isDestroyed=function(){return!1};O5.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};var M5=O5;function t2t(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 a=[];for(let s=2;s>=0;s--){let c=Math.pow(2,s);o>=c&&(a.push(s+1),o-=c)}r=a.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Aie(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var n2t=new An,i2t=new h;function SO(e,t){let n=this,i=e.canvas,o=new zd(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="",ve.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=Dn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Dn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Dn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Dn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=ve.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=ve.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=ve.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new ny({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Dn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=ve.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Dn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new AH({modelMatrix:u}),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=ve.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Dn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=ve.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=ve.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=ve.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Dn(function(){let u=n.depthFrustum+1;return n.depthFrustum=Aie(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Dn(function(){let u=n.depthFrustum-1;return n.depthFrustum=Aie(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=ve.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let a;this._showTileCoordinates=Dn(function(){return n.tileCoordinates&&!l(a)?a=e.imageryLayers.addImageryProvider(new ZH({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(a)&&(e.imageryLayers.remove(a),a=void 0),!0}),this._tileCoordinatesSubscription=ve.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=ve.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Dn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Dn(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=ve.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function s(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Dn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=ve.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(s,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)});function c(u){let f,d=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,n2t),g=r.pick(p,n._scene,i2t);if(l(g)){let m=d.cartesianToCartographic(g),A=r._surface.tileProvider._tilesToRenderByTextureCount;for(let y=0;!f&&y<A.length;++y){let x=A[y];if(l(x))for(let b=0;!f&&b<x.length;++b){let T=x[b];oe.contains(T.rectangle,m)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Dn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=ve.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(SO.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 Dn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Dn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Dn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Dn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Dn(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}}});SO.prototype._update=function(){this.frustums&&(this.frustumStatisticText=t2t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Aie(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}`};SO.prototype.isDestroyed=function(){return!1};SO.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(),fe(this)};var B5=SO;function L5(e,t){e=Bn(e);let n=document.createElement("div"),i=new B5(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 a=document.createElement("div");a.className="cesium-cesiumInspector-dropDown",o.appendChild(a);let s=Lf.createSection,c=Lf.createCheckbox,u=s(a,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),g.appendChild(m);let A=document.createElement("span");A.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(A);let y=document.createElement("input");y.type="button",y.value="-",y.className="cesium-cesiumInspector-pickButton",y.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(y);let x=document.createElement("input");x.type="button",x.value="+",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(x);let b=s(a,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",b.appendChild(T);let E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let S=document.createElement("div");S.className="cesium-cesiumInspector-center",S.appendChild(E),T.appendChild(S),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let w=s(a,"Terrain","terrainVisible","toggleTerrain"),P=document.createElement("div");P.className="cesium-cesiumInspector-pickSection",w.appendChild(P);let O=document.createElement("input");O.type="button",O.value="Pick a tile",O.className="cesium-cesiumInspector-pickButton",O.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),S=document.createElement("div"),S.appendChild(O),S.className="cesium-cesiumInspector-center",P.appendChild(S);let B=document.createElement("div");P.appendChild(B);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let C=document.createElement("input");C.type="button",C.value="NE",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: selectNE");let v=document.createElement("input");v.type="button",v.value="SW",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",B.className="cesium-cesiumInspector-frustumStatistics",B.appendChild(M),B.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let N=document.createElement("div");N.className="cesium-cesiumInspector-relativeText",N.textContent="Select relative:",B.appendChild(N);let j=document.createElement("table"),k=document.createElement("tr"),V=document.createElement("tr"),F=document.createElement("td");F.appendChild(L);let W=document.createElement("td");W.appendChild(_);let q=document.createElement("td");q.appendChild(C),k.appendChild(F),k.appendChild(W),k.appendChild(q);let J=document.createElement("td"),H=document.createElement("td");H.appendChild(v);let Z=document.createElement("td");Z.appendChild(I),V.appendChild(J),V.appendChild(H),V.appendChild(Z),j.appendChild(k),j.appendChild(V),B.appendChild(j),P.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),P.appendChild(c("Show only selected","filterTile","hasPickedTile")),w.appendChild(c("Wireframe","wireframe")),w.appendChild(c("Suspend LOD update","suspendUpdates")),w.appendChild(c("Show tile coordinates","tileCoordinates")),ve.applyBindings(i,this._element)}Object.defineProperties(L5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});L5.prototype.isDestroyed=function(){return!1};L5.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};var N5=L5;function F5(e,t){l(t)||(t=document.body),t=Bn(t);let n=this,i=ve.observable(ea.fullscreen),o=ve.observable(ea.enabled),r=t.ownerDocument;this.isFullscreen=void 0,ve.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,ve.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(a){o(a&&ea.enabled)}}),this.tooltip=void 0,ve.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Dn(function(){ea.fullscreen?ea.exitFullscreen():ea.requestFullscreen(n._fullscreenElement)},ve.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Bn(e)??r.body,this._callback=function(){i(ea.fullscreen)},r.addEventListener(ea.changeEventName,this._callback)}Object.defineProperties(F5.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});F5.prototype.isDestroyed=function(){return!1};F5.prototype.destroy=function(){document.removeEventListener(ea.changeEventName,this._callback),fe(this)};var k5=F5;var o2t="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",r2t="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 z5(e,t){e=Bn(e);let n=new k5(t,e);n._exitFullScreenPath=r2t,n._enterFullScreenPath=o2t;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),ve.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(z5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});z5.prototype.isDestroyed=function(){return!1};z5.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var U5=z5;var KRe=1e3;function Yd(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new gw({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 ye,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=$Re,this._handleArrowUp=QRe;let t=this;this._suggestionsVisible=ve.pureComputed(function(){let o=ve.getObservable(t,"_suggestions")().length>0,r=ve.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Dn(function(i){if(i=i??fT.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)f2t(t);else return l2t(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,a=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||a)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,a=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,s=o.key==="Enter"||o.keyCode===13;return a?QRe(t):r?$Re(t):s&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;eOe(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=e.autocomplete??!0,this.destinationFound=e.destinationFound??Yd.flyToDestination,this._focusTextbox=!1,ve.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=ve.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Yd._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,ve.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,ve.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,ve.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Yd.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}}});Yd.prototype.destroy=function(){this._suggestionSubscription.dispose()};function QRe(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],Yd._adjustSuggestionsScroll(e,n)}function $Re(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],Yd._adjustSuggestionsScroll(e,i)}function a2t(e,t){let n=l(t)?t.availability:void 0;return l(n)?bS(t,[e]).then(function(i){return e=i[0],e.height+=KRe,e}):(e.height+=KRe,Promise.resolve(e))}function s2t(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,a=t,s;return t instanceof oe?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=oe.center(t):s=TS(t,n):t=i.cartesianToCartographic(t),l(s)||(s=a2t(t,r)),s.then(function(c){a=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:R.IDENTITY})})}async function c2t(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 l2t(e,t,n){let i=e._searchText;if(ZRe(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 c2t(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,xie(e);let a=r.value;if(r.state==="fulfilled"&&l(a)&&a.length>0){e._searchText=a[0].displayName,e.destinationFound(e,a[0].destination);let s=JRe(e,gO.getCreditsFromResult(a[0]));l(s)||yie(e,t[o].credit);return}e._searchText=`${i} (not found)`}function yie(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function JRe(e,t){return l(t)&&t.forEach(n=>yie(e,n)),t}function xie(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function u2t(e,t){let n=Bn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let a=r.offsetTop;a+r.clientHeight>i.clientHeight?i.scrollTop=a+r.clientHeight:a<i.scrollTop&&(i.scrollTop=a)}function f2t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function ZRe(e){return/^\s*$/.test(e)}function eOe(e){ve.getObservable(e,"_suggestions").removeAll()}async function d2t(e){if(!e.autoComplete)return;let t=e._searchText;if(eOe(e),xie(e),!ZRe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,fT.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let a=gO.getCreditsFromResult(r);o=o&&!l(a),JRe(e,a)}),o&&yie(e,n.credit)}if(e._suggestions.length>=5)return}}Yd.flyToDestination=s2t;Yd._updateSearchSuggestions=d2t;Yd._adjustSuggestionsScroll=u2t;Yd.prototype.isDestroyed=function(){return!1};Yd.prototype.destroy=function(){return xie(this),fe(this)};var V5=Yd;var h2t="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",m2t="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 j5(e){let t=Bn(e.container),n=new V5(e);n._startSearchPath=h2t,n._stopSearchPath=m2t;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 a=document.createElement("div");a.className="search-results",a.setAttribute("data-bind","visible: _suggestionsVisible");let s=document.createElement("ul");s.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");s.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),a.appendChild(s),t.appendChild(a),ve.applyBindings(n,i),ve.applyBindings(n,a),this._container=t,this._searchSuggestionsContainer=a,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},cn.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(j5.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});j5.prototype.isDestroyed=function(){return!1};j5.prototype.destroy=function(){let e=this._container;return cn.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(),ve.cleanNode(this._form),ve.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),fe(this)};var G5=j5;function tOe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Dn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",ve.track(this,["tooltip"])}Object.defineProperties(tOe.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 H5=tOe;function W5(e,t,n){e=Bn(e);let i=new H5(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),ve.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(W5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});W5.prototype.isDestroyed=function(){return!1};W5.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var q5=W5;function p2t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function iOe(e,t){ve.track(e);for(let n=0;n<e.sublayers.length;n++)iOe(e.sublayers[n],t)}function Y5(e){return e.modelName==="FullModel"}function oOe(e){return e.modelName==="Overview"}function rOe(e){return oOe(e)||Y5(e)}function nOe(e,t){if(rOe(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:ve.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function g2t(e,t){if(rOe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");Y5(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function _2t(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 A2t(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:ve.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:ve.observable(!0),index:-1}],currentLayer:ve.observable(),expandClickHandler:p2t,setOptionDisable:function(i,o){ve.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){g2t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){iOe(n[i],this.viewModel);let o=nOe(n[i],this.viewModel);l(o)&&(oOe(o)||!l(this.viewModel.defaultLayer)&&Y5(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=nOe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=Y5(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return _2t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var X5=A2t;function y2t(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=`
  15881. <h3>Building explorer</h3>
  15882. <select
  15883. data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer"
  15884. ></select>
  15885. <div id="bsl-wrapper">
  15886. <h3>Select Level</h3>
  15887. <select data-bind="options: levels, value: currentLevel"></select>
  15888. <h3>Disciplines & Categories</h3>
  15889. <ul class="layersList" data-bind="foreach: sublayers">
  15890. <ul class="layersList" data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
  15891. <li>
  15892. <div class="li-wrapper">
  15893. <span
  15894. class="expandItem"
  15895. data-bind="click: $root.expandClickHandler"
  15896. >+</span
  15897. >
  15898. <input
  15899. type="checkbox"
  15900. data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
  15901. />
  15902. <label data-bind="attr: { for: name}">
  15903. <span data-bind="text: name"></span>
  15904. </label>
  15905. </div>
  15906. <ul class="nested" data-bind="attr: { id: name + '-expander'}">
  15907. <li data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
  15908. <div class="li-wrapper">
  15909. <input
  15910. type="checkbox"
  15911. data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
  15912. />
  15913. <label data-bind="attr: { for: name}">
  15914. <span data-bind="text: name"></span>
  15915. </label>
  15916. </div>
  15917. </li>
  15918. </ul>
  15919. </li>
  15920. </ul>
  15921. </ul>
  15922. </div>`,n.appendChild(i);let o=new X5(t);ve.track(o),ve.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var aOe=y2t;var x2t="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",b2t="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 bie(){this._cameraClicked=new ye,this._closeClicked=new ye,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",ve.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,ve.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?b2t:x2t}}),ve.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}bie.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(bie.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var K5=bie;function Q5(e){e=Bn(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 a=new K5;ve.applyBindings(a,t),this._container=e,this._element=t,this._frame=r,this._viewModel=a,this._descriptionSubscription=void 0;let s=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=Xt("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),s._descriptionSubscription=Dc(a,"description",function(d){r.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let A=window.getComputedStyle(g);if(A!==null){let y=A["background-color"],x=U.fromCssColorString(y);l(x)&&x.alpha!==0&&(p=A["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(Q5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});Q5.prototype.isDestroyed=function(){return!1};Q5.prototype.destroy=function(){let e=this._container;return ve.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),fe(this)};var $5=Q5;function sOe(){this.showInstructions=!1;let e=this;this._command=Dn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Dn(function(){e._touch=!1}),this._showTouch=Dn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",ve.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(sOe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var J5=sOe;function Z5(e){let t=Bn(e.container),n=new J5,i=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 a=document.createElement("div");a.className="cesium-navigation-help",a.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(a);let s=document.createElement("button");s.type="button",s.className="cesium-navigation-button cesium-navigation-button-left",s.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=Xt("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",s.appendChild(c),s.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Xt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),a.appendChild(s),a.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${Xt("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="${Xt("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="${Xt("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>`,a.appendChild(d);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="${Xt("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="${Xt("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="${Xt("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="${Xt("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>`,a.appendChild(p),ve.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},cn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(Z5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Z5.prototype.isDestroyed=function(){return!1};Z5.prototype.destroy=function(){return cn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var e9=Z5;function Tie(e){this._scene=e.scene,this.lowFrameRateMessage=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,ve.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Dn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=TH.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(Tie.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Tie.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),fe(this)};var t9=Tie;function n9(e){let t=Bn(e.container),n=new t9(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),ve.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(n9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});n9.prototype.isDestroyed=function(){return!1};n9.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var i9=n9;function o9(e){this._scene=e,this._orthographic=e.camera.frustum instanceof fn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,ve.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;ve.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Dn(function(){t.sceneMode===ie.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Yr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ie.SCENE2D||t._scene.camera.frustum instanceof fn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Dn(function(){t.sceneMode!==ie.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Dn(function(){t.sceneMode!==ie.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ie}Object.defineProperties(o9.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}}});o9.prototype.isDestroyed=function(){return!1};o9.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var r9=o9;var T2t="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",C2t="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 a9(e,t){e=Bn(e);let n=new r9(t);n._perspectivePath=T2t,n._orthographicPath=C2t;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 a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",a.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(a),ve.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(s){i.contains(s.target)||(n.dropDownVisible=!1)},cn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(a9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});a9.prototype.isDestroyed=function(){return!1};a9.prototype.destroy=function(){return this._viewModel.destroy(),cn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var s9=a9;var E2t=new z,c9="-1000px";function wO(e,t,n){this._scene=e,this._screenPositionX=c9,this._screenPositionY=c9,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,ve.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,ve.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),ve.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return io.worldToWindowCoordinates(e,i,o)}}wO.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,E2t);if(!l(e))this._screenPositionX=c9,this._screenPositionY=c9;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`}}};wO.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Oa.EXPONENTIAL_OUT})};wO.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Oa.EXPONENTIAL_OUT})};Object.defineProperties(wO.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var l9=wO;function u9(e,t){e=Bn(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 a=document.createElementNS(i,"g");a.setAttribute("transform","translate(80,80)"),r.appendChild(a);let s=document.createElementNS(i,"path");s.setAttribute("data-bind","attr: { transform: _transform }"),s.setAttribute("d",o),a.appendChild(s),n.appendChild(r);let c=new l9(t,this._element,this._container);this._viewModel=c,ve.applyBindings(this._viewModel,this._element)}Object.defineProperties(u9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});u9.prototype.isDestroyed=function(){return!1};u9.prototype.destroy=function(){let e=this._container;return ve.cleanNode(this._element),e.removeChild(this._element),fe(this)};var f9=u9;function gT(e,t,n){this._color=e,this._height=t,this._base=n??0}gT.prototype.getHeight=function(){return this._height};gT.prototype.getBase=function(){return this._base};gT.prototype.getStartTime=function(){return this._start};gT.prototype.getStopTime=function(){return this._stop};gT.prototype.setRange=function(e,t){this._start=e,this._stop=t};gT.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=Q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=Q.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 d9=gT;function cOe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new U(.5,.5,.5,1),this.backgroundColor=i||new U(0,0,0,0)}cOe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=Q.addSeconds(t.startJulian,t.duration,new Q);if(Q.lessThan(n,o)&&Q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(Q.lessThanOrEquals(n,r)&&Q.greaterThanOrEquals(i,o)){let a,s,c;for(a=0;a<t.timeBarWidth;++a){let u=Q.addSeconds(t.startJulian,a/t.timeBarWidth*t.duration,new Q);!l(s)&&Q.greaterThanOrEquals(u,n)?s=a:!l(c)&&Q.greaterThanOrEquals(u,i)&&(c=a)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(s)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(s,t.y,Math.max(c-s,1),this.height))}};var h9=cOe;var Cie=1e12,Xd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},ql={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Ey=[.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],v2t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Yl(e,t){e=Bn(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=Xd.none,this._touchMode=ql.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=S2t(this),this._onMouseUp=w2t(this),this._onMouseMove=I2t(this),this._onMouseWheel=D2t(this),this._onTouchStart=P2t(this),this._onTouchMove=O2t(this),this._onTouchEnd=R2t(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()}Yl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Yl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Yl.prototype.isDestroyed=function(){return!1};Yl.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),fe(this)};Yl.prototype.addHighlightRange=function(e,t,n){let i=new d9(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Yl.prototype.addTrack=function(e,t,n,i){let o=new h9(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Yl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Pa.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=Q.secondsDifference(o,i),a=Q.secondsDifference(i,this._startJulian),s=Q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):a>0?(this._endJulian=Q.addSeconds(this._endJulian,a,new Q),this._startJulian=i,this._timeBarSecondsSpan=Q.secondsDifference(this._endJulian,this._startJulian)):s<0&&(this._startJulian=Q.addSeconds(this._startJulian,s,new Q),this._endJulian=o,this._timeBarSecondsSpan=Q.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)};Yl.prototype.zoomFrom=function(e){let t=Q.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(Q.addSeconds(this._startJulian,t-t*e,new Q),Q.addSeconds(this._endJulian,n*e-n,new Q))};function Eie(e){return e<10?`0${e.toString()}`:e.toString()}Yl.prototype.makeLabel=function(e){let t=Q.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`${v2t[t.month-1]} ${t.day} ${t.year} ${Eie(t.hour)}:${Eie(t.minute)}:${Eie(t.second)}${i}`};Yl.prototype.smallestTicInPixels=7;Yl.prototype._makeTics=function(){let e=this._timeBarEle,t=Q.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 a="",s=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<s?(d=s,this._timeBarSecondsSpan=s,this._endJulian=Q.addSeconds(this._startJulian,s,new Q)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=Q.addSeconds(this._startJulian,c,new Q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),A,y=Q.toGregorianDate(g);d>31536e4?A=Q.fromDate(new Date(Date.UTC(Math.floor(y.year/100)*100,0))):d>31536e3?A=Q.fromDate(new Date(Date.UTC(Math.floor(y.year/10)*10,0))):d>86400?A=Q.fromDate(new Date(Date.UTC(y.year,0))):A=Q.fromDate(new Date(Date.UTC(y.year,y.month,y.day)));let x=Q.secondsDifference(this._startJulian,Q.addSeconds(A,m,new Q)),b=x+d;this._epochJulian=A;function T(F){return Math.floor(x/F)*F}function E(F,W){return Math.ceil(F/W+.5)*W}function S(F){return(F-x)/d}function w(F,W){return F-W*Math.round(F/W)}this._rulerEle.innerHTML=this.makeLabel(Q.addSeconds(this._endJulian,-s,new Q));let P=this._rulerEle.offsetWidth+20;P<30&&(P=180);let O=f;f-=u;let B={startTime:x,startJulian:g,epochJulian:A,duration:d,timeBarWidth:p,getAlpha:S};this._highlightRanges.forEach(function(F){a+=F.render(B)});let L=0,_=0,C=0,v=P/p;v>1&&(v=1),v*=this._timeBarSecondsSpan;let I=-1,M=-1,N=Ey.length,j;for(j=0;j<N;++j){let F=Ey[j];if(++I,L=F,F>v&&F>f)break;M<0&&p*(F/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=I)}if(I>0){for(;I>0;)if(--I,Math.abs(w(L,Ey[I]))<1e-5){Ey[I]>=f&&(_=Ey[I]);break}if(M>=0)for(;M<I;){if(Math.abs(w(_,Ey[M]))<1e-5&&Ey[M]>=f){C=Ey[M];break}++M}}f=O,f>u&&C<1e-5&&Math.abs(f-L)>u&&(C=f,f<=L+u&&(_=0));let k=-999999,V;if(p*(C/this._timeBarSecondsSpan)>=3)for(o=T(C);o<=b;o=E(o,C))a+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(o=T(_);o<=b;o=E(o,_))a+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,b+=L,o=T(L);let F=Q.computeTaiMinusUtc(A);for(;o<=b;){let W=Q.addSeconds(g,o-x,new Q);if(L>2.1){let Z=Q.computeTaiMinusUtc(W);Math.abs(Z-F)>.1&&(o+=Z-F,W=Q.addSeconds(g,o-x,new Q))}let q=Math.round(p*S(o)),J=this.makeLabel(W);this._rulerEle.innerHTML=J,V=this._rulerEle.offsetWidth,V<10&&(V=P);let H=q-(V/2-1);H>k?(k=H+V+5,a+=`<span class="cesium-timeline-ticMain" style="left: ${q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${H.toString()}px;">${J}</span>`):a+=`<span class="cesium-timeline-ticSub" style="left: ${q.toString()}px;"></span>`,o=E(o,L)}}else this._mainTicSpan=-1;a+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=a,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),B.y=0,this._trackList.forEach(function(F){F.render(r._context,B),B.y+=F.height})};Yl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=Q.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(Q.addSeconds(this._startJulian,this._timelineDrag,new Q),Q.addSeconds(this._endJulian,this._timelineDrag,new Q)))};Yl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=Q.addSeconds(this._startJulian,t,new Q),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 S2t(e){return function(t){e._mouseMode!==Xd.touchOnly&&(t.button===0?(e._mouseMode=Xd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Xd.zoom:e._mouseMode=Xd.slide)),t.preventDefault()}}function w2t(e){return function(t){e._mouseMode=Xd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function I2t(e){return function(t){let n;if(e._mouseMode===Xd.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===Xd.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(Q.addSeconds(e._startJulian,i,new Q),Q.addSeconds(e._endJulian,i,new Q))}}else e._mouseMode===Xd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function D2t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Cie=Math.max(Math.min(Math.abs(n),Cie),1),n/=Cie,e.zoomFrom(Math.pow(1.05,-n))}}function P2t(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Xd.touchOnly,n===1?(i=Q.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=ql.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=ql.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=ql.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=ql.ignore}}function R2t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===ql.singleTap?(e._touchMode=ql.scrub,e._onTouchMove(t)):e._touchMode===ql.scrub&&e._onTouchMove(t),e._mouseMode=Xd.touchOnly,n!==1?e._touchMode=n>0?ql.ignore:ql.none:e._touchMode===ql.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function O2t(e){return function(t){let n,i,o,r,a,s,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===ql.singleTap&&(e._touchMode=ql.slideZoom),e._mouseMode=Xd.touchOnly,e._touchMode===ql.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===ql.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,a=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,a=0),l(r)&&(a>0&&e._touchState.spanX>0?(c=e._touchState.spanX/a,s=Q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new Q)):(n=e._touchState.centerX-r,s=Q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new Q)),e.zoomTo(s,Q.addSeconds(s,e._timeBarSecondsSpan*c,new Q)),e._touchState.centerX=r,e._touchState.spanX=a))}}Yl.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 m9=Yl;var hOe=Na(dOe(),1);function L2t(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 mOe(){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 N2t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(mOe(),e._locked=!1),e._noSleep.disable(),ea.exitFullscreen(),n(!1)):(ea.fullscreen||ea.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=L2t("landscape")),t.useWebVR=!0,n(!0)))}function p9(e,t){let n=this,i=ve.observable(ea.enabled),o=ve.observable(!1);this.isVRMode=void 0,ve.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,ve.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(a){i(a&&ea.enabled)}}),this.tooltip=void 0,ve.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=ve.observable(!1);this._isOrthographic=void 0,ve.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Yr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof fn)}),this._locked=!1,this._noSleep=new hOe.default,this._command=Dn(function(){N2t(n,e,o,r)},ve.getObservable(this,"isVREnabled")),this._vrElement=Bn(t)??document.body,this._callback=function(){!ea.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(mOe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(ea.changeEventName,this._callback)}Object.defineProperties(p9.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});p9.prototype.isDestroyed=function(){return!1};p9.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(ea.changeEventName,this._callback),fe(this)};var g9=p9;var F2t="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",k2t="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 _9(e,t,n){e=Bn(e);let i=new g9(t,n);i._exitVRPath=k2t,i._enterVRPath=F2t;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),ve.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(_9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_9.prototype.isDestroyed=function(){return!1};_9.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var A9=_9;function y9(e,t){this._scene=e;let n=this,i=function(o,r,a,s){n.sceneMode=a,n.dropDownVisible=!1};this._eventHelper=new Yr,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",ve.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,ve.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ie.SCENE2D?n.tooltip2D:o===ie.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Dn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Dn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Dn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Dn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ie}Object.defineProperties(y9.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}}});y9.prototype.isDestroyed=function(){return!1};y9.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var x9=y9;var z2t="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",U2t="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",V2t="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 b9(e,t,n){e=Bn(e);let i=new x9(t,n);i._globePath=z2t,i._flatMapPath=U2t,i._columbusViewPath=V2t;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 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.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(a);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.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(s);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),ve.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},cn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(b9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});b9.prototype.isDestroyed=function(){return!1};b9.prototype.destroy=function(){return this._viewModel.destroy(),cn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var T9=b9;var pOe=new ce;function AOe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function j2t(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 G2t(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 gOe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof Yo)return i;if(n instanceof as||n instanceof HE)return new Yo({name:G2t(n),description:j2t(n),feature:n})}if(l(e.scene.globe))return q2t(e,t.position)}var H2t=new Q;function Iie(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;Q.equals(i,o)&&(o=Q.addSeconds(i,D.EPSILON2,H2t)),e.updateFromClock(),e.zoomTo(i,o)}}}var W2t=new h;function q2t(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new Yo({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==r)return;if(!l(a)||a.length===0){e.selectedEntity=_Oe();return}let s=a[0],c=new Yo({id:s.name,description:s.description});if(l(s.position)){let u=e.scene.ellipsoid.cartographicToCartesian(s.position,W2t);c.position=new au(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=_Oe())}),r}function _Oe(){return new Yo({id:"None",description:"No features found."})}function Y2t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,a=e._baseLayerPicker,s=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=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(a)&&(a.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function ao(e,t){e=Bn(e),t=t??G.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 a=document.createElement("div");a.className="cesium-viewer-bottom",o.appendChild(a);let s=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new pp,u=new A5(c),f=!0);let d=new sH(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:a,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:s,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=d.scene,g=new Yr;g.add(c.onTick,ao.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let W=document.createElement("div");W.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(W),m=new f9(W,p)}let A;if(!l(t.infoBox)||t.infoBox!==!1){let W=document.createElement("div");W.className="cesium-viewer-infoBoxContainer",o.appendChild(W),A=new $5(W);let q=A.viewModel;g.add(q.cameraClicked,ao.prototype._onInfoBoxCameraClicked,this),g.add(q.closeClicked,ao.prototype._onInfoBoxClockClicked,this)}let y=document.createElement("div");y.className="cesium-viewer-toolbar",o.appendChild(y);let x;if(!l(t.geocoder)||t.geocoder!==!1){let W=document.createElement("div");W.className="cesium-viewer-geocoderContainer",y.appendChild(W);let q;typeof t.geocoder=="string"?q=[new gw({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),x=new G5({container:W,geocoderServices:q,scene:p}),g.add(x.viewModel.search.beforeExecute,ao.prototype._clearObjects,this)}let b;(!l(t.homeButton)||t.homeButton!==!1)&&(b=new q5(y,p),l(x)&&g.add(b.viewModel.command.afterExecute,function(){let W=x.viewModel;W.searchText="",W.isSearchInProgress&&W.search()}),g.add(b.viewModel.command.beforeExecute,ao.prototype._clearTrackedObject,this));let T;!s&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(T=new T9(y,p));let E;t.projectionPicker&&(E=new s9(y,p));let S,w;if(n){let W=t.imageryProviderViewModels??I5(),q=t.terrainProviderViewModels??D5();S=new w5(y,{globe:p.globe,imageryProviderViewModels:W,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),w=y.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(S.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(S.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let P;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let W=!0;try{if(l(window.localStorage)){let q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(q)&&q?W=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}P=new e9({container:y,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??W})}let O;if(!l(t.animation)||t.animation!==!1){let W=document.createElement("div");W.className="cesium-viewer-animationContainer",o.appendChild(W),O=new C5(W,new E5(u))}let B;if(!l(t.timeline)||t.timeline!==!1){let W=document.createElement("div");W.className="cesium-viewer-timelineContainer",o.appendChild(W),B=new m9(W,c),B.addEventListener("settime",AOe,!1),B.zoomTo(c.startTime,c.stopTime)}let L,_,C;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(C=document.createElement("div"),C.className="cesium-viewer-fullscreenContainer",o.appendChild(C),L=new U5(C,t.fullscreenElement),_=Dc(L.viewModel,"isFullscreenEnabled",function(W){C.style.display=W?"block":"none",l(B)&&(B.container.style.right=`${C.clientWidth}px`,B.resize())}));let v,I,M;if(t.vrButton){let W=document.createElement("div");W.className="cesium-viewer-vrContainer",o.appendChild(W),v=new A9(W,p,t.fullScreenElement),I=Dc(v.viewModel,"isVREnabled",function(q){W.style.display=q?"block":"none",l(L)&&(W.style.right=`${C.clientWidth}px`),l(B)&&(B.container.style.right=`${W.clientWidth}px`,B.resize())}),M=Dc(v.viewModel,"isVRMode",function(q){Y2t(i,q)})}this._baseLayerPickerDropDown=w,this._fullscreenSubscription=_,this._vrSubscription=I,this._vrModeSubscription=M,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=a,this._element=o,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=A,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=y,this._homeButton=b,this._sceneModePicker=T,this._projectionPicker=E,this._baseLayerPicker=S,this._navigationHelpButton=P,this._animation=O,this._timeline=B,this._fullscreenButton=L,this._vrButton=v,this._geocoder=x,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(A)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new ye;let N=this._cesiumWidget.dataSources,j=this._cesiumWidget.dataSourceDisplay;g.add(N.dataSourceAdded,ao.prototype._onDataSourceAdded,this),g.add(N.dataSourceRemoved,ao.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,ao.prototype.resize,this);let k=N.length;for(let W=0;W<k;W++)this._dataSourceAdded(N,N.get(W));this._dataSourceAdded(void 0,j.defaultDataSource),g.add(N.dataSourceAdded,ao.prototype._dataSourceAdded,this),g.add(N.dataSourceRemoved,ao.prototype._dataSourceRemoved,this);function V(W){let q=gOe(i,W);l(q)?X.getValueOrUndefined(q.position,i.clock.currentTime)?i.trackedEntity=q:i.zoomTo(q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function F(W){i.selectedEntity=gOe(i,W)}d.screenSpaceEventHandler.setInputAction(F,Sn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(V,Sn.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(ao.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,Iie(this._timeline,e))}}});ao.prototype.extend=function(e,t){e(this,t)};ao.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 a=i-125,s=this._baseLayerPickerDropDown;if(l(s)&&(s.style.maxHeight=`${a}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${a}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=a);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,A=this._vrButton,y=c.container,x=y.style;p=y.clientHeight+3,x.left=`${f}px`;let b=0;l(m)&&(b+=m.container.clientWidth),l(A)&&(b+=A.container.clientWidth),x.right=`${b}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};ao.prototype.forceResize=function(){this._lastWidth=0,this.resize()};ao.prototype.render=function(){this._cesiumWidget.render()};ao.prototype.isDestroyed=function(){return!1};ao.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",AOe,!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(),fe(this)};ao.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(ao.prototype._onEntityCollectionChanged,this)};ao.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(ao.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};ao.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};ao.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,pOe)!==Tt.FAILED?n=pOe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let a=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(a)&&(a.position=h.clone(n,a.position),a.showSelection=r&&i,a.update());let s=l(this._infoBox)?this._infoBox.viewModel:void 0;l(s)&&(s.showInfo=r,s.enableCamera=i,s.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(s.titleText=o.name??o.id,s.description=X.getValueOrDefault(o.description,t,"")):(s.titleText="",s.description=""))};ao.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)}};ao.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)}};ao.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};ao.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};ao.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};ao.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Iie(this.timeline,e)};ao.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Iie(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,ao.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};ao.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};ao.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};ao.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var yOe=ao;function X2t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new M5(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var xOe=X2t;function K2t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new N5(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var bOe=K2t;function Q2t(e,t){t=t??G.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new ye,r=t.clearOnDrop??!0,a=t.dropTarget??e.container,s=t.clampToGround??!0,c=t.proxy;a=Bn(a),Object.defineProperties(e,{dropTarget:{get:function(){return a},set:function(f){TOe(a,u),a=f,Die(a,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?Die(a,u):TOe(a,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return s},set:function(f){s=f}}});function u(f){_T(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],A=new FileReader;A.onload=$2t(e,m,c,s),A.onerror=J2t(e,m),A.readAsText(m)}}Die(a,u),e.destroy=p5(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function _T(e){e.stopPropagation(),e.preventDefault()}function TOe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",_T,!1),n.removeEventListener("dragover",_T,!1),n.removeEventListener("dragexit",_T,!1))}function Die(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",_T,!1),e.addEventListener("dragover",_T,!1),e.addEventListener("dragexit",_T,!1)}function $2t(e,t,n,i){let o=e.scene;return function(r){let a=t.name;try{let s;if(/\.czml$/i.test(a))s=yV.load(JSON.parse(r.target.result),{sourceUri:a});else if(/\.geojson$/i.test(a)||/\.json$/i.test(a)||/\.topojson$/i.test(a))s=bb.load(JSON.parse(r.target.result),{sourceUri:a,clampToGround:i});else if(/\.(kml|kmz)$/i.test(a))s=xS.load(t,{sourceUri:a,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(a))s=N4.load(t,{sourceUri:a,proxy:n});else{e.dropError.raiseEvent(e,a,`Unrecognized file: ${a}`);return}l(s)&&e.dataSources.add(s).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,a,c)})}catch(s){e.dropError.raiseEvent(e,a,s)}}}function J2t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var COe=Q2t;function Z2t(e,t){t=t??G.EMPTY_OBJECT;let n=new i9({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var EOe=Z2t;function vOe(e){let t=e.split(`
  15923. `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,a=t[n].match(o)[0].length;for(let s=n;s<t.length;s++){let c=t[s];c.match(o)[0].length>=a&&(c=c.slice(a)),i+=`${c}
  15924. `}return i}function Kd(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:a}=o;t._definedProperties.push(r);let s=o.setPrimitiveFunction;s===!0&&(s=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=ve.observable();return ve.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof a=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=a)),typeof a=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(s)&&l(t._voxelPrimitive)&&(s(f),e.requestRender())}}),t[r]=a,u}function i(o,r){return function(a){let s=t._voxelPrimitive[o].clone();s[r]=a,t._voxelPrimitive[o]=s}}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=vOe(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===wc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===wc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===wc.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-D.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:D.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&t0(t)},getPrimitiveFunction:function(){t.translationX=R.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&t0(t)},getPrimitiveFunction:function(){t.translationY=R.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&t0(t)},getPrimitiveFunction:function(){t.translationZ=R.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&t0(t)},getPrimitiveFunction:function(){t.scaleX=R.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&t0(t)},getPrimitiveFunction:function(){t.scaleY=R.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&t0(t)},getPrimitiveFunction:function(){t.scaleZ=R.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&t0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&t0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&t0(t)}})}var ekt=new h,tkt=new h,nkt=new kc,ikt=new $;function t0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,ekt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,tkt),i=nkt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,ikt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=R.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Kd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=vOe(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,t0(t)}}});Kd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Kd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Kd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Kd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Kd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Kd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Kd.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new Pg({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Kd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,s=n.value.slice(i,o).split(`
  15925. `),c=s.length,u;if(t.shiftKey)for(u=0;u<c;++u)s[u][0]===" "&&(s[u][1]===" "?(s[u]=s[u].substr(2),r-=2):(s[u]=s[u].substr(1),r-=1));else for(u=0;u<c;++u)s[u]=` ${s[u]}`,r+=2;let f=s.join(`
  15926. `);n.value=n.value.slice(0,i)+f+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};Kd.prototype.isDestroyed=function(){return!1};Kd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),fe(this)};var C9=Kd;function E9(e,t){e=Bn(e);let n=document.createElement("div"),i=new C9(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{createSection:a,createCheckbox:s,createRangeInput:c,createButton:u}=Lf,f=a(r,"Display","displayVisible","toggleDisplay"),d=a(r,"Transform","transformVisible","toggleTransform"),p=a(r,"Clipping","clippingVisible","toggleClipping"),g=a(r,"Shader","shaderVisible","toggleShader");f.appendChild(s("Depth Test","depthTest")),f.appendChild(s("Show","show")),f.appendChild(s("Disable Update","disableUpdate")),f.appendChild(s("Debug Draw","debugDraw")),f.appendChild(s("Jitter","jitter")),f.appendChild(s("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,A=10,y=D.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+A)),d.appendChild(c("Scale Y","scaleY",0,+A)),d.appendChild(c("Scale Z","scaleZ",0,+A)),d.appendChild(c("Heading","angleX",-y,+y)),d.appendChild(c("Pitch","angleY",-y,+y)),d.appendChild(c("Roll","angleZ",-y,+y)),Pie("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Pie("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Pie("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let x=document.createElement("div");g.appendChild(x);let b=document.createElement("textarea");b.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),x.className="cesium-cesiumInspector-styleEditor",x.appendChild(b);let T=u("Compile (Ctrl+Enter)","compileShader");x.appendChild(T);let E=document.createElement("label");E.style.display="block",E.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),x.appendChild(E),ve.applyBindings(i,n)}Object.defineProperties(E9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});E9.prototype.isDestroyed=function(){return!1};E9.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};function Pie(e,t,n,i,o,r,a,s,c,u,f,d,p,g){let m=Lf.createRangeInputWithDynamicMinMax,A=g.appendChild(document.createElement("div"));A.setAttribute("data-bind",`if: ${p}`),A.appendChild(m(e,a)),A.appendChild(m(t,s)),A.appendChild(m(n,c)),A.appendChild(m(i,u)),A.appendChild(m(o,f)),A.appendChild(m(r,d))}var v9=E9;function okt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new v9(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var SOe=okt;globalThis.CESIUM_VERSION="1.142.0";var NLo="1.142.0";export{S0 as AlphaMode,jk as AlphaPipelineStage,j2 as AnchorPointDirect,G2 as AnchorPointIndirect,C5 as Animation,E5 as AnimationViewModel,xo as Appearance,wi as ApproximateTerrainHeights,v1e as ArcGISTiledElevationTerrainProvider,Zm as ArcGisBaseMapType,X_ as ArcGisMapServerImageryProvider,od as ArcGisMapService,rn as ArcType,Rl as ArticulationStageType,Nt as AssociativeArray,tE as Atmosphere,bk as AtmospherePipelineStage,on as AttributeCompression,Ft as AttributeType,GG as AutoExposure,Gg as AutomaticUniforms,Fi as Axis,Xf as AxisAlignedBoundingBox,S3 as Azure2DImageryProvider,tk as B3dmLoader,ek as B3dmParser,w5 as BaseLayerPicker,v5 as BaseLayerPickerViewModel,aC as BatchTable,BC as BatchTableHierarchy,uu as BatchTexture,Gk as BatchTexturePipelineStage,wo as Billboard,dd as BillboardCollection,bl as BillboardGraphics,ja as BillboardLoadState,eA as BillboardTexture,LN as BillboardVisualizer,w1e as BingMapsGeocoderService,h3 as BingMapsImageryProvider,bD as BingMapsStyle,Vc as BlendEquation,qo as BlendFunction,Oi as BlendOption,Jt as BlendingState,Je as BoundingRectangle,ce as BoundingSphere,Tt as BoundingSphereState,ux as BoundingVolumeSemantics,WDe as BoxEmitter,Uc as BoxGeometry,RF as BoxGeometryUpdater,mC as BoxGraphics,Sm as BoxOutlineGeometry,Rj as BrdfLutGenerator,Ke as Buffer,FC as BufferLoader,Jc as BufferPoint,rf as BufferPointCollection,sp as BufferPointMaterial,Ha as BufferPolygon,af as BufferPolygonCollection,cp as BufferPolygonMaterial,yc as BufferPolyline,sf as BufferPolylineCollection,lp as BufferPolylineMaterial,la as BufferPrimitive,us as BufferPrimitiveCollection,bu as BufferPrimitiveMaterial,Oe as BufferUsage,Yk as CPUStylingPipelineStage,OF as CallbackPositionProperty,Mm as CallbackProperty,vo as Camera,XG as CameraEventAggregator,eo as CameraEventType,Oj as CameraFlightPath,z as Cartesian2,h as Cartesian3,se as Cartesian4,PD as CartesianRectangle,de as Cartographic,I1e as CartographicGeocoderService,P1e as CatmullRomSpline,MC as Cesium3DContentGroup,Ph as Cesium3DTile,Vm as Cesium3DTileBatchTable,Qu as Cesium3DTileColorBlendMode,qDe as Cesium3DTileContent,qE as Cesium3DTileContentFactory,ir as Cesium3DTileContentState,Os as Cesium3DTileContentType,as as Cesium3DTileFeature,Km as Cesium3DTileFeatureTable,Ih as Cesium3DTileOptimizationHint,OU as Cesium3DTileOptimizations,or as Cesium3DTilePass,nm as Cesium3DTilePassState,nA as Cesium3DTilePointFeature,pr as Cesium3DTileRefine,sA as Cesium3DTileStyle,FU as Cesium3DTileStyleEngine,HE as Cesium3DTileVectorFeature,M5 as Cesium3DTilesInspector,R5 as Cesium3DTilesInspectorViewModel,r5 as Cesium3DTilesTerrainData,pO as Cesium3DTilesTerrainGeometryProcessor,G1e as Cesium3DTilesTerrainProvider,XDe as Cesium3DTilesVoxelProvider,wa as Cesium3DTileset,zU as Cesium3DTilesetBaseTraversal,BU as Cesium3DTilesetCache,bC as Cesium3DTilesetGraphics,NU as Cesium3DTilesetHeatmap,rv as Cesium3DTilesetMetadata,kU as Cesium3DTilesetMostDetailedTraversal,VU as Cesium3DTilesetSkipTraversal,fp as Cesium3DTilesetStatistics,$s as Cesium3DTilesetTraversal,HU as Cesium3DTilesetVisualizer,N5 as CesiumInspector,B5 as CesiumInspectorViewModel,lw as CesiumTerrainProvider,sH as CesiumWidget,No as Check,yP as CheckerboardMaterialProperty,mH as CircleEmitter,W1e as CircleGeometry,q1e as CircleOutlineGeometry,pz as ClassificationModelDrawCommand,Hk as ClassificationPipelineStage,fI as ClassificationPrimitive,Yn as ClassificationType,si as ClearCommand,ss as ClippingPlane,ba as ClippingPlaneCollection,lD as ClippingPolygon,qm as ClippingPolygonCollection,pp as Clock,Pa as ClockRange,Bo as ClockStep,A5 as ClockViewModel,tPe as CloudCollection,$R as CloudType,U as Color,Pl as ColorBlendMode,Yt as ColorGeometryInstanceAttribute,Wt as ColorMaterialProperty,kRe as Command,Y as ComponentDatatype,LF as Composite3DTileContent,kge as CompositeEntityCollection,CP as CompositeMaterialProperty,bc as CompositePositionProperty,Nl as CompositeProperty,EM as CompressedTextureBuffer,Kl as ComputeCommand,CM as ComputeEngine,cU as ConditionsExpression,nPe as ConeEmitter,au as ConstantPositionProperty,fi as ConstantProperty,lk as ConstantSpline,xU as ContentMetadata,$T as Context,Mt as ContextLimits,kV as CoplanarPolygonGeometry,lA as CoplanarPolygonGeometryLibrary,Dh as CoplanarPolygonOutlineGeometry,Ji as CornerType,H2 as CorrelationGroup,hv as CorridorGeometry,oo as CorridorGeometryLibrary,eV as CorridorGeometryUpdater,gC as CorridorGraphics,ZU as CorridorOutlineGeometry,xt as Credit,jj as CreditDisplay,oa as CubeMap,kM as CubeMapFace,KS as CubeMapPanorama,GT as CubicRealPolynomial,Li as CullFace,is as CullingVolume,Hd as CumulusCloud,rV as CustomDataSource,Y1e as CustomHeightmapTerrainProvider,Pg as CustomShader,Y_ as CustomShaderMode,e3 as CustomShaderPipelineStage,Cx as CustomShaderTranslucencyMode,aV as CylinderGeometry,pv as CylinderGeometryLibrary,cV as CylinderGeometryUpdater,_C as CylinderGraphics,sV as CylinderOutlineGeometry,yV as CzmlDataSource,Da as DataSource,gp as DataSourceClock,bV as DataSourceCollection,g4 as DataSourceDisplay,iPe as DebugAppearance,bg as DebugCameraPrimitive,c6 as DebugInspector,AH as DebugModelMatrixPrimitive,K1e as DefaultProxy,hc as DepthFunction,Kj as DepthPlane,t3 as DequantizationPipelineStage,Tg as DerivedCommand,_e as DeveloperError,$j as DeviceOrientationCameraController,oPe as DirectionalLight,CD as DiscardEmptyTileImagePolicy,u3 as DiscardMissingTileImagePolicy,kt as DistanceDisplayCondition,qn as DistanceDisplayConditionGeometryInstanceAttribute,uy as DoubleEndedPriorityQueue,MU as DoublyLinkedList,w_ as DracoLoader,tt as DrawCommand,k_ as DynamicAtmosphereLightingType,z_ as DynamicEnvironmentMapManager,Iv as DynamicGeometryBatch,Ti as DynamicGeometryUpdater,aM as EarthOrientationParameters,Iy as EarthOrientationParametersSample,Oa as EasingFunction,i3 as EdgeDetectionPipelineStage,_h as EdgeDisplayMode,aG as EdgeFramebuffer,a3 as EdgeVisibilityPipelineStage,vu as EllipseGeometry,hf as EllipseGeometryLibrary,PV as EllipseGeometryUpdater,AC as EllipseGraphics,Dd as EllipseOutlineGeometry,te as Ellipsoid,u_ as EllipsoidGeodesic,tc as EllipsoidGeometry,RV as EllipsoidGeometryUpdater,yC as EllipsoidGraphics,xd as EllipsoidOutlineGeometry,Tj as EllipsoidPrimitive,jc as EllipsoidRhumbLine,rPe as EllipsoidSurfaceAppearance,za as EllipsoidTangentPlane,Ag as EllipsoidTerrainProvider,mp as EllipsoidalOccluder,H0 as Empty3DTileContent,Tn as EncodedCartesian3,Yo as Entity,Ed as EntityCluster,Js as EntityCollection,y4 as EntityView,aPe as EquirectangularPanorama,ye as Event,Yr as EventHelper,dh as Expression,St as ExpressionNodeType,vd as ExtrapolationType,cn as FeatureDetection,Tx as FeatureIdPipelineStage,Jj as Fog,Fe as ForEach,TH as FrameRateMonitor,Zj as FrameState,pa as Framebuffer,bi as FramebufferManager,G as Frozen,sG as FrustumCommands,PS as FrustumGeometry,Hj as FrustumOutlineGeometry,ea as Fullscreen,U5 as FullscreenButton,k5 as FullscreenButtonViewModel,Yx as GaussianSplat3DTileContent,yU as GaussianSplatPrimitive,pU as GaussianSplatRenderResources,WE as GaussianSplatSorter,mU as GaussianSplatTextureGenerator,bb as GeoJsonDataSource,ik as GeoJsonLoader,hPe as GeoJsonPrimitive,fT as GeocodeType,G5 as Geocoder,gO as GeocoderService,V5 as GeocoderViewModel,Hi as GeographicProjection,Yi as GeographicTilingScheme,At as Geometry,jF as Geometry3DTileContent,Me as GeometryAttribute,_n as GeometryAttributes,J1e as GeometryFactory,Bt as GeometryInstance,Tl as GeometryInstanceAttribute,ln as GeometryOffsetAttribute,kn as GeometryPipeline,l3 as GeometryPipelineStage,th as GeometryType,Ci as GeometryUpdater,Hv as GeometryUpdaterSet,n4 as GeometryVisualizer,tp as GetFeatureInfoFormat,_j as Globe,cG as GlobeDepth,Q8 as GlobeSurfaceShaderSet,Zh as GlobeSurfaceTile,sj as GlobeSurfaceTileProvider,cj as GlobeTranslucency,lG as GlobeTranslucencyFramebuffer,eG as GlobeTranslucencyState,qI as GltfBufferViewLoader,YI as GltfDracoLoader,q2 as GltfGpmLoader,dD as GltfGpmLocal,KI as GltfImageLoader,QI as GltfIndexBufferLoader,JI as GltfJsonLoader,id as GltfLoader,Zu as GltfLoaderUtil,Q2 as GltfMeshPrimitiveGpmLoader,p2 as GltfSpzLoader,k2 as GltfStructuralMetadataLoader,ZI as GltfTextureLoader,eD as GltfVertexBufferLoader,v3 as Google2DImageryProvider,APe as GoogleEarthEnterpriseImageryProvider,y3 as GoogleEarthEnterpriseMapsProvider,my as GoogleEarthEnterpriseMetadata,_O as GoogleEarthEnterpriseTerrainData,oRe as GoogleEarthEnterpriseTerrainProvider,EH as GoogleEarthEnterpriseTileInformation,aRe as GoogleGeocoderService,Ps as GoogleMaps,yPe as GoogleStreetViewCubeMapPanoramaProvider,N4 as GpxDataSource,Wg as GregorianDate,xPe as GridImageryProvider,OP as GridMaterialProperty,Zn as GroundGeometryUpdater,fC as GroundPolylineGeometry,Im as GroundPolylinePrimitive,ou as GroundPrimitive,uP as GroupMetadata,Hh as HeadingPitchRange,kc as HeadingPitchRoll,tM as Heap,nt as HeightReference,Jh as HeightmapEncoding,ol as HeightmapTerrainData,Z1 as HeightmapTessellator,uV as HermitePolynomialApproximation,yx as HermiteSpline,VI as HilbertOrder,q5 as HomeButton,H5 as HomeButtonViewModel,Bi as HorizontalOrigin,aOe as I3SBuildingSceneLayerExplorer,X5 as I3SBuildingSceneLayerExplorerViewModel,Qp as I3SDataProvider,vH as I3SDecoder,SH as I3SFeature,IH as I3SField,nO as I3SGeometry,tw as I3SLayer,iO as I3SNode,MH as I3SStatistics,BH as I3SSublayer,RH as I3SSymbology,ck as I3dmLoader,rk as I3dmParser,IPe as ITwinData,As as ITwinPlatform,yj as Iau2000Orientation,uM as Iau2006XysData,NT as Iau2006XysSample,xj as IauOrientationAxes,Aj as IauOrientationParameters,OC as ImageBasedLighting,Ck as ImageBasedLightingPipelineStage,Ky as ImageMaterialProperty,ID as Imagery,vz as ImageryConfiguration,RD as ImageryCoverage,R3 as ImageryFlags,M3 as ImageryInput,va as ImageryLayer,sv as ImageryLayerCollection,Jm as ImageryLayerFeatureInfo,B3 as ImageryPipelineStage,rd as ImageryProvider,Vn as ImageryState,oD as Implicit3DTileContent,jI as ImplicitAvailabilityBitstream,GI as ImplicitMetadataView,Va as ImplicitSubdivisionScheme,O_ as ImplicitSubtree,hH as ImplicitSubtreeCache,WF as ImplicitSubtreeMetadata,$0 as ImplicitTileCoordinates,Q0 as ImplicitTileset,Ue as IndexDatatype,$5 as InfoBox,K5 as InfoBoxViewModel,Lf as InspectorShared,wr as InstanceAttributeSemantic,kk as InstancingPipelineStage,sRe as InterpolationAlgorithm,Xm as InterpolationType,qt as Intersect,ui as IntersectionTests,Jp as Intersections2D,ia as Interval,yR as InvertClassification,Fm as Ion,xy as IonGeocodeProviderType,gw as IonGeocoderService,Au as IonImageryProvider,wD as IonImageryProviderFactory,ya as IonResource,K_ as IonWorldImageryStyle,Qe as Iso8601,nG as JobScheduler,Yc as JobType,U_ as JsonMetadataTable,Q as JulianDate,vM as KTX2Transcoder,br as KeyboardEventModifier,Lo as KeyframeNode,F4 as KmlCamera,xS as KmlDataSource,I8 as KmlLookAt,P8 as KmlTour,O8 as KmlTourFlyTo,M8 as KmlTourWait,Bx as Label,k0 as LabelCollection,Pm as LabelGraphics,_r as LabelStyle,i4 as LabelVisualizer,fV as LagrangePolynomialApproximation,uo as LeapSecond,PPe as Light,N0 as LightingModel,N3 as LightingPipelineStage,yv as LinearApproximation,Ax as LinearSpline,NPe as MVTDataProvider,lu as ManagedArray,Mu as MapMode2D,uRe as MapProjection,x3 as MapboxImageryProvider,kPe as MapboxStyleImageryProvider,O3 as MappedPositions,qi as Material,go as MaterialAppearance,U3 as MaterialPipelineStage,vr as MaterialProperty,D as Math,Wi as Matrix2,$ as Matrix3,R as Matrix4,N6 as Megatexture,K2 as MeshPrimitiveGpmLocal,Hm as MetadataClass,v0 as MetadataClassProperty,Rt as MetadataComponentType,Un as MetadataEntity,y2 as MetadataEnum,_2 as MetadataEnumValue,oG as MetadataPicking,sd as MetadataPickingPipelineStage,Ah as MetadataPipelineStage,du as MetadataSchema,lx as MetadataSchemaLoader,gh as MetadataSemantic,mh as MetadataTable,YF as MetadataTableProperty,ht as MetadataType,rh as MipmapHint,cd as Model,ld as Model3DTileContent,ME as ModelAlphaOptions,hk as ModelAnimation,dk as ModelAnimationChannel,pk as ModelAnimationCollection,ef as ModelAnimationLoop,Qm as ModelAnimationState,Sk as ModelArticulation,Ek as ModelArticulationStage,Dk as ModelClippingPlanesPipelineStage,Ok as ModelClippingPolygonsPipelineStage,bx as ModelColorPipelineStage,yn as ModelComponents,gz as ModelDrawCommand,yz as ModelDrawCommands,gk as ModelFeature,_k as ModelFeatureTable,h_ as ModelGraphics,Sz as ModelImagery,RE as ModelImageryMapping,hz as ModelLightingOptions,zk as ModelMatrixUpdateStage,Mk as ModelNode,OE as ModelPrimitiveImagery,Is as ModelReader,oz as ModelRenderResources,Vk as ModelRuntimeNode,nz as ModelRuntimePrimitive,bz as ModelSceneGraph,cz as ModelSilhouettePipelineStage,iz as ModelSkin,fz as ModelSplitterPipelineStage,Tz as ModelStatistics,qr as ModelType,mt as ModelUtility,r4 as ModelVisualizer,vj as Moon,j3 as MorphTargetsPipelineStage,fRe as MorphWeightSpline,tb as MortonOrder,CU as Multiple3DTileContent,wN as MultisampleFramebuffer,e9 as NavigationHelpButton,J5 as NavigationHelpButtonViewModel,Ut as NearFarScalar,zPe as NeverTileDiscardPolicy,dz as NodeRenderResources,Uk as NodeStatisticsPipelineStage,xC as NodeTransformationProperty,fG as OIT,Dj as Occluder,po as OffsetGeometryInstanceAttribute,dRe as OpenCageGeocoderService,py as OpenStreetMapImageryProvider,CV as OrderedGroundPrimitiveCollection,$t as OrientedBoundingBox,fn as OrthographicFrustum,ga as OrthographicOffCenterFrustum,hRe as Packable,mRe as PackableForInterpolation,VPe as Panorama,jPe as PanoramaProvider,sO as Particle,WPe as ParticleBurst,YPe as ParticleEmitter,QPe as ParticleSystem,Ie as Pass,_l as PassState,m_ as PathGraphics,u4 as PathVisualizer,f5 as PeliasGeocoderService,hn as PerInstanceColorAppearance,ny as PerformanceDisplay,i9 as PerformanceWatchdog,t9 as PerformanceWatchdogViewModel,Gi as PerspectiveFrustum,Ru as PerspectiveOffCenterFrustum,rG as PickDepth,dG as PickDepthFramebuffer,hG as PickFramebuffer,zM as PickId,V6 as PickedMetadataInfo,CG as Picking,G3 as PickingPipelineStage,FA as PinBuilder,je as PixelDatatype,Xe as PixelFormat,tn as Plane,BV as PlaneGeometry,FV as PlaneGeometryUpdater,PF as PlaneGraphics,NV as PlaneOutlineGeometry,Ez as PntsLoader,BE as PntsParser,aH as PointCloud,H_ as PointCloudEyeDomeLighting,I0 as PointCloudShading,W3 as PointCloudStylingPipelineStage,TC as PointGraphics,Bs as PointPrimitive,IP as PointPrimitiveCollection,f4 as PointVisualizer,F_ as PolygonGeometry,Kn as PolygonGeometryLibrary,VV as PolygonGeometryUpdater,Rm as PolygonGraphics,Gc as PolygonHierarchy,UV as PolygonOutlineGeometry,ni as PolygonPipeline,Ch as Polyline,MP as PolylineArrowMaterialProperty,ap as PolylineCollection,Ua as PolylineColorAppearance,BP as PolylineDashMaterialProperty,NA as PolylineGeometry,h4 as PolylineGeometryUpdater,LP as PolylineGlowMaterialProperty,El as PolylineGraphics,mc as PolylineMaterialAppearance,sb as PolylineOutlineMaterialProperty,$i as PolylinePipeline,p4 as PolylineVisualizer,jV as PolylineVolumeGeometry,dp as PolylineVolumeGeometryLibrary,HV as PolylineVolumeGeometryUpdater,CC as PolylineVolumeGraphics,GV as PolylineVolumeOutlineGeometry,Dm as PositionProperty,bA as PositionPropertyArray,Ro as PostProcessStage,HG as PostProcessStageCollection,wf as PostProcessStageComposite,kd as PostProcessStageLibrary,Fd as PostProcessStageSampleMode,kS as PostProcessStageTextureCache,X2 as PpeMetadata,RRe as PpeSource,Y2 as PpeTexture,Pn as Primitive,Eu as PrimitiveCollection,aE as PrimitiveLoadPlan,rE as PrimitiveOutlineGenerator,X3 as PrimitiveOutlinePipelineStage,sC as PrimitivePipeline,mz as PrimitiveRenderResources,ra as PrimitiveState,K3 as PrimitiveStatisticsPipelineStage,Re as PrimitiveType,s9 as ProjectionPicker,r9 as ProjectionPickerViewModel,X as Property,NP as PropertyArray,iE as PropertyAttribute,L2 as PropertyAttributeProperty,cu as PropertyBag,mu as PropertyTable,V_ as PropertyTexture,B2 as PropertyTextureProperty,cr as ProviderViewModel,gRe as Proxy,Jl as QuadraticRealPolynomial,lj as QuadtreeOccluders,gj as QuadtreePrimitive,fj as QuadtreeTile,ac as QuadtreeTileLoadState,$Pe as QuadtreeTileProvider,rw as QuantizedMeshTerrainData,IM as QuarticRealPolynomial,Le as Quaternion,fk as QuaternionSpline,dx as Queue,An as Ray,oe as Rectangle,Kv as RectangleCollisionChecker,Uv as RectangleGeometry,Ms as RectangleGeometryLibrary,WV as RectangleGeometryUpdater,Om as RectangleGraphics,$E as RectangleOutlineGeometry,Ni as ReferenceFrame,CA as ReferenceProperty,Ve as RenderState,Wf as Renderbuffer,tu as RenderbufferFormat,Cr as Request,r0 as RequestErrorEvent,pl as RequestScheduler,Ai as RequestState,ts as RequestType,De as Resource,Pi as ResourceCache,hu as ResourceCacheKey,b2 as ResourceCacheStatistics,Ki as ResourceLoader,gt as ResourceLoaderState,Bh as Rotation,re as RuntimeError,v_ as S2Cell,Xs as SDFSettings,Tc as SampledPositionProperty,wd as SampledProperty,jt as Sampler,ug as ScaledPositionProperty,W6 as Scene,BS as SceneFramebuffer,ie as SceneMode,Q3 as SceneMode2DPipelineStage,T9 as SceneModePicker,x9 as SceneModePickerViewModel,io as SceneTransforms,YG as SceneTransitioner,o6 as ScreenSpaceCameraController,zd as ScreenSpaceEventHandler,Sn as ScreenSpaceEventType,Ex as SelectedFeatureIdPipelineStage,f9 as SelectionIndicator,l9 as SelectionIndicatorViewModel,zP as SensorVolumePortionToDisplay,i_ as ShaderBuilder,bN as ShaderCache,he as ShaderDestination,DN as ShaderFunction,Qt as ShaderProgram,He as ShaderSource,IN as ShaderStruct,ry as ShadowMap,vg as ShadowMapShader,vn as ShadowMode,Qf as ShadowVolumeAppearance,RN as SharedContext,En as ShowGeometryInstanceAttribute,Vy as Simon1994PlanetaryPositions,_Re as SimplePolylineGeometry,b3 as SingleTileImageryProvider,J3 as SkinningPipelineStage,X6 as SkyAtmosphere,J6 as SkyBox,F6 as SpatialNode,W2 as Spdcf,Nm as SpecularEnvironmentCubeMap,JPe as SphereEmitter,bH as SphereGeometry,fA as SphereOutlineGeometry,dV as Spherical,To as Spline,Vr as SplitDirection,WR as Splitter,zh as StaticGeometryColorBatch,Vh as StaticGeometryPerMaterialBatch,n1 as StaticGroundGeometryColorBatch,t4 as StaticGroundGeometryPerMaterialBatch,m4 as StaticGroundPolylinePerMaterialBatch,i1 as StaticOutlineGeometryBatch,Ht as StencilConstants,Xn as StencilFunction,vt as StencilOperation,uk as SteppedSpline,Dl as Stereographic,gx as StorageType,FP as StripeMaterialProperty,_p as StripeOrientation,Ys as StructuralMetadata,$m as StyleCommandsNeeded,ZPe as StyleExpression,nH as Sun,t_ as SunLight,s6 as SunPostProcess,V2 as SupportedImageFormats,_5 as SvgPathBindingHandler,ON as Sync,Wn as TaskProcessor,JH as Terrain,Ef as TerrainData,yr as TerrainEncoding,iR as TerrainFillMesh,vc as TerrainMesh,SC as TerrainOffsetProperty,q8 as TerrainPicker,zo as TerrainProvider,rc as TerrainQuantization,Po as TerrainState,Dt as Texture,MN as Texture3D,ZT as TextureAtlas,CN as TextureCache,ti as TextureMagnificationFilter,h6 as TextureManager,Vt as TextureMinificationFilter,Zw as TexturePacker,m6 as TextureUniform,un as TextureWrap,Zp as TileAvailability,yd as TileBoundingRegion,wU as TileBoundingS2Cell,dA as TileBoundingSphere,c1e as TileBoundingVolume,ZH as TileCoordinatesImageryProvider,l1e as TileDiscardPolicy,Cn as TileEdge,DD as TileImagery,vx as TileMapServiceImageryProvider,bU as TileMetadata,cf as TileOrientedBoundingBox,Qo as TileProviderError,hj as TileReplacementQueue,ri as TileSelectionResult,f1e as TileState,Iz as Tileset3DTileContent,RU as TilesetMetadata,Ak as TilesetPipelineStage,ARe as TilingScheme,oi as TimeConstants,wE as TimeDynamicImagery,YR as TimeDynamicPointCloud,wn as TimeInterval,Ia as TimeIntervalCollection,vA as TimeIntervalCollectionPositionProperty,SA as TimeIntervalCollectionProperty,ei as TimeStandard,m9 as Timeline,d9 as TimelineHighlightRange,h9 as TimelineTrack,PM as Tipsify,mT as ToggleButtonViewModel,sy as Tonemapper,l_ as TrackingReferenceFrame,pt as Transforms,$y as TranslationRotationScale,gG as TranslucentTileClassification,gD as TridiagonalSystemSolver,Rw as TrustedServers,US as TweenCollection,vN as UniformState,Dg as UniformType,NH as UrlTemplate3DTilesDataProvider,Ca as UrlTemplateImageryProvider,NLo as VERSION,A9 as VRButton,g9 as VRButtonViewModel,bRe as VRTheWorldTerrainProvider,DRe as VaryingType,b0 as Vector3DTileBatch,qz as Vector3DTileClampedPolylines,Xz as Vector3DTileContent,b_ as Vector3DTileGeometry,Vz as Vector3DTilePoints,jz as Vector3DTilePolygons,UE as Vector3DTilePolylines,LC as Vector3DTilePrimitive,Wx as VectorGltf3DTileContent,mV as VelocityOrientationProperty,wA as VelocityVectorProperty,Fn as VertexArray,r_ as VertexArrayFacade,it as VertexAttributeSemantic,Ne as VertexFormat,ho as VerticalExaggeration,ez as VerticalExaggerationPipelineStage,zn as VerticalOrigin,TRe as VideoSynchronizer,NS as View,yOe as Viewer,d1e as ViewportQuad,Qr as Visibility,CEe as Visualizer,ly as VoxelBoundsCollection,WS as VoxelBoxShape,l6 as VoxelCell,HS as VoxelContent,qS as VoxelCylinderShape,YS as VoxelEllipsoidShape,v9 as VoxelInspector,C9 as VoxelInspectorViewModel,Rg as VoxelMetadataOrder,Jb as VoxelPrimitive,h1e as VoxelProvider,R6 as VoxelRenderResources,m1e as VoxelShape,wc as VoxelShapeType,z6 as VoxelTraversal,ERe as VulkanConstants,YV as WallGeometry,jv as WallGeometryLibrary,KV as WallGeometryUpdater,p_ as WallGraphics,XV as WallOutlineGeometry,ee as WebGLConstants,C3 as WebMapServiceImageryProvider,E3 as WebMapTileServiceImageryProvider,di as WebMercatorProjection,Ir as WebMercatorTilingScheme,ns as WindingOrder,OD as WireframeIndexGenerator,tz as WireframePipelineStage,EG as _shadersAcesTonemappingStage,r6 as _shadersAdditiveBlend,xR as _shadersAdjustTranslucentFS,FN as _shadersAllMaterialAppearanceFS,kN as _shadersAllMaterialAppearanceVS,vG as _shadersAmbientOcclusionGenerate,SG as _shadersAmbientOcclusionModulate,GN as _shadersAspectRampMaterial,Ym as _shadersAtmosphereCommon,yk as _shadersAtmosphereStageFS,xk as _shadersAtmosphereStageVS,zN as _shadersBasicMaterialAppearanceFS,UN as _shadersBasicMaterialAppearanceVS,Dz as _shadersBillboardCollectionFS,Pz as _shadersBillboardCollectionVS,wG as _shadersBlackAndWhite,IG as _shadersBloomComposite,Pj as _shadersBrdfLutGeneratorFS,a6 as _shadersBrightPass,DG as _shadersBrightness,Jz as _shadersBufferPointMaterialFS,$z as _shadersBufferPointMaterialVS,tU as _shadersBufferPolygonMaterialFS,eU as _shadersBufferPolygonMaterialVS,rU as _shadersBufferPolylineMaterialFS,oU as _shadersBufferPolylineMaterialVS,HN as _shadersBumpMapMaterial,qk as _shadersCPUStylingStageFS,Wk as _shadersCPUStylingStageVS,WN as _shadersCheckerboardMaterial,cH as _shadersCloudCollectionFS,lH as _shadersCloudCollectionVS,uH as _shadersCloudNoiseFS,fH as _shadersCloudNoiseVS,pG as _shadersCompareAndPackTranslucentDepth,uG as _shadersCompositeOITFS,LS as _shadersCompositeTranslucentClassification,P2 as _shadersComputeIrradianceFS,R2 as _shadersComputeRadianceMapFS,z3 as _shadersConstantLodStageFS,k3 as _shadersConstantLodStageVS,PG as _shadersContrastBias,O2 as _shadersConvolveSpecularMapFS,M2 as _shadersConvolveSpecularMapVS,$6 as _shadersCubeMapPanoramaVS,Kk as _shadersCustomShaderStageFS,Xk as _shadersCustomShaderStageVS,XT as _shadersCzmBuiltins,RG as _shadersDepthOfField,qj as _shadersDepthPlaneFS,Yj as _shadersDepthPlaneVS,OG as _shadersDepthView,wRe as _shadersDepthViewPacked,qN as _shadersDotMaterial,MG as _shadersEdgeDetection,n3 as _shadersEdgeDetectionStageFS,o3 as _shadersEdgeVisibilityStageFS,r3 as _shadersEdgeVisibilityStageVS,YN as _shadersElevationBandMaterial,XN as _shadersElevationContourMaterial,KN as _shadersElevationRampMaterial,sR as _shadersEllipsoidFS,yH as _shadersEllipsoidSurfaceAppearanceFS,xH as _shadersEllipsoidSurfaceAppearanceVS,cR as _shadersEllipsoidVS,NG as _shadersFXAA,jG as _shadersFXAA3_11,QN as _shadersFadeMaterial,Qk as _shadersFeatureIdStageFS,$k as _shadersFeatureIdStageVS,BG as _shadersFilmicTonemapping,jb as _shadersGaussianBlur1D,s3 as _shadersGeometryStageFS,c3 as _shadersGeometryStageVS,X8 as _shadersGlobeFS,K8 as _shadersGlobeVS,$N as _shadersGridMaterial,tR as _shadersGroundAtmosphere,LB as _shadersHSBToRGB,NB as _shadersHSLToRGB,Tk as _shadersImageBasedLightingStageFS,Bk as _shadersInstancingStageCommon,Lk as _shadersInstancingStageVS,C6 as _shadersIntersectBox,E6 as _shadersIntersectCylinder,b6 as _shadersIntersectDepth,v6 as _shadersIntersectEllipsoid,BR as _shadersIntersectLongitude,T6 as _shadersIntersectPlane,GS as _shadersIntersection,x6 as _shadersIntersectionUtils,Nk as _shadersLegacyInstancingStageVS,FG as _shadersLensFlare,L3 as _shadersLightingStageFS,F3 as _shadersMaterialStageFS,P6 as _shadersMegatexture,Jk as _shadersMetadataStageFS,Zk as _shadersMetadataStageVS,Ik as _shadersModelClippingPlanesStageFS,Rk as _shadersModelClippingPolygonsStageFS,Pk as _shadersModelClippingPolygonsStageVS,wk as _shadersModelColorStageFS,Az as _shadersModelFS,rz as _shadersModelSilhouetteStageFS,az as _shadersModelSilhouetteStageVS,lz as _shadersModelSplitterStageFS,_z as _shadersModelVS,kG as _shadersModifiedReinhardTonemapping,V3 as _shadersMorphTargetsStageVS,zG as _shadersNightVision,JN as _shadersNormalMapMaterial,D6 as _shadersOctree,Sf as _shadersPassThrough,kb as _shadersPassThroughDepth,LG as _shadersPbrNeutralTonemapping,cF as _shadersPerInstanceColorAppearanceFS,lF as _shadersPerInstanceColorAppearanceVS,oC as _shadersPerInstanceFlatColorAppearanceFS,uF as _shadersPerInstanceFlatColorAppearanceVS,Z2 as _shadersPointCloudEyeDomeLighting,H3 as _shadersPointCloudStylingStageVS,ob as _shadersPointPrimitiveCollectionFS,iV as _shadersPointPrimitiveCollectionVS,D2 as _shadersPolygonSignedDistanceFS,ZN as _shadersPolylineArrowMaterial,IF as _shadersPolylineColorAppearanceVS,ru as _shadersPolylineCommon,eF as _shadersPolylineDashMaterial,dC as _shadersPolylineFS,tF as _shadersPolylineGlowMaterial,DF as _shadersPolylineMaterialAppearanceVS,nF as _shadersPolylineOutlineMaterial,EF as _shadersPolylineShadowVolumeFS,vF as _shadersPolylineShadowVolumeMorphFS,SF as _shadersPolylineShadowVolumeMorphVS,wF as _shadersPolylineShadowVolumeVS,Nz as _shadersPolylineVS,_U as _shadersPrimitiveGaussianSplatFS,gU as _shadersPrimitiveGaussianSplatVS,Y3 as _shadersPrimitiveOutlineStageFS,q3 as _shadersPrimitiveOutlineStageVS,FB as _shadersRGBToHSB,kB as _shadersRGBToHSL,zB as _shadersRGBToXYZ,UG as _shadersReinhardTonemapping,I3 as _shadersReprojectWebMercatorFS,D3 as _shadersReprojectWebMercatorVS,iF as _shadersRimLightingMaterial,yD as _shadersSelectedFeatureIdStageCommon,uI as _shadersShadowVolumeAppearanceFS,mF as _shadersShadowVolumeAppearanceVS,Hy as _shadersShadowVolumeFS,VG as _shadersSilhouette,$3 as _shadersSkinningStageVS,VR as _shadersSkyAtmosphereCommon,q6 as _shadersSkyAtmosphereFS,Y6 as _shadersSkyAtmosphereVS,K6 as _shadersSkyBoxFS,Q6 as _shadersSkyBoxVS,oF as _shadersSlopeRampMaterial,rF as _shadersStripeMaterial,Z6 as _shadersSunFS,eH as _shadersSunTextureFS,tH as _shadersSunVS,VN as _shadersTexturedMaterialAppearanceFS,jN as _shadersTexturedMaterialAppearanceVS,Wz as _shadersVector3DTileClampedPolylinesFS,Hz as _shadersVector3DTileClampedPolylinesVS,Gz as _shadersVector3DTilePolylinesVS,zI as _shadersVectorTileVS,Z3 as _shadersVerticalExaggerationStageVS,dH as _shadersViewportQuadFS,UT as _shadersViewportQuadVS,A6 as _shadersVoxelFS,_6 as _shadersVoxelUtils,y6 as _shadersVoxelVS,sF as _shadersWater,aF as _shadersWaterMaskMaterial,UB as _shadersXYZToRGB,VB as _shadersacesTonemapping,jB as _shadersalphaWeight,GB as _shadersantialias,HB as _shadersapplyHSBShift,WB as _shadersapproximateSphericalCoordinates,qB as _shadersapproximateTanh,YB as _shadersbackFacing,XB as _shadersbranchFreeTernary,KB as _shaderscascadeColor,QB as _shaderscascadeDistance,$B as _shaderscascadeMatrix,JB as _shaderscascadeWeights,ZB as _shadersclipPolygons,eL as _shaderscolumbusViewMorph,tL as _shaderscomputeAtmosphereColor,nL as _shaderscomputeGroundAtmosphereScattering,iL as _shaderscomputePosition,oL as _shaderscomputeScattering,rL as _shaderscomputeTextureTransform,S6 as _shadersconvertLocalToBoxUv,w6 as _shadersconvertLocalToCylinderUv,I6 as _shadersconvertLocalToEllipsoidUv,aL as _shaderscosineAndSine,sL as _shadersdecodeRGB8,cL as _shadersdecompressTextureCoordinates,UM as _shadersdegreesPerRadian,lL as _shadersdepthClamp,VM as _shadersdepthRange,wB as _shadersdepthRangeStruct,uL as _shaderseastNorthUpToEyeCoordinates,fL as _shadersellipsoidContainsPoint,dL as _shadersellipsoidTextureCoordinates,jM as _shadersepsilon1,GM as _shadersepsilon2,HM as _shadersepsilon3,WM as _shadersepsilon4,qM as _shadersepsilon5,YM as _shadersepsilon6,XM as _shadersepsilon7,hL as _shadersequalsEpsilon,mL as _shaderseyeOffset,pL as _shaderseyeToWindowCoordinates,gL as _shadersfastApproximateAtan,_L as _shadersfog,AL as _shadersgammaCorrect,yL as _shadersgeodeticSurfaceNormal,xL as _shadersgetDefaultMaterial,bL as _shadersgetDynamicAtmosphereLightDirection,TL as _shadersgetLambertDiffuse,CL as _shadersgetSpecular,EL as _shadersgetWaterNoise,vL as _shadershue,KM as _shadersinfinity,SL as _shadersinverseGamma,wL as _shadersisEmpty,IL as _shadersisFull,DL as _shaderslatitudeToWebMercatorFraction,PL as _shaderslineDistance,RL as _shaderslinearToSrgb,OL as _shadersluminance,IB as _shadersmaterial,DB as _shadersmaterialInput,ML as _shadersmaximumComponent,BL as _shadersmetersPerPixel,PB as _shadersmodelMaterial,LL as _shadersmodelToWindowCoordinates,RB as _shadersmodelVertexOutput,NL as _shadersmultiplyWithColorBalance,FL as _shadersnearFarScalar,kL as _shadersoctDecode,QM as _shadersoneOverPi,$M as _shadersoneOverTwoPi,zL as _shaderspackDepth,JM as _shaderspassCesium3DTile,ZM as _shaderspassCesium3DTileClassification,eB as _shaderspassCesium3DTileClassificationIgnoreShow,tB as _shaderspassCesium3DTileEdges,nB as _shaderspassCesium3DTileEdgesDirect,iB as _shaderspassClassification,oB as _shaderspassCompute,rB as _shaderspassEnvironment,aB as _shaderspassGaussianSplats,sB as _shaderspassGlobe,cB as _shaderspassOpaque,lB as _shaderspassOverlay,uB as _shaderspassTerrainClassification,fB as _shaderspassTranslucent,dB as _shaderspassVoxels,UL as _shaderspbrLighting,VL as _shaderspbrNeutralTonemapping,jL as _shadersphong,hB as _shaderspi,mB as _shaderspiOverFour,pB as _shaderspiOverSix,gB as _shaderspiOverThree,_B as _shaderspiOverTwo,GL as _shadersplaneDistance,HL as _shaderspointAlongRay,AB as _shadersradiansPerDegree,OB as _shadersray,WL as _shadersrayEllipsoidIntersectionInterval,MB as _shadersraySegment,qL as _shadersraySphereIntersectionInterval,YL as _shadersreadDepth,XL as _shadersreadNonPerspective,KL as _shadersreverseLogDepth,QL as _shadersround,$L as _shaderssaturation,yB as _shaderssceneMode2D,xB as _shaderssceneMode3D,bB as _shaderssceneModeColumbusView,TB as _shaderssceneModeMorphing,JL as _shadersshadowDepthCompare,BB as _shadersshadowParameters,ZL as _shadersshadowVisibility,eN as _shaderssignNotZero,CB as _shaderssolarRadius,tN as _shaderssphericalHarmonics,nN as _shaderssrgbToLinear,iN as _shaderstangentToEyeSpaceMatrix,oN as _shaderstextureCube,EB as _shadersthreePiOver2,rN as _shaderstransformPlane,aN as _shaderstranslateRelativeToEye,sN as _shaderstranslucentPhong,cN as _shaderstranspose,vB as _shaderstwoPi,lN as _shadersunpackClippingExtents,uN as _shadersunpackDepth,fN as _shadersunpackFloat,dN as _shadersunpackTexture,hN as _shadersunpackUint,mN as _shadersvalueTransform,pN as _shadersvertexLogDepth,SB as _shaderswebMercatorMaxLatitude,gN as _shaderswindowToEyeCoordinates,_N as _shaderswriteDepthClamp,AN as _shaderswriteLogDepth,yN as _shaderswriteNonPerspective,Jn as addAllToArray,o2 as addBuffer,KF as addDefaults,t2 as addExtensionsRequired,ph as addExtensionsUsed,sx as addPipelineExtras,Ss as addToArray,$O as appendForwardSlash,Fo as arrayRemoveDuplicates,rae as assert,jT as barycentricCoordinates,Ao as binarySearch,Xt as buildModuleUrl,kH as buildVectorGltfFromMVT,MR as buildVoxelCustomShader,O6 as buildVoxelDrawCommands,qe as clone,It as combine,TS as computeFlyToLocationForRectangle,LE as createBillboardPointCallback,u6 as createColorRamp,Dn as createCommand,I5 as createDefaultImageryProviderViewModels,D5 as createDefaultTerrainProviderViewModels,A1e as createElevationBandMaterial,x1e as createGooglePhotorealistic3DTileset,Hn as createGuid,er as createMaterialPropertyDescriptor,b1e as createOsmBuildingsAsync,pe as createPropertyDescriptor,su as createRawPropertyDescriptor,T1e as createTangentSpaceDebugPrimitive,ORe as createTaskProcessorWorker,yM as createUniform,xM as createUniformArray,uU as createVectorTileBuffersFromModelComponents,$H as createWorldBathymetryAsync,Q_ as createWorldImageryAsync,uw as createWorldTerrainAsync,CH as decodeGoogleEarthEnterpriseData,jH as decodeMVT,Yz as decodeVectorPolylinePositions,Gu as defer,l as defined,xN as demodernizeShader,Hs as deprecationWarning,fe as destroyObject,MEe as exportKml,UC as findAccessorMinMax,YE as findContentMetadata,XE as findGroupMetadata,TU as findTileMetadata,$I as forEachTextureInMaterial,B0 as formatError,Xoe as freezeRenderState,Jd as getAbsoluteUri,Ju as getAccessorByteStride,JO as getBaseUri,uh as getBinaryAccessor,iH as getClipAndStyleCode,ES as getClippingFunction,D_ as getComponentReader,Bn as getElement,Yg as getExtensionFromUri,xA as getFilenameFromUri,f6 as getImageFromTypedArray,mm as getImagePixels,Sr as getJsonFromTypedArray,Um as getMagic,$2 as getMeshPrimitives,U6 as getMetadataClassProperty,j6 as getMetadataProperty,Ku as getStringFromTypedArray,zi as getTimestamp,vi as hasExtension,g_ as heightReferenceOnEntityPropertyChanged,Wl as isBitSet,PT as isBlobUri,Dy as isCrossOriginUrl,gm as isDataUri,hm as isLeapYear,ve as knockout,Aw as knockout_3_5_1,g5 as knockout_es5,RT as loadAndExecuteScript,BN as loadCubeMap,I_ as loadImageFromTypedArray,Hu as loadKTX2,xg as mergeSort,e2 as moveTechniqueRenderStates,n2 as moveTechniquesToExtension,Zf as numberOfComponentsForType,OT as objectToQuery,_t as oneTimeWarning,W_ as parseBatchTable,F2 as parseFeatureMetadataLegacy,zC as parseGlb,eM as parseResponseHeaders,N2 as parseStructuralMetadata,ND as pickModel,vRe as pointInsideTriangle,cA as preprocess3DTileContent,g6 as processVoxelProperties,Uf as queryToObject,r2 as readAccessorPacked,VC as removeExtension,$F as removeExtensionsRequired,kC as removeExtensionsUsed,ZF as removePipelineExtras,i2 as removeUnusedElements,Zz as renderBufferPointCollection,iU as renderBufferPolygonCollection,sU as renderBufferPolylineCollection,cx as resizeImageToNextPowerOfTwo,j8 as sampleTerrain,bS as sampleTerrainMostDetailed,ST as scaleToGeodeticSurface,ZS as srgbToLinear,pF as subdivideArray,Dc as subscribeAndEvaluate,s2 as updateAccessorComponentTypes,l2 as updateVersion,Hr as usesExtension,xOe as viewerCesium3DTilesInspectorMixin,bOe as viewerCesiumInspectorMixin,COe as viewerDragDropMixin,EOe as viewerPerformanceWatchdogMixin,SOe as viewerVoxelInspectorMixin,SRe as webGLConstantToGlslType,p5 as wrapFunction,FE as writeTextToCanvas};